OneSignal / onesignal-expo-plugin

The OneSignal Expo plugin allows you to use OneSignal without leaving the managed workflow. Developed in collaboration with SweetGreen.
Other
157 stars 51 forks source link

OneSignalNotificationServiceExtension provisioning profile? #40

Closed raunaqsingh2020 closed 2 years ago

raunaqsingh2020 commented 2 years ago

Hi, I am getting the following Fastlane error when I try to build for iOS (eas build --profile development --platform ios):

❌ error: No profiles for 'bundle id.OneSignalNotificationServiceExtension' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'bundle id.OneSignalNotificationServiceExtension'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'OneSignalNotificationServiceExtension' from project '***')

Do I have to manually create an additional identifier (.OneSignalNotificationServiceExtension) and then a provisioning profile for this?

The plugin works perfectly when I comment all the OneSignal related code out before the build, and then uncomment it all after running expo start --dev-client.

Thanks so much!

rgomezp commented 2 years ago

Howdy, To answer your question, you shouldn't need to create an additional identifier for the NSE. This is done for you automatically. The provisioning profile should be an XCode Managed Profile if automatic signing is on (which it should be). Try visually inspecting the Signing and Capabilities configuration in the Xcode workspace. You should have:

It sounds like something in your environment is preventing automatic signing as I'm not seeing that error on my end.

raunaqsingh2020 commented 2 years ago

Hmm, how can I check the Xcode workspace for a managed workflow?

I don't see the <your bundle id>.OneSignalNotificationServiceExtension identifier on the Apple Developer Console.

rgomezp commented 2 years ago

Screen Shot 2021-12-30 at 3 23 04 PM

raunaqsingh2020 commented 2 years ago

When I try building the native project (expo run:ios), I get the following:

Failed to build iOS project. "xcodebuild" exited with error code 65.
To view more error logs, try building the app with Xcode directly, by opening /Users/raunaqsingh/Developer/canada-goose/ios/DP.xcodeproj.

Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project /Users/raunaqsingh/Developer/canada-goose/ios/DP.xcodeproj -configuration Debug -scheme DP -destination id=079A8E83-0A88-4223-8185-61FA54F6734A

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

note: Using new build system
note: Planning
Analyze workspace

Create build description
Build description signature: 5c9947c631b8dc214ce840dc1724b44c
Build description path: /Users/raunaqsingh/Library/Developer/Xcode/DerivedData/DP-chreouiuptppyzbmrutwxoddflad/Build/Intermediates.noindex/XCBuildData/5c9947c631b8dc214ce840dc1724b44c-desc.xcbuild

note: Build preparation complete
note: Building targets in dependency order
/Users/raunaqsingh/Developer/canada-goose/ios/Pods/Target Support Files/Pods-DP/Pods-DP.debug.xcconfig:1:1: error: unable to open file (in target "DP" in project "DP")
/Users/raunaqsingh/Developer/canada-goose/ios/Pods/Target Support Files/Pods-DP/Pods-DP.debug.xcconfig:1:1: error: unable to open file (in target "DP" in project "DP")
/Users/raunaqsingh/Developer/canada-goose/ios/Pods/Target Support Files/Pods-DP/Pods-DP.debug.xcconfig:1:1: error: unable to open file (in target "DP" in project "DP")
/Users/raunaqsingh/Developer/canada-goose/ios/Pods/Target Support Files/Pods-DP/Pods-DP.debug.xcconfig:1:1: error: unable to open file (in target "DP" in project "DP")

objc[6180]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x20b75fb78) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10cfb02c8). One of the two will be used. Which one is undefined.
objc[6180]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x20b75fbc8) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10cfb0318). One of the two will be used. Which one is undefined.
2021-12-30 16:43:05.279 xcodebuild[6180:3594115] warning:  The file reference for "OneSignalNotificationServiceExtension" is a member of multiple groups ("Pods" and ""); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
** BUILD FAILED **

It does create an .xcodeproj and the <your bundle id>.OneSignalNotificationServiceExtension is there, but it does not create a .xcworkspace

Could the The file reference for "OneSignalNotificationServiceExtension" is a member of multiple groups ("Pods" and ""); this indicates a malformed project. warning be the problem? If you want to take a look at the project, it's here: https://github.com/dailypenn/canada-goose.

Thanks so much!

jparksecurity commented 2 years ago

@rgomezp we're having the same issue although I can see the right bundle identifier on Xcode UI.

We pass ios credential files when we run EAS build. Do you think if it is something to do with this?

