I know this is very basic but I need to pull my device token and Store it in a String and put(display) it on a label on my ViewDidLoad method. What might be the posible solution? Im new on iOS development. Should I use Global variable? or any Posible Solution?
This is my code.
AppDelegate.m
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
NSString *str = [NSString stringWithFormat:@"Device Token=%@",deviceToken];
NSLog(@"%@", str);
//get the string and display it on the ViewDidLoad method.
}
Please help me. How to use global variable to access that string?
on my ViewController.m class
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *getToken = @"Token from AppDelegate";
}
Something like that.