在后台和Appdelegate中未接收Firebase推送通知

时间:2020-07-24 08:29:07

标签: ios react-native firebase-cloud-messaging react-native-firebase

react-native-firebase v5.2.3

我的Appdelegate包含方法didReceiveRemoteNotification

我收到日志,前一天一切正常。

今天再次将我的p8证书上传到我的Firebase IOS应用中。仅显示前台应用。但是我没有从Appdelegate文件中获取日志。

之前,我还在firebase.notifications()。onNotification((notification)=> {})中接收前台通知

但是现在我正在firebase.messaging()。onMessage((message)=> {})方法中对其进行匹配。

总体上没有后台通知。

我的APPdelegate:

 - (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
    fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{ NSLog(@"Here"); if([[userInfo objectForKey:@"UID"] isEqual: @"VideoMeeting"]){
    
    NSLog(@" contains type Here");

     if( [UIApplication sharedApplication].applicationState == UIApplicationStateInactive || [UIApplication sharedApplication].applicationState == UIApplicationStateBackground )
    {
      NSLog(@"Here 22");
      [self localNotificationRingerViewAdd:userInfo];
    }else{
      
      NSLog(@"Normal Noti 22");
      [[RNFirebaseNotifications instance] didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
    }
  }else{
    
        NSLog(@"Normal Noti 42");
       [[RNFirebaseNotifications instance] didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
  }
  
}

0 个答案:

没有答案