Does anyone know if setting credentialsSource to local in eas.json turns off automatic signing?

If credentialsSource is not the issue, I think the problem is The file reference for "OneSignalNotificationServiceExtension" is a member of multiple groups ("Pods" and ""); this indicates a malformed project.

because it's the first error I see on the console log after EAS build runs xcodebuild -resolvePackageDependencies -workspace ./XXXX.xcworkspace -scheme XXXX -configuration Release

raunaqsingh2020 commented 2 years ago

I didn't set credentialsSource and still have the issue.

jparksecurity commented 2 years ago

@ raunaqsingh2020 Thanks for sharing your config. Then I guess credentialsSource is less likely the problem.

FYI I think expo prebuild --platform ios --clean generates .xcworkspace file.

You can follow rgomezp's instruction to check the bundle identifier by opening Xcode with the file.

raunaqsingh2020 commented 2 years ago

is there any update as to whether this is an issue with the plugin or our setups? thanks again!

russriser commented 2 years ago

I don't have Xcode (I work on PC), I rely on EAS Build to build my ios apps.

So, I have no idea how to verify if automatic signing is the issue. And if it were, I don't know how to fix it.

lisaah commented 2 years ago

Just adding another point of anecdata, also seeing this error. It seems like automatic signing is disabled when running our eas managed build based on the error message (no issues for android build). However, when I run expo prebuild --platform ios --clean, the workspace shows says automatically manage signing is enabled. Onesignal bundle identifier is not there.

image

r1cs1 commented 2 years ago

I was running into the same issue. To resolve this issue first I had to create another bundle identifier and provisioning profile as stated here. I've missed this first.

Then I also had to setup credential source to local with multi target credentials.json as it is here because EAS didn't pull the extensions provisioning profile even if that was submitted from the credentials.json to EXPO (That wasn't straightforward either). Or if I don't want to use local credentials then I had to run expo prebuild --platform ios --clean

{
  "android": {
    ...
  },
  "ios": {
    "<<APPNAME>>": {
      "distributionCertificate": {
        "path": "***",
        "password": "***"
      },
      "provisioningProfilePath": "***"
    },
    "OneSignalNotificationServiceExtension": {
      "distributionCertificate": {
        "path": "***",
        "password": "***"
      },
      "provisioningProfilePath": "***"
    }
  }
}

Now it gave me a new error commented here

To resolve this I had to patch the onesignal-expo-plugin to use the same iOS target as the expo sdk. (12.0 for my case).

If anyone knows what I've missed in order to skip these patches to get it to work I'd appreciate it :)

seyaobey-dev commented 2 years ago

Hi. I'm facing same issue, same error. But I rely completely on (remote) eas build to build my ios app. I do not have Xcode locally to try to visually inspect the Signing and Capabilities configuration in the Xcode workspace. I cannot run expo prebuild --platform ios --clean

raunaqsingh2020 commented 2 years ago

@r1cs1

Hey I tried to follow your comment. Here's what I have right now:

Identifiers:

Profiles:

My credentials.json is similar to what you did but I am now receiving the following errors:

❌  error: Provisioning profile "com.thedailypennsylvanian.OneSignal.profile" doesn't support the group.com.thedailypennsylvanian.mobileapp.onesignal App Group. (in target 'OneSignalNotificationServiceExtension' from project 'DP')
❌  error: Provisioning profile "com.thedailypennsylvanian.OneSignal.profile" doesn't match the entitlements file's value for the com.apple.security.application-groups entitlement. (in target 'OneSignalNotificationServiceExtension' from project 'DP')

Did you get any these errors as well? and if so, how did you resolve them?

thanks!

r1cs1 commented 2 years ago

The bundle identifier for onesignal must have the same app group entitlement setting as your mobile app.

Get Outlook for iOShttps://aka.ms/o0ukef


