Skip to content

Conversation

@papattes
Copy link

TODO

to make the variable tap available when receiving a notification from the background, replace :

//Tells the app that a remote notification arrived that indicates there is data to be fetched.
// Called when a message arrives in the foreground and remote notifications permission has been granted
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
    fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {

    @try{
        NSDictionary *mutableUserInfo = [userInfo mutableCopy];
        NSDictionary* aps = [mutableUserInfo objectForKey:@"aps"];
        if([aps objectForKey:@"alert"] != nil){
            [mutableUserInfo setValue:@"notification" forKey:@"messageType"];
        }else{
            [mutableUserInfo setValue:@"data" forKey:@"messageType"];
        }

        NSLog(@"didReceiveRemoteNotification: %@", mutableUserInfo);
        
        completionHandler(UIBackgroundFetchResultNewData);
        [self processMessageForForegroundNotification:mutableUserInfo];
        [FirebasePlugin.firebasePlugin sendNotification:mutableUserInfo];
    }@catch (NSException *exception) {
        [FirebasePlugin.firebasePlugin handlePluginExceptionWithoutContext:exception];
    }
}

By

//Tells the app that a remote notification arrived that indicates there is data to be fetched.
// Called when a message arrives in the foreground and remote notifications permission has been granted
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
    fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {

    @try{
        NSDictionary *mutableUserInfo = [userInfo mutableCopy];
        NSDictionary* aps = [mutableUserInfo objectForKey:@"aps"];
        if([aps objectForKey:@"alert"] != nil){
            [mutableUserInfo setValue:@"notification" forKey:@"messageType"];
        }else{
            [mutableUserInfo setValue:@"data" forKey:@"messageType"];
        }

        NSString* tap;
        if([self.applicationInBackground isEqual:[NSNumber numberWithBool:YES]]){
            tap = @"background";
        }else{
            tap = @"foreground";
        }
        [mutableUserInfo setValue:tap forKey:@"tap"];
        if([mutableUserInfo objectForKey:@"messageType"] == nil){
            [mutableUserInfo setValue:@"notification" forKey:@"messageType"];
        }

        NSLog(@"didReceiveRemoteNotification: %@", mutableUserInfo);
        
        completionHandler(UIBackgroundFetchResultNewData);
        [self processMessageForForegroundNotification:mutableUserInfo];
        [FirebasePlugin.firebasePlugin sendNotification:mutableUserInfo];
    }@catch (NSException *exception) {
        [FirebasePlugin.firebasePlugin handlePluginExceptionWithoutContext:exception];
    }
}

dpa99c added a commit to dpa99c/cordova-plugin-firebasex that referenced this pull request Aug 30, 2019
…le app is running in background.

* Based on arnesson#1104
* Resolves #96
@dpa99c dpa99c force-pushed the master branch 2 times, most recently from 21bc600 to ad9ec9d Compare September 30, 2020 12:59
dpa99c and others added 19 commits May 25, 2022 13:21
Added 'created' and 'lastUpdate' variable in Timestamp format inside functions 'addDocumentToFirestoreCollection', 'setDocumentInFirestoreCollection' and 'updateDocumentInFirestoreCollection'
Added optional 'timestamp' boolean variable in 'addDocumentToFirestoreCollection', 'setDocumentInFirestoreCollection' and 'updateDocumentInFirestoreCollection'
Added 'created' and 'lastUpdate' variable in Timestamp format inside functions 'addDocumentToFirestoreCollection', 'setDocumentInFirestoreCollection' and 'updateDocumentInFirestoreCollection'
Updated definitions of functions 'addDocumentToFirestoreCollection', 'setDocumentInFirestoreCollection' and 'updateDocumentInFirestoreCollection'
(android) fix no notifications on Android 12 and above, Non-fatal Exception: java.lang.IllegalArgumentException
Added timestamp 'created' and 'lastUpdate' variables in Firestore functions
…OMPILED_FIRESTORE_POD` plugin variable to switch to using pre-built version.

Should resolve #735.
…e to override the Firebase iOS SDK versions specified in `plugin.xml`
dpa99c and others added 30 commits February 25, 2025 14:43
Forcing token refresh when calling getClaims on iOS
… when app is launched from cold start by tapping system notification.

Resolves #917.
…build failure in cordova-android@14 which includes it anyway
…ices; correct wait for JS interface, and use evaluateJavascript
(android) fix: plugin no longer gets stuck during startup on some devices; correct wait for JS interface, and use evaluateJavascript
- Make pending global-JS queue synchronized and guard/drain it only when both pluginInitialized and onPageFinished are true (flush pending JS if init completes after page finish).
- Add evaluateJavascript() fallback to loadUrl for older devices / errors.
- Replace global retry counter with a listener-scoped counter and rename to idTokenNotifyRetryCount / ID_TOKEN_NOTIFY_MAX_RETRIES for clarity.
…11.8.0 to v12.3.0 - September 15, 2025

https://firebase.google.com/support/release-notes/ios#version_1230_-_september_15_2025
Changes minimum deployment version from 13.0 to 15.0.

Also updated:
- GoogleSignIn from v7.1.0 to v9.0.0
- GoogleTagManager from v8.0.0 to v9.0.0
…ated before attempting to fetch FCM token.

Resolves #957
… >= 11.14.0

Fixes #959

BREAKING CHANGE: Default iOS Analytics pods changed to match Firebase SDK >= 11.14.0 requirements

Changes:
- Updated default plugin.xml to use FirebaseAnalytics/Core + FirebaseAnalytics/IdentitySupport
- Replaced deprecated FirebaseAnalyticsOnDeviceConversion with GoogleAdsOnDeviceConversion
- Updated post_install.js to properly handle all 4 configuration combinations

Plugin variable combinations now correctly map to Firebase modules:

| FIREBASE_ANALYTICS_WITHOUT_ADS | IOS_ON_DEVICE_CONVERSION_ANALYTICS | Result |
|-------------------------------|-----------------------------------|--------|
| false (default) | false (default) | FirebaseAnalytics/Core + IdentitySupport |
| true | false | FirebaseAnalytics/Core |
| false | true | FirebaseAnalytics |
| true | true | FirebaseAnalytics/Core + GoogleAdsOnDeviceConversion |

The Firebase iOS SDK >= 11.14.0 migration guide requires:
- Analytics + IDFA (no On-Device Conversion): FirebaseAnalytics/Core + IdentitySupport
- Analytics only (no IDFA): FirebaseAnalytics/Core
- Analytics + IDFA + On-Device Conversion: FirebaseAnalytics (includes everything)
- Analytics + On-Device Conversion (no IDFA): FirebaseAnalytics/Core + GoogleAdsOnDeviceConversion

Previous implementation incorrectly used FirebaseAnalytics as default, which automatically
includes On-Device Conversion in SDK >= 11.14.0, despite IOS_ON_DEVICE_CONVERSION_ANALYTICS
defaulting to false.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
GoogleAdsOnDeviceConversion has its own versioning scheme separate from
the Firebase iOS SDK and should use version 3.1.0, not 12.3.0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ceholder for `google_analytics_adid_collection_enabled` meta-data tag in `plugin.xml`
…UKRt7YPJnFhCCSJQdvKr

Claude/fix GitHub issue 959
(android) fix replacement of google_analytics_adid_collection_enabled in plugin.xml
(ios) fix line breaks when replacing FirebaseAnalytics/IdentitySupport in plugin.xml
debug: add logging when variable values are being applied to plugin.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.