-(void) applicationdidfinishlaunching: (uiapplication *) Application {
[Window AddSubview:viewController.view];
[Window makekeyandvisible];
NSLog (@ "Registering for push notifications ...");
[[UIApplication Sharedapplication]
Registerforremotenotificationtypes:
(Uiremotenotificationtypealert |
Uiremotenotificationtypebadge |
Uiremotenotificationtypesound)];
}
-(void) Application: (UIApplication *) app Didregisterforremotenotificationswithdevicetoken: (nsdata*) DeviceToken {
NSString *STR = [NSString
stringwithformat:@ "Device token=%@", Devicetoken];
NSLog (str);
}
-(void) Application: (UIApplication *) app Didfailtoregisterforremotenotificationswitherror: (Nserror *) Err {
NSString *str = [NSString stringWithFormat: @ "Error:%@", err];
NSLog (str);
}
-(void) Application: (UIApplication *) application didreceiveremotenotification: (Nsdictionary *) UserInfo {
For (ID key in UserInfo) {
NSLog (@ "key:%@, Value:%@", Key, [UserInfo Objectforkey:key]);
}
}
-(void) Dealloc {
[Viewcontroller release];
[Window release];
[Super Dealloc];
}
iOS message push