From: Raunaq Singh @.> Sent: Sunday, January 9, 2022 3:07:21 AM To: OneSignal/onesignal-expo-plugin @.> Cc: Richárd Pétercsák @.>; Mention @.> Subject: Re: [OneSignal/onesignal-expo-plugin] OneSignalNotificationServiceExtension provisioning profile? (Issue #40)

@r1cs1https://github.com/r1cs1

Hey I tried to follow your comment. Here's what I have right now:

Identifiers:

Profiles:

My credentials.json is similar to what you did but I am now receiving the following errors:

❌ error: Provisioning profile "com.thedailypennsylvanian.OneSignal.profile" doesn't support the group.com.thedailypennsylvanian.mobileapp.onesignal App Group. (in target 'OneSignalNotificationServiceExtension' from project 'DP')

❌ error: Provisioning profile "com.thedailypennsylvanian.OneSignal.profile" doesn't match the entitlements file's value for the com.apple.security.application-groups entitlement. (in target 'OneSignalNotificationServiceExtension' from project 'DP')

Did you get any these errors as well? and if so, how did you resolve them?

thanks!

— Reply to this email directly, view it on GitHubhttps://github.com/OneSignal/onesignal-expo-plugin/issues/40#issuecomment-1008212822, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADLBRNUHQ6NNPNNADETIKOTUVDUVTANCNFSM5K6JNCDQ. You are receiving this because you were mentioned.Message ID: @.***>

IMPORTANT NOTICE: This e-mail message is intended to be received only by persons entitled to receive the confidential information it may contain. E-mail messages to clients of Fribbit may contain information that is confidential and legally privileged. Please do not read, copy, forward, or store this message unless you are an intended recipient of it. If you have received this message in error, please forward it to the sender and delete it completely from your computer system.

rgomezp commented 2 years ago

Howdy y'all, Thanks for the details.

@r1cs1 Regarding the error with related to Pods, the latest release (beta 9) now includes the ability to configure which deployment target the NSE should use. This needs to match the version in the generated Podfile.

iOS 10 was dropped in Expo 41 and iOS 11 was dropped in Expo 43.

Thus, a custom patch is no longer needed.

See the README for the new deployment target config param customization instructions.

@raunaqsingh2020 , As r1cs1 mentioned, the bundle id for OneSignal must have the same app group entitlement setting as the mobile app. It appears as if your entitlements got mixed up somehow.


For context, the app group is added for you automatically by the plugin based on the bundleIdentifier config param in your app config file as follows group.<your bundle id>.onesignal and should be the same across both targets.

javascripter commented 2 years ago

I still see the eas build error below with beta 9, with my app configured with automatically managed credentials.

❌  error: No profiles for 'com.xxx.OneSignalNotificationServiceExtension' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.xxx.OneSignalNotificationServiceExtension'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'OneSignalNotificationServiceExtension' from project 'XXXX')

eas.json

    "beta": {
      "developmentClient": true,
      "credentialsSource": "remote",
      "distribution": "internal",
      "env": {
        "APP_ENV": "beta"
      }
    },

app.config.js

plugins:[
      'onesignal-expo-plugin',
      {
        mode: process.env.NODE_ENV || 'development',
        devTeam: 'XXXXX',
        iPhoneDeploymentTarget: '12.0', // Keep in sync with the value in ios/Podfile
      },
    ]
frossetto commented 2 years ago

ignalNotificationServiceExtension' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.xxx.OneSignalNotificationServiceExtension'. Automatic signing is disab

I also see the same error with beta 9, any luck so far with this issue?

rgomezp commented 2 years ago

Howdy folks, I'm sorry to hear you're still having issues.

Perhaps this article will help. Please let me know and I will do my best to try to get to the bottom of this.

dynamiccarrots commented 2 years ago

I am also having this issue, I have let EAS do everything for me including creating the profiles and certificates yet this error is still happening.

We really want to use One Signal for our new app.

frossetto commented 2 years ago

Howdy folks, I'm sorry to hear you're still having issues.

Perhaps this article will help. Please let me know and I will do my best to try to get to the bottom of this.

Just following up @rgomezp, I think the issue is actually with EAS rather than this repo. Even after following up the provisioning profile setup, EAS fails to build the app. But building it with expo build, the build proceeds and I'm able to run it in dev mode.The production build will not properly run, being stuck on the splash screen.

rgomezp commented 2 years ago

@frossetto , Thanks for that info.

I found the following resources on Expo's site:

If the issue is with EAS as you mention, I'd recommend you go through each of those thoroughly to make sure you have covered all the requirements.


Did you succeed?

@raunaqsingh2020 @r1cs1 @seyaobey-dev @lisaah @jparksecurity @javascripter @russriser

I'd like to gauge the level of success from everyone else while building with EAS. Has anyone here been able to successfully set up EAS on their app with the OneSignal Expo Plugin integrated?

jparksecurity commented 2 years ago

@rgomezp

I have successfully set up EAS on my app with the OneSignal Expo Plugin integrated.

FYI, I use local credential , and I have no idea if it would make any difference on this particular issue.

However, I can not use this plugin on production now because of a few problems:

  1. Onesignal extension version/build number match (iOS only) #53
  2. Deeplink opens in-app browser #47
  3. Push notification (iOS only) #56
  4. keychain (iOS only) #57
javascripter commented 2 years ago

So far I haven't been able to build successfully on EAS with EAS managed credentials and I still use 1.0.0-beta7 in my app which does not require ONSE.

In my observation running eas prebuild locally generates an iOS project with automatic signing on, but somehow still shows Automatic signing is disabled error on EAS. I'm not sure why.

frossetto commented 2 years ago

@rgomezp Sorry for the late reply, I followed the steps for all the links and I can relate to the same issue that @javascripter has;

GautierT commented 2 years ago

Hi Same problem :

❌  error: No profiles for 'io.PROJECT.OneSignalNotificationServiceExtension' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'io.PROJECT.OneSignalNotificationServiceExtension'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'OneSignalNotificationServiceExtension' from project 'PROJECT')
raunaqsingh2020 commented 2 years ago

