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」として返されます。
このデバイス トークンをグローバル変数に保存し、他のクラスまたは他のメソッドで使用するにはどうすればよいですか。