views:

1713

answers:

2

Hi,

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

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

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

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