I'd like to gauge the level of success from everyone else while building with EAS. Has anyone here been able to successfully set up EAS on their app with the OneSignal Expo Plugin integrated?

Sorry for the late reply. I was able to successfully set it up! Here's what my final setup process looked like:

I had to create and use local credentials (different ones for production and development). So, make sure to have "credentialsSource": "local" in your eas.json file.

On the Apple developer console (developer.apple.com), I created two identifiers: com.PROJECT.mobileapp and com.PROJECT.mobileapp.OneSignalNotificationServiceExtension.

Next, create provisioning profiles on the Apple developer console as well. I created both Ad hoc and App Store provisioning profiles (for local development and production builds respectively) with both identifiers (4 provisioning profiles in total). Then, download the provisioning files (.mobileprovision) and place them somewhere in your directory.

My credentials.json file looked like this:

{
    "ios": {
        "<PROJECT>": {
            "distributionCertificate": {
                "path": "ios/certs/ios_distribution_certificate.p12",
                "password": "***"
            },
            "provisioningProfilePath": "ios/certs/prod/***mobileappprofile.mobileprovision"
        },
        "OneSignalNotificationServiceExtension": {
            "distributionCertificate": {
                "path": "ios/certs/ios_distribution_certificate.p12",
                "password": "***"
            },
            "provisioningProfilePath": "ios/certs/prod/***onesignalprofile.mobileprovision"
        }
    }
}

Hopefully that helps!

lisaah commented 2 years ago

I haven't revisited this for iOS yet; we went with using expo-notifications with native tokens for now.

russriser commented 2 years ago

I was able to successfully build with EAS managed workflow by using local credentials as @r1cs1 and @raunaqsingh2020 described.

I have a couple notes for creating a new identifier and provisioning profiles in the apple dev portal....

one last note: make sure to build with BOTH identifiers containing the AppGroup simultaneously. I tried to build with just the OneSignalNotificationServiceExtension having the AppGroup, then added the capability to the main app identifier when it didn't work.....but doing them one by one screwed something up. I then had to remove both, rebuild to get the original error, then build it again with both identifiers enabling the AppGroup capability.

rgomezp commented 2 years ago

Thank you everyone for helping out. I will put together a guide to make this process easier!

rgomezp commented 2 years ago

Update: I went ahead and put together a guide that can be found in the discussion forums.

If you would like to make suggestions on the doc before it is finalized, please leave a comment in the above-linked discussion thread.

Thanks for everyone who helped.

Also included below.


Provisioning Setup for iOS

1. Credentials Setup

To build successfully, you will need to create and use local credentials (one for production and development). Add "credentialsSource": "local" to your eas.json file.

2. Identifiers

In your Apple developer console create two identifiers with the following format:

When modifying your existing main app identifier:

When creating a new identifier for OneSignalNotificationServiceExtension:

Note on App Groups:

Make sure to build with both identifiers containing the AppGroup simultaneously. To troubleshoot, remove them both and then rebuild with both identifiers' AppGroup capabilities enabled.

3. Provisioning

Create Ad hoc (local development) and App Store (production) provisioning profiles with both identifiers (4 provisioning profiles total). Both provisioning profiles should use the same distribution certificate that is used by your app. Download the profiles.

4. Add the profiles to your credentials.json file:

Use the same distribution certificate for the OneSignalNotificationServiceExtension as is used for your app (no need to create a new cert).

