Skip to content

Instantly share code, notes, and snippets.

@graco911
Created January 24, 2018 21:28
Show Gist options
  • Save graco911/cac6a3c3fbd00bb1deaaf209a0cb453c to your computer and use it in GitHub Desktop.
Save graco911/cac6a3c3fbd00bb1deaaf209a0cb453c to your computer and use it in GitHub Desktop.
Firebase RegisteredForRemoteNotifications iOS
public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
{
// Get current device token
var DeviceToken = deviceToken.Description;
if (!string.IsNullOrWhiteSpace(DeviceToken))
{
DeviceToken = DeviceToken.Trim('<').Trim('>');
CrossFirebasePushNotification.Current.Subscribe("Ecopulse_news");
CrossFirebasePushNotification.Current.Subscribe("Ecopulse_ios");
}
#if DEBUG
FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken, FirebaseTokenType.Sandbox);
System.Console.WriteLine("DeviceToken : " + DeviceToken);
TokenUpdate(DeviceToken);
#endif
#if RELEASE
FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken,FirebaseTokenType.Production);
System.Console.WriteLine("DeviceToken : " + DeviceToken);
TokenUpdate(DeviceToken);
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment