How to copy IOS Push service deviceToken into Appery Local Storage Variable
I want to use the apple IOS push service and am able to send push notifications with a php script if I know the deviceToken for the phone in question. Looking at the Appery generated code I see the didRegisterForRemoteNotificationsWithDeviceToken function and can print out the deviceToken value.
I would like to stuff that value into a Local Storage Variable for display (debug) in my app, and also to send it to the server my app connects to so it can then send push notifications via the Apple Notification Service.
Can someone give me a little java script to copy the deviceToken into a Local Storage Variable? Is there a built-in Appery way to do this?
thanks,
w
#pragma PushNotification delegation
- (void)application:(UIApplication)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData)deviceToken
{
NSLog(@"My token is: %@", deviceToken);
PushNotification* pushHandler = [self.viewController getCommandInstance:@"PushNotification"];
[pushHandler didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}