{
    "ios": {
        "<PROJECT>": {
            "distributionCertificate": {
                "path": "ios/certs/ios_distribution_certificate.p12",
                "password": "***"
            },
            "provisioningProfilePath": "ios/certs/prod/***mobileappprofile.mobileprovision"
        },
        "OneSignalNotificationServiceExtension": {
            "distributionCertificate": {
                "path": "ios/certs/ios_distribution_certificate.p12",
                "password": "***"
            },
            "provisioningProfilePath": "ios/certs/prod/***onesignalprofile.mobileprovision"
        }
    }
}

Edit: 10/30/23 - everything you should need should be in the repo's README. these credentialing issues should be resolved

tsheaff commented 1 year ago

So if I'm hearing this right, the "solution" here is that if we want to use OneSignal with Expo, we lose the (huge) benefit of having Expo manage our provisioning credentials for us? That's quite frustrating, and it seems like something that really shouldn't be necessary here. Why is the separate OneSignalNotificationServiceExtension even necessary in the first place?

tsheaff commented 1 year ago

Also @rgomezp the link to that discussion forum is giving me a 404: https://github.com/OneSignal/onesignal-expo-plugin/discussions/63

russriser commented 1 year ago

@tsheaff at the time this PR was closed Expo had no way of managing credentials for projects with multiple targets (your app and the OS service extension are each a target). This capability might exist now, but I'm not sure. At the time, Expo had JUST made an update to their EAS build process which enabled multi-taget builds under the managed workflow...prior to that you would have had to eject from Expo completely.

The NotificationServiceExtension is a fairly recent requirement by Apple. One cannot utilize push notifications without an extension. And this extension becomes a new "target" in XCode builds. Since Expo runs the XCode builds for you, any XCode settings you want to use need to be implemented in EAS. Implementing every XCode setting is impractical, so they prioritize the most used settings.

