iOS credentials being unassigned from app

I seem to be running into an issue when one or both of my two Expo apps (being used for different users for the same project) keep having the User Credentials for iOS be removed from the app, leading to push notifications not reaching the apps with the error: “Could not find APN credentials for , you may need to generate or upload new push credentials”. At first I thought this was an issue from a couple weeks ago when I was testing something with a new expo account in the cli (bad move) which led to different credentials being used, but then I cleared all my credentials locally, made sure they were removed from the Apple Developer Portal, and generated a new Push Notification Key for both apps to use.

That fix was only a few days ago, but after a recent build and push to the App stores last night, today both apps stopped receiving pushes with the same error again. I ran credentials:manager and saw that the Push Notification Key and Distribution Certificate were both listed as being “unused by any app”, which was obviously unusual since I used every “let Expo handle the process” command when generating the new creds. I used the manager to “use existing push notif key and distribution cert in current project”, in both apps, and then both key and cert read as being used by both apps.

I was unsure how this happened in the first place, but while showing another developer how I diagnosed the issue with the credentials:manager command in case it became an issue again, now only ONE app is using the Cert and Key, even though both apps had been listed as using them only a few minutes earlier, from the same project location.

Both apps appear to be receiving pushes without issue now, even though the credentials manager lists only one app as using the certs, but based on previous experiences this week another build for the unlisted app may break push notification functionality for it again. Is this actually an error and my iOS keys/certs are getting unassigned from my apps? And if so, how do I prevent it from happening again?

Edit: It might be worth noting that whenever I attempt to assign the Distribution Certificate or Push Notification Key to the current project, I get the helper text “? Validity of this certificate on Apple’s servers is unknown”. I can’t find anything relevant from searching for that response, however.

Output from executing expo diagnostics
Expo CLI 3.20.9 environment info:
System:
OS: Linux 5.0 Ubuntu 19.04 (Disco Dingo)
Shell: 5.0.3 - /bin/bash
Binaries:
Node: 13.6.0 - ~/.nvm/versions/node/v13.6.0/bin/node
Yarn: 1.21.1 - /usr/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v13.6.0/bin/npm
npmPackages:
expo: ~36.0.0 => 36.0.2
react: ~16.9.0 => 16.9.0
react-dom: ~16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz => 0.61.4
react-native-web: ~0.11.7 => 0.11.7
npmGlobalPackages:
expo-cli: 3.20.9

There is a bug in our api that seems to remove push key when assigning dist cert. it should be fixed very soon, but if you want to setup this right now you can

  • with credentials:manager select push key and dist cert
  • quit credentials manager and start it again(force refetch of credentials)
  • one of two previously selected credentials will be now marked as "unused by any app”
  • select push key or dist cert, only the one that is missing
  • quit and restart to verify if both push key and dist cert are assigned

I’m glad that there is going to be a fix for this and I appreciate the swift reply, but unfortunately your solution doesn’t fix my exact issue. As I described, the dist cert and push key are shared between two different apps.

Ex:

  • I run credentials:manager in the root of either project A or B, and project A is declared as using the cert and key, but not project B.
  • I enter into the root of project B and run credentials:manager, and have project B use the exisiting cert and key. The User credentials now shows both projects A and B use the cert and the key – all appears well.
  • I exit credentials manager and re-run it to force a refetch of the credentials, and now only project B is listed as using the cert and key, and not A for either.

Both apps are made with my same Expo account and are in different folder from each other. Would the bug you’re referring to be the cause of this specific case?

It should be fixed now.

I didn’t test that with 2 apps, but most likely it’s the same problem

I made sure to update to the most recent version of expo-cli and attempted the same process again, got the same result. It’s worth noting that both apps receive Pushes ok in production as of right now, but past experience tells me that the next time I create and/or submit a new build, if something is still wrong it will break again.

Do I not need to worry that both apps aren’t showing as using the dist/cert at the same time, or is this an issue the Expo team still needs to look into? The last thing my team and I want is to think everything is in the clear, push a new version of either app out, and suddenly notifications don’t work again. It’s a pretty big deal-breaker for our product.

Sorry I tested this issue only for one app and it works there, but problem with multiple apps is still happening. I just tested it our staging and it works there, so it seems that the fix is ready and should be deployed to production soon.

Can you try now?

It’s worth noting that both apps receive Pushes ok in production

It worked because credentials assignment was removed by mistake from db, but the redis cache was not cleared

past experience tells me that the next time I create and/or submit a new build, if something is still wrong it will break again.

All the problems related to this bug were affecting you only when modifying credentials, if you would have dist cert and pus key set up this bug would not affect you. Before building make sure if output of expo credntials:manager from the clean start is showing everything assigned correctly it.

Yes, I verified it works now and both apps show that the Key and Cert are assigned to both. Thanks for your assistance!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.