代码之家  ›  专栏  ›  技术社区  ›  Arvind Tyagi

xamarin ios推送通知与firebase云消息

  •  0
  • Arvind Tyagi  · 技术社区  · 4 年前

    FirebasePushNotificationManager。Initialize(options,new Notificationhandler(),true);

            }
            catch (Exception ex)
            {
    
            }
            
          
            return base.FinishedLaunching(app, options);
        }
    
        public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
        {
           
           
        FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken);
    
        }
    
        public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)
        {
            FirebasePushNotificationManager.RemoteNotificationRegistrationFailed(error);
        }
        // To receive notifications in foregroung on iOS 9 and below.
        // To receive notifications in background in any iOS version
        public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler)
        {
            // If you are receiving a notification message while your app is in the background,
            // this callback will not be fired 'till the user taps on the notification launching the application.
    
            // If you disable method swizzling, you'll need to call this method. 
            // This lets FCM track message delivery and analytics, which is performed
            // automatically with method swizzling enabled.
            FirebasePushNotificationManager.DidReceiveMessage(userInfo);
            // Do your magic to handle the notification data
            System.Console.WriteLine(userInfo);
    
            completionHandler(UIBackgroundFetchResult.NewData);
        }
    

    FirebasePushNotificationManager。Initialize每次都会出错 身体能帮我吗?提前谢谢

    0 回复  |  直到 4 年前