So again, they might have implemented multi-target credentials management by now (I don't know), but we should be glad they've implemented multi-target builds at all

I still use this plugin with the credentials.json and it works fine. Haven't had to touch my credentials file since I first got it set up.

tsheaff commented 1 year ago

Thanks @russriser great answer!

As for the credentials.json itself, it requires a password and a .p12 rather than just the .cer. When I download the cert from the Apple Developer Center, I'm only getting the .cer. Does this mean I need to first create a new certificate for App Store? And if so, do I need two, one for the OneSignalNotificationServiceExtension and one for the non-OneSignalNotificationServiceExtension App Id? Specifically referring to these screens:

Screenshot 2023-08-07 at 17 28 47

Screenshot 2023-08-07 at 17 29 34

Thanks for the help! This has been managed by EAS previously, and the guide here is a bit incomplete w/r/t certificates (it's very thorough regarding the App IDs / App Groups piece)

tsheaff commented 1 year ago

Oh I think I misread that UI. I thought I was adding APNS to the cert, but it's an either/or, I think "iOS Distrbution" is the one I want. Trying that now.

russriser commented 1 year ago

@tsheaff You should be able to use a single distribution certificate for everything. But things may have changed a bit in the year+ since I set this up. I don't remember creating an Apple Push Notification Service SSL. That might be new, or you might not need to do that.

rignaneseleo commented 1 year ago

I had this error during my build with Codemagic.io

I created a ipa file from xcode (flutter build ipa) and pushed that to testflight: that created a provisioning profile for me and now it compiles fine.

chiragsahu commented 4 months ago

I was facing an error related to provisioning profiles while working on my project. Here’s what worked for me:

I realized that I was selecting the provisioning profile linked to my Apple ID Team instead of using the one associated with my project's team. Switching to the correct provisioning profile resolved the issue.

Solution Make sure to select the appropriate provisioning profile from your project's team rather than the one tied to your Apple ID.

nixolas1 commented 3 months ago

@rgomezp We have custom targets in our app that automatically get credentials generated for them in EAS builds, using the Expo Apple Targets plugin: https://github.com/EvanBacon/expo-apple-targets/tree/main/apps

Could that be a good way to do credential handling?

The current state of the implementation with Expo is not exactly plug & play 💔

Some debug info, if it helps:

Here is the build log of our expo build now, you can see liveActivities being signed:


 ✔ Using remote iOS credentials (Expo server)

We found that the scheme you want to build consists of many targets.
You have to set up credentials for each of the targets.
They can share the same Distribution Certificate but require separate Provisioning Profiles.

Setting up credentials for following targets:
- Target: App
  Bundle Identifier: com.my.app
- Target: liveActivities
  Bundle Identifier: com.my.app.liveActivities

Setting up credentials for target App (com.my.app)

If you provide your Apple account credentials we will be able to generate all necessary build credentials and fully validate them.
This is optional, but without Apple account access you will need to provide all the missing values manually and we can only run minimal validation on them.
✔ Do you want to log in to your Apple account? … yes

✔ Bundle identifier registered com.my.app
✔ Synced capabilities: Enabled: Sign In with Apple, App Groups
✔ Synced capability identifiers: Linked: group.com.my.app.onesignal
✔ Fetched Apple distribution certificates
✔ Fetched Apple provisioning profiles
Provisioning profile (id: XXXXX) is no longer valid
✔ Fetched Apple provisioning profiles
✔ Provisioning Profile - ID: XXXXX
Name: *[expo] com.my.app AppStore 2024-08-15T10:05:45.097Z
Expiry: Fri Sep 06 2024
Would you like to reuse the original profile? … no
✔ Generate a new Apple Provisioning Profile? … yes
✔ Created Apple provisioning profile
✔ Created provisioning profile

Setting up credentials for target liveActivities (com.my.app.liveActivities)

✔ Bundle identifier registered com.my.app.liveActivities
✔ Synced capabilities: No updates
✔ Synced capability identifiers: No updates
✔ Fetched Apple distribution certificates
✔ Fetched Apple provisioning profiles

Project Credentials Configuration

Project                   @app-mobility/app

Target                    App
Bundle Identifier         com.my.app

App Store Configuration

Distribution Certificate
Serial Number             XXXXXXXXX
Expiration Date           Fri, 06 Sep 2024 13:06:06 GMT+0200
Apple Team                XXX (App Mobility AS (Company/Organization))
Updated                   11 months ago

Provisioning Profile
Developer Portal ID       XXXX
Status                    active
Expiration                Fri, 06 Sep 2024 13:06:06 GMT+0200
Apple Team                XXX (App Mobility AS (Company/Organization))
Updated                   4 seconds ago

Target                    liveActivities
Bundle Identifier         com.my.app.liveActivities

App Store Configuration

Distribution Certificate
Serial Number             YYYYYYYYY
Expiration Date           Fri, 06 Sep 2024 13:06:06 GMT+0200
Apple Team                XXX (App Mobility AS (Company/Organization))
Updated                   11 months ago

Provisioning Profile
Developer Portal ID       ZZZZZZZZZ
Status                    active
Expiration                Fri, 06 Sep 2024 13:06:06 GMT+0200
Apple Team                XXX (App Mobility AS (Company/Organization))
Updated                   8 months ago

All credentials are ready to build @app-mobility/app (com.my.app, com.my.app.liveActivities)

And the build error itself:

/Users/expo/workingdir/build/ios/Elton.xcodeproj: error: No profiles for 'com.my.app.OneSignalNotificationServiceExtension' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.my.app.OneSignalNotificationServiceExtension'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'OneSignalNotificationServiceExtension' from project 'App')

It seems a provisioning profile that is seemingly correct exists:

Screenshot 2024-08-15 at 14 08 03
rgomezp commented 3 months ago

@rgomezp We have custom targets in our app that automatically get credentials generated for them in EAS builds, using the Expo Apple Targets plugin: https://github.com/EvanBacon/expo-apple-targets/tree/main/apps

Could that be a good way to do credential handling?

I'm not familiar with that plugin unfortunately. It looks like it's still experimental. However, the intended purpose appears to be target management rather than credential handling.

Expo should automatically create credentials based on the targets you have. I suppose it's possible that plugin is removing the OneSignal extension target.

I would suggest putting this plugin first in your plugin config and seeing if that helps. If that doesn't work, remove EvanBacon's plugin, make sure you can get this plugin working without it, and then try re-adding it.

nixolas1 commented 3 months ago

You were completely right. It did a overwrite of the extension target array. Thank you so much!

appfr3d commented 1 month ago

I had the exact same error and experience as you nixolas1. Once I placed the onesignal-expo-plugin plugin after the expo-apple-targets plugin in the plugin array, everything worked as expected!

From:

plugins: [
   ...,
    [
      'onesignal-expo-plugin',
      {
        mode: 'development',
        devTeam: 'XXX',
      },
    ],
    [
      '@bacons/apple-targets',
      {
        appleTeamId: 'XXX',
      },
    ],
  ...,
  ],

to:

plugins: [
   ...,
    [
      '@bacons/apple-targets',
      {
        appleTeamId: 'XXX',
      },
    ],
    [
      'onesignal-expo-plugin',
      {
        mode: 'development',
        devTeam: 'XXX',
      },
    ],
  ...,
  ],