36
Views
3
Comments
how to get iOS Device token(APNs Token)?
Question
Application Type
Mobile

Hi 

how to get iOS Device token(APNs Token)?

I need to store at my end.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi Swapnil,

Please check the following post: https://www.outsystems.com/forums/discussion/64755/unique-id-for-ios/

Regards,

Daniel

UserImage.jpg
Swapnil Shinde

HI Daniël Kuhlmann

This forum is not useful for me

Actually, I need this token for iOS push notification.

Kindly check below Native code for get token for push notification

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; 

And this is description of this method.

UIKit calls this method after it successfully registers your app with APNs. In your implementation of this method, send the contents of the deviceToken parameter to the server that you use to generate remote notifications. Never cache the device token locally on the user's device. Device tokens can change periodically, so caching the value risks sending an invalid token to your server. If the device token hasn't changed, registering with APNs and returning the token happens quickly.
Typically, this method is called only after you call the registerForRemoteNotifications method of UIApplication, but UIKit might call it in other rare circumstances. For example, UIKit calls the method when the user launches an app after having restored a device from data that is not the device’s backup data. In this exceptional case, the app won’t know the new device’s token until the user launches it.


2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi again,

I don't have an answer, on outsystems.com/forge multiple components, plugins are available to retrieve device information. I suggest you check them out and see if one of them is useful for you.

Regards,

Daniel 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.