3

I am trying to generate framework for iOS. In that need to handle the push notifications in static library project.

Is it possible to handle push notifications in static library project ? If it is possible ,How ?

Thanks.

Mayur Prajapati
  • 5,454
  • 7
  • 41
  • 70
  • I don't believe it can be done without the cooperation of the AppDelegate since all the incoming notifications are sent to the delegate. – David Berry Mar 18 '15 at 05:59

1 Answers1

0

As David Berry commented, you really need to receive all Push Notifications delegate methods in AppDelegate.

What you can do in your static lib is to provide an API to be called by the app in its AppDelegate. An app that uses your lib must therefore call these methods in order to take advantage from it.

Example (in AppDelegate):

- (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
    [[PNLib sharedSingleton] appDidReceiveRemoteNotification:userInfo];
}
Andre M F
  • 53
  • 5