1

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.

mhatch
  • 4,441
  • 6
  • 36
  • 62
VJVJ
  • 435
  • 3
  • 21

1 Answers1

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