deviceToken of IOS Device
In your FinishedLaunching
method, register the app for remote notifications, through the UIApplication
object you get in it:
// Pass the UIRemoteNotificationType combinations you want
app.RegisterForRemoteNotificationTypes(UIRemoteNotificationType.Alert |
UIRemoteNotificationType.Sound);
Then, in your AppDelegate
class, override the RegisteredForRemoteNotifications
method:
public override void RegisteredForRemoteNotifications (UIApplication application, NSData deviceToken)
{
// The device token
byte[] token = deviceToken.ToArray();
}
You also have to override the FailedToRegisterForRemoteNotifications
method, to handle the error, if any:
public override void FailedToRegisterForRemoteNotifications (UIApplication application, NSError error)
{
// Do something with the error
}