I am using Flutter flavors to manage same code base for multiple apps. So far flavor works pretty good. However, I am having difficulty in settting up OneSignal for each flavors for iOS. Lets say I have flavor1 and flavor2.
I have followed OneSignal's documentation https://documentation.onesignal.com/docs/flutter-sdk-setup . It does work for main flavor (i.e. flavor1) and doesn't for other flavor (flavor2).
What i tried.
For flavor1.
- I added new target with name "OneSignalNotificationServiceExtension".
- I specified bundle id for this target as "com.myapp.flavor1.OneSignalNotificationServiceExtension"
- I updated NotificationService.m file as per documentation.
- I updated podfile as well.
So far this works for flavor1.
But for flavor2.
- I added new target with name "OneSignalNotificationServiceExtension". It didn't let me add because target name was already taken.
- I added with name "FlavorTwoOneSignalNotificationServiceExtension".
- I specified bundle id for this target as "com.myapp.flavor2.FlavorTwoOneSignalNotificationServiceExtension"
- I updated NotificationService.m file as per documentation.
When i ran the app from Xcode. i get error "No such module 'OneSignalExtension'" under FlavorTwoOneSignalNotificationServiceExtension.
Can anybody point out what I am doing wrong here?
Thanks