Try these steps:
- While renaming your app bundle package name, it’s essential to follow the steps in the “Rename package name/build & publish your app” section of the documentation (video: https://www.youtube.com/watch?v=qZd98DEm9yI; Summary: You need to change the OneSignalNotificationServiceExtension Bundle Identifier to be {your app’s bundle ID}.OneSignalNotificationServiceExtension. If actual app’s Bundle ID is com.example.ios.app, the bundle ID com.example.ios.app. OneSignalNotificationServiceExtension would be correct. Once you change the Bundle ID, you can enable Automatic provisioning, and it should work).
- Open the Terminal app on macOS, enter security find-identity -vp codesigning and press Enter. Enter your password (you will not see any *** placeholders) and press Enter again. Your Apple Developer certificate must be in the results. If that’s not the case, please remove it and add your certificate to keychain again.
- Open the Terminal app on macOS, enter security unlock-keychain and press Enter. Enter your password (you will not see any *** placeholders) and press Enter again.
- Open the Terminal app on macOS, enter security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k YOUR_MAC_PASSWORD_HERE /Users/YOUR_MAC_USERNAME_HERE/Library/Keychains/login.keychain-db and press Enter.
- Generate new development & distribution certificates with Xcode automatically. In Xcode menu bar choose, “Xcode”, “Preferences…->Accounts->Your Apple ID->Choose your company team->”Manage Certificates”->”+”->”Apple Development”. Repeat the last step with “Apple Distribution”.
- Set the signing target for both WebViewGold and OneSignalNotificationServiceExtension to “iPhone Developer (Automatic)”.
- Restart your Mac and try again.