iOS custom push notification via Notification Service Extension


I am stuck with custom push notification. What I am looking to acheive is to have image in notification. For that, the following things has been done:

  1. Created Notification Service Extension
  2. Enabled App groups and push notification in both- app and notification extension.
  3. Trying to build app, but unable to install on iPhone with the error:

having same bundle id in app and extension

Do I need to create separate bundle id and provisioning profiles for Notification Extension? If yes then how notification service class methods will be called?
Waiting for your early response. Thank You.

Expectation- Need to implement custom push notification

>Solution :

The Notification Service Extension is defined as a target in you project settings, hence it needs a unique identifier different than your app’s id. It’s recommended that you format the extension’s id like so: App_Bundle_Id.NotificationServiceExtension

Bundle Identifiers are unrelated to the method calls, iOS will handle them for you. Whenever a device receives a push notification, the extension is called (if configured properly) so you can execute your logic.

Leave a ReplyCancel reply