I got the device token through didRegisterForRemoteNotificationsWithDeviceToken
method. I wanted to use the device token in another method. I tried it in this way,
In didRegisterForRemoteNotificationsWithDeviceToken
method:
str = [NSString stringWithFormat:@"%@",deviceToken];
// str is the NSString which is declared in the appDelegate.h file as global variable
In didReceiveRemoteNotification
method:
NSLog(@"Device Token : %@",str);
When i do like this the Device Token
is returning as "nosniff".
How can i store this device token in a global variable and use it in the other class or in other method.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…