I am creating an app with push notifications and facebook login. For push notifications, the alert comes when you open the app, "App" Would like send you notifications. I want to display it after facebook login.
Asked
Active
Viewed 1,574 times
1 Answers
2
You can register for push notifications from anywhere in project. In your case you have to register for push notifications after you successfully login user with Facebook. Give a call to registerToReceivePushNotification after login completes and handle delegates in AppDelegate.
Objective C:
#pragma mark - push notificaiton
-(void)registerToReceivePushNotification
{
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
Swift:
UIApplication.sharedApplication().registerForRemoteNotifications()

Pankaj Gaikar
- 2,357
- 1
- 23
- 29