我通过didRegisterForRemoteNotificationsWithDeviceToken方法获得了设备令牌。我想以另一种方法使用设备令牌。我是这样试的
在didRegisterForRemoteNotificationsWithDeviceToken方法:
str = [NSString stringWithFormat:@"%@",deviceToken];
// str is the NSString which is declared in the appDelegate.h file as global variable
在didReceiveRemoteNotification方法:
NSLog(@"Device Token : %@",str);
当我这样做时,它Device Token会以“nosniff”的形式返回。
如何将此设备令牌存储在全局变量中并在其他类或其他方法中使用它。