how to get Device Token using Iphone Application and other info about the device?

浪尽此生 提交于 2019-12-09 07:02:59

问题


In my iphone application i want Device Token using the APN. How to get that using code ?

Alos i want Other information about the Device User,its version and other info. How to get that using Code ?

Is it possible to get the device other information using Device Token?

what is the format of the Device Token?

Please give solution by code or any link or any other way,which would be appreciated.

Thanks,

Mishal Shah


回答1:


here how you get information about device---

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];



回答2:


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeAlert ];
}

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


来源:https://stackoverflow.com/questions/1513037/how-to-get-device-token-using-iphone-application-and-other-info-about-the-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!