Thursday, 1 November 2018

didReceiveRemoteNotification not called when Firebase is used along with Push framework

I am using Firebase for analytics and a library for push notifications. When I use either of them, didReceiveRemoteNotification get called. But when I use them both together, didReceiveRemoteNotification doesn't get called.
Code :

didFinishLaunchingWithOptions :

NSString *google_app_id = @"----";
    NSString *gcm_sender_id = @"----";
    FIROptions *o = [[FIROptions alloc] initWithGoogleAppID:google_app_id GCMSenderID:gcm_sender_id];
    o.APIKey = @"----";
    o.bundleID = @"----";
    o.clientID = @"----";
    [FIRApp configureWithOptions:o];  

// Initilization of push framework 

didReceiveRemoteNotification :

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
    // This method is not called when Firebase and push framework are enabled at the same time
    // It works fine when only Firebase or only push framework is enabled
    NSLog(@"Push: %@", userInfo);
}



from didReceiveRemoteNotification not called when Firebase is used along with Push framework

No comments:

Post a Comment