Created
January 3, 2012 11:55
-
-
Save jinto/1554641 to your computer and use it in GitHub Desktop.
자자자... 노티 노티
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
NSLog(@"start ---- jinto"); | |
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
// Override point for customization after application launch. | |
self.viewController = [[_7P3USZ44YViewController alloc] initWithNibName:@"_7P3USZ44YViewController" bundle:nil]; | |
self.window.rootViewController = self.viewController; | |
[self.window makeKeyAndVisible]; | |
NSLog(@"call register"); | |
[[UIApplication sharedApplication] | |
registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | | |
UIRemoteNotificationTypeSound | | |
UIRemoteNotificationTypeAlert)]; | |
NSLog(@"call register end"); | |
return YES; | |
} | |
- (void)application:(UIApplication *)application | |
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken | |
{ | |
NSLog(@"jinto -- token"); | |
NSMutableString *deviceId = [NSMutableString string]; | |
const unsigned char* ptr = (const unsigned char*) [deviceToken bytes]; | |
for(int i = 0 ; i < 32 ; i++) | |
{ | |
[deviceId appendFormat:@"%02x", ptr[i]]; | |
} | |
NSLog(@"APNS Device Token: %@", deviceId); | |
} | |
- (void)application:(UIApplication *)application | |
didReceiveRemoteNotification:(NSDictionary *)userInfo | |
{ | |
NSString *string = [NSString stringWithFormat:@"%@", userInfo]; | |
//NSString *text = [dict objectForKey:@"text"]; | |
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil | |
message:string delegate:nil | |
cancelButtonTitle:@"OK" | |
otherButtonTitles:nil]; | |
[alert show]; | |
// [alert release]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment