Description:
I get this issue https://github.com/OneSignal/OneSignal-iOS-SDK/issues/324
The reason to it is that I have multiple targets - and I can only have one specific bundle id in the OneSignalNotificationServiceExtension.
How to handle the case with multiple targets with different bundle identifiers?
I have ten targets as of now but there will be more.
Environment
@mortenholmgaard I鈥檝e never tried this but it鈥檚 a common scenario to have multiple targets for things like dev vs. production and so on, so I would suggest using the same extension service target for your different app targets. Try adding the extension service to the Embedded Binaries of your different app targets.

Let me know if that works for you.
Sorry but that explanation does not really make any sense to me - how will that solve the problem?
Yes it will need to be added to all the different targets - thanks for pointing that out, I have missed that. But as I see it, it will not solve the problem with bundle identifier prefix, as all the different targets have different ids.
To me it more seems like I have to make a OneSignalNotificationServiceExtension for each target with a bundle identifier prefix that matches that specific target. It guess that should be possible just by duplicating the OneSignalNotificationServiceExtension target.
@mortenholmgaard as far as OneSignal is concerned, the bundle ID of your extensions doesn鈥檛 matter except in one case with badge logic.
You can work around that by creating a custom app group name and then adding it in your Info.plist as OneSignal_app_groups_key = (app group name)
Okay.
To make the app build it is required that the ServiceExtension is prefixed with the bundle identifier and is signed with the samme certificate. So I have ended up with a ServiceExtension target pr. app target.
@mortenholmgaard @Nightsd01 did you get any proper solution for that? I am having the same issue with multiple targets.. any help will be really appreciated! thanks
I had have to have a target pr. app target, as there is no way to sign each of them with a different provisioning profile. So I am not sure there exists other solutions really.
so you have now a separate extension per target? is it what you mean?
and what about sfratini's comment on #324
In case you or anyone else in the future is having issues with that, I ended up defining a user variable in both targets that change based on the configuration (debug, release, staging, etc) and I use that to generate the bundle identifier like:
com.app.${BUNDLE_SUFFIX}
com.app.${BUNDLE_SUFFIX}.OneSignalNotificationServiceExtension
Bundle_Suffix changes depending on each configuration and schemes.
Yes a separate extension per target.
How do you solve signing with that solution?
@mortenholmgaard do I need to have a separate info plist per extension?
I think so yes.
@mortenholmgaard Did you find any solution for separating extension per target?
I can fix the problem like your solution. But I'm using appcenter for building. But appcenter doesn't support multiple provisioning for per targets.
Is this comment worked?
https://github.com/OneSignal/OneSignal-iOS-SDK/issues/324#issuecomment-355641642
@y7usuf I have it working with the comment you mentioned. Appcenter should not have anything to do with the extension target - just only deploy the main target to Appcenter as the extension is embedded in the main target.