2

I am developing a static library with some common classes which can be used in multiple applications.

This common code performs certain action on receiving Push Notification. Can I add push notification module (registering for push,receiving push and handling push) in library?

Will the application which uses this library receive push notification?

Nicolas Miari
  • 16,006
  • 8
  • 81
  • 189

1 Answers1

1

I think you can add the registration and handling part in your library, the registration method of library should be called in below mentioned method of AppDelegate

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

and the necessary push notification delegate methods should be implemented in your apps AppDelegate class. And from AppDelegate class you can redirect them(receiving push and handling push) to your library.

Will the application which uses this library receive push notification?

For this you have to enable the Push Notification to your app ID and generate the Development SSL Certificate/Production SSL Certificate accordingly. These SSL certificates should be generated separately for each app where you intend to use your library.

Smile
  • 667
  • 1
  • 5
  • 21
Avaan
  • 4,709
  • 1
  • 10
  • 13