Onesignal-ios-sdk: How to properly configure code signing for OneSignalNotificationServiceExtension target?

Created on 4 Dec 2017  路  10Comments  路  Source: OneSignal/OneSignal-iOS-SDK

Which provisioning profiles i should use for this target? Xcode always give errors when i'm trying to archive my project.

Most helpful comment

Below instructions assume that your app is building and you have successfully deployed TestFlight builds in the past (since that is where I started from). I had to use the below as "Automatically manage signing" resulted in a build fail in Xcode 10:

  1. Go to https://developer.apple.com/account/ios/profile
  2. Click "+' to create a new provisioning profile
  3. Choose the type of provisioning profile you want (I went with App Store since I use TestFlight builds to test)
  4. for App ID choose "XC YOUR_DOMAIN_APP_ID OneSignalNotificationServiceExtension" and make sure enable the App Groups capability
  5. after you have downloaded the provisioning profile, go into Xcode, turn off automatically signing on the OneSignalNotificationServiceExtension target in General tab and import the provisioning profile you just downloaded.
  6. Use Product > Archive as usual to create your ipa file for App Store upload as usual

All 10 comments

@AndrewAgapov I would suggest enabling the automatic provisioning for the OneSignal extension. For release, you can create a separate provisioning profile for the extension manually, just make sure that the Bundle ID is suffixed with your actual application's bundle ID.

For example, if your iOS bundle ID is com.test.app, your OneSignal extension Bundle ID should be com.test.app.OneSignalNotificationServiceExtension

Please let me know if you have any other problems and we'll be happy to help

Do you mean prefixed?

@Nightsd01
Hi, I have the following issue with signing
https://stackoverflow.com/questions/52646820/react-native-onesignal-no-profiles-for-com-myapp-ios-onesignalnotificationser

Could you please help me. Thanks in advance.

@valerybodak
Have the same issue

@Nightsd01 I would like to activate app group capability to display badge notification on iOS Ionic app.

Certainly I misunderstand the documentation, I'm also stuck when creating a provisionning profile for OneSignalNotificationServiceExtension project. This means to create a new App Id, with app group and notification capabilities ? So the use of notification capability involved creating new development and production ssl cert ?

Thanks in advance

Below instructions assume that your app is building and you have successfully deployed TestFlight builds in the past (since that is where I started from). I had to use the below as "Automatically manage signing" resulted in a build fail in Xcode 10:

  1. Go to https://developer.apple.com/account/ios/profile
  2. Click "+' to create a new provisioning profile
  3. Choose the type of provisioning profile you want (I went with App Store since I use TestFlight builds to test)
  4. for App ID choose "XC YOUR_DOMAIN_APP_ID OneSignalNotificationServiceExtension" and make sure enable the App Groups capability
  5. after you have downloaded the provisioning profile, go into Xcode, turn off automatically signing on the OneSignalNotificationServiceExtension target in General tab and import the provisioning profile you just downloaded.
  6. Use Product > Archive as usual to create your ipa file for App Store upload as usual

Hi bohan0, thanks this is helpful. Can you tell me if we also need to enable App Groups on the main provisioning profile? YOUR_DOMAIN_APP_ID? I am getting an error with App Groups only added to the extension's provisioning profile. Also I'm confused if we need push notifications enabled on both the extension and the main profile. Thanks in advance.

I have App Groups enabled on the main provision profile as well.

In XCode I did not have Push Notifications enabled under Capabilities for OneSignalNotificationServiceExtension

Hi bohan0, thanks that matches the answer I got from OneSignal support. App Groups on both the main target and the NSE (Notification Service Extension) target profiles. Push Notifications for the main target profile only.

All of this is required? I mean, create the app-groups capability, etc. The doc doesn't say if it's optional.

Was this page helpful?
0 / 5 - 0 ratings