Last active
December 10, 2015 07:09
-
-
Save ChrisRisner/4399249 to your computer and use it in GitHub Desktop.
iOS Day 27
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 | |
{ | |
[application registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | | |
UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; | |
return YES; | |
} |
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
- (void)application:(UIApplication *)application | |
didReceiveRemoteNotification:(NSDictionary *)userInfo { | |
NSLog(@"Push received: %@", userInfo); | |
} |
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
- (void)application:(UIApplication *)application | |
didReceiveRemoteNotification:(NSDictionary *)userInfo { | |
NSLog(@"Push received: %@", userInfo); | |
ViewController *vc = (ViewController *)self.window.rootViewController; | |
vc.lblInfo.text = @"Push received"; | |
} |
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
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { | |
NSLog(@"APN device token: %@", deviceToken); | |
} |
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
2012-12-28 09:17:21.436 DayTwentySix[516:907] Push received: { | |
aps = { | |
alert = "Toast: Message"; | |
}; | |
} |
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
#import <UIKit/UIKit.h> | |
@interface ViewController : UIViewController | |
@property (weak, nonatomic) IBOutlet UILabel *lblInfo; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment