Guest User

Untitled

a guest
Apr 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. - (void)applicationDidFinishLaunching:(UIApplication *)app {
  2. // Configure the user interactions first.
  3. [self configureUserInteractions];
  4.  
  5. // Register for remote notifications.
  6. [[UIApplication sharedApplication] registerForRemoteNotifications];
  7. }
  8.  
  9. // Handle remote notification registration.
  10. - (void)application:(UIApplication *)app
  11. didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken {
  12. // Forward the token to your provider, using a custom method.
  13. [self enableRemoteNotificationFeatures];
  14. [self forwardTokenToServer:devTokenBytes];
  15. }
  16.  
  17. - (void)application:(UIApplication *)app
  18. didFailToRegisterForRemoteNotificationsWithError:(NSError *)err {
  19. // The token is not currently available.
  20. NSLog(@"Remote notification support is unavailable due to error: %@", err);
  21. [self disableRemoteNotificationFeatures];
  22. }
Add Comment
Please, Sign In to add comment