Notification error: APNs credentials

I am puzzled by this. I sent a notification two days ago, but then they stopped sending. I tested sending with curl and got this back:

{"data":{"status":"error","message":"Could not find APNs credentials for com.___.___ (...). Check whether you are trying to send a notification to a detached app."}}

I couldn’t find anything in the documentation about this.

Other information: we did recently send a new version to the app store. Because we ran into difficulties with the upgrade from SDK 22 to 24 we ran exp build:ios -c as that worked for other users. It seems like that reset the notification credentials.

That looks like an accurate diagnosis. exp build:ios -c clears your Apple credentials registered with Expo, including your Apple push notification certificate. Expo then would no longer have the certificate needed to send push notifications.

If you recreate your Apple credentials – either by letting Expo take care of it with exp build:ios or by uploading your push certificate (also via exp) – your push notifications with the existing tokens should start working awhile after.

James,

Thanks so much for you response. I don’t see an options for uploading the push certificate. I checked exp --help. Is it documented somewhere else?

Hi @monjohn - When you run exp build:ios and don’t have certificates registered, it will ask you if you want to provide your own.

The option is slightly hidden and implicit, the standalone app docs slightly allude to this here:

If you choose to build for iOS

Next we will ask you if you’d like us to handle your distribution certificate or use your own.

That docs page might be useful in general when you’re building standalone apps.

The first time we published it, I believe that we had expo handle them.

This time we did

  1. exp fetch:ios:certs
  2. exp build:ios -c and provide the creds we had just fetched

@ide Don’t mean to keep bothering you, but based on information I added about what we did, could you recommend a course of action.

@monjohn Howdy,

Your APN creds should now work (assuming you did those two steps listed with success).

So we went through the steps again and noted that our Push p12 password is undefined (see output below). We did another build and a fetch and got the same result. Seems like a bug.

[exp] There is a new version of exp available (48.0.0).
You are currently using exp 47.4.4
Run `npm install -g exp` to get the latest version
[exp] Retreiving iOS credentials for @our/app
[exp] These credentials are associated with Apple Team ID: xxxxxxxxxx
[exp] Writing distribution cert to /filepath/file_dist.p12...
[exp] Done writing distribution cert credentials to disk.
[exp] Writing push cert to /filepath/file_push.p12...
[exp] Done writing push cert credentials to disk.
[exp] Writing provisioning profile to /filepath/file.mobileprovision...
[exp] Done writing provisioning profile to disk
[exp] Save these important values as well:

Distribution p12 password: xxxxxxxxxxxxxxxxxxxxxxxxxx
Push p12 password:         undefined

Thank you! I will look at this now.

@monjohn Thank you very much for your patience, it was a bug indeed in how exp was saving your push password that you gave when uploading your own files.

Just released a small update to exp fixing that. Should work now after upgrading exp.

1 Like

Thanks for jumping on this. Really appreciate it.

We tried again and got this:

[exp] Looking for releases...
[exp] (_xdl || _load_xdl(...)).Project.getLatestReleaseAsync is not a function
[exp] Set EXPO_DEBUG=true in your env to view the stack trace.

What version of exp is that ? @fson might know about that error.

Hi @monjohn! This error (Project.getLatestReleaseAsync is not a function) should be fixed in exp version 48.0.2. Can you try upgrading to the latest exp version and see if that helps?

Just want to let you know that the update fixed the problem. Thanks for the great product and your responsiveness!

1 Like

Glad you got it working, thanks for your patience.

Thanks for the kind words, tell your programmer friends about expo!

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