Пример #1
0
 public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
 {
     FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken);
     CrossFirebasePushNotification.Current.OnTokenRefresh += (s, p) =>
     {
         System.Diagnostics.Debug.WriteLine($"TOKEN : {p.Token}");
     };
 }
Пример #2
0
 public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
 {
      #if DEBUG
     FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken, FirebaseTokenType.Sandbox);
     #endif
     #if RELEASE
     FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken, FirebaseTokenType.Production);
     #endif
 }
        public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
        {
#if DEBUG //Firebase.InstanceID.InstanceId.SharedInstance.SetApnsToken(deviceToken, Firebase.InstanceID.ApnsTokenType.Sandbox);
            FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken, FirebaseTokenType.Sandbox);
#endif
#if RELEASE
            //Firebase.InstanceID.InstanceId.SharedInstance.SetApnsToken(deviceToken, Firebase.InstanceID.ApnsTokenType.Prod);
            FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken, FirebaseTokenType.Production);
#endif
        }
        public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
        {
            //if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
            //{
            //    byte[] result = new byte[deviceToken.Length];
            //    Marshal.Copy(deviceToken.Bytes, result, 0, (int)deviceToken.Length);
            //    deviceToken = BitConverter.ToString(result).Replace("-", "");
            //    Debug.WriteLine($"Device Token iOS: " + deviceToken);
            //}

            FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken);
            UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
        }
Пример #5
0
 public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
 {
     FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken);
 }
Пример #6
0


        public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
        {
            #if DEBUG

                        FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken, FirebaseTokenType.Sandbox);
                        
                        


            #endif
            #if RELEASE
                        FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken,FirebaseTokenType.Production);
            #endif

        }

       
    }
}

 public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
 {
     System.Console.WriteLine("Registered for remote notifications!" + deviceToken);
     FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken);
 }
Пример #8
0
 /// <summary>
 /// Indicates that a call to <see cref="UIKit.UIApplication.RegisterForRemoteNotifications"/> succeeded.
 /// </summary>
 /// <param name="deviceToken">The device token.</param>
 public static void DidRegisterRemoteNotifications(NSData deviceToken) =>
 FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken);
Пример #9
0
 {
                Window.RootViewController = UIStoryboard.FromName("Main", null).InstantiateViewController("NoConexion");
            }
            UIApplication.SharedApplication.RegisterForRemoteNotifications();
            var settings = UIUserNotificationSettings.GetSettingsForTypes(
                UIUserNotificationType.Alert, new NSSet());
            UIApplication.SharedApplication.RegisterUserNotificationSettings(settings);
            FirebasePushNotificationManager.Initialize(launchOptions, true);
            UNUserNotificationCenter.Current.RequestAuthorization(UNAuthorizationOptions.Alert, (approved, err) => {
                // Handle approval
            });
            // Get current notification settings
            UNUserNotificationCenter.Current.GetNotificationSettings ((set) => {
                var alertsAllowed = (set.AlertSetting == UNNotificationSetting.Enabled);
            }); 
                // Enable or disable features based on authorization.
            UNUserNotificationCenter.Current.Delegate = new UNUserNotificationCenterDelegate();

            return true;
        }

        public override void OnResignActivation(UIApplication application)
        {
            // Invoked when the application is about to move from active to inactive state.
            // This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) 
            // or when the user quits the application and it begins the transition to the background state.
            // Games should use this method to pause the game.
        }


        public override void WillEnterForeground(UIApplication application)
        {
            // Called as part of the transiton from background to active state.
            // Here you can undo many of the changes made on entering the background.
        }


        public override void WillTerminate(UIApplication application)
        {
            // Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground.
        }

        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)
        {