How to get the device token using the Iphone app and other device information?

In my iphone application, I want to use the token using APN. How to get this with code?

Alos i want Other information about the user of the device, its version and other information. How to get this with code?

Can I get other device information using Device Token?

What is the format of the device token?

Please give a decision on the code or any link or in any other way that will be appreciated.

Thanks,

Mishal Shah

+3
source share
2 answers

here how you get device information ---

NSString*  deviceName= [[UIDevice currentDevice] uniqueIdentifier];
NSString*  localizedModel=[[UIDevice currentDevice] localizedModel];
NSString*  systemVersion=[[UIDevice currentDevice] systemVersion];
NSString*  systemName=[[UIDevice currentDevice] systemName];
NSString*  model=[[UIDevice currentDevice] model];
+7
source
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeAlert ];
}

// Delegation methods 
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    NSLog(@"didRegisterForRemoteNotificationsWithDeviceToken: %@", deviceToken);
} 
+14
source

Source: https://habr.com/ru/post/1719153/


All Articles