Custom iOS client Push Notification issue : could not find APNs credentials

I build an ios client with expo client:ios (because I need background location which no more supported in regular client)
I uploaded my .p8 Apple Push Notifications service key as prompted (I got a “:heavy_check_mark: Successfully validated the Push Key you uploaded against Apple Servers” message)

But when trying to send push notification on the server side (to a ExponentPushToken retrieved from this custom iOS client) I get a Exponent::Push::InvalidCredentialsError (Could not find APNs credentials for dev.expo.client.b6knfhxcazlam5rik … ) error message.

APNs key I uploaded is the same I use in production and works well.

Thanks a lot for your help !

hi @romainh, thanks for reporting your issue. This is definitely not expected behavior – I’ll look into this and get back to you!

It would be really helpful if you could send us the build url (ie) expo.io/builds/xxxx-xxxx-xxx, or the client build url (ie) expo.io/client/xxxxx (you should have gotten an email w this link when your build had completed). You can email the links to secure@expo.io . thanks!

I have build & install success custom ios client. Everything seems work fine except push notification.

const { status: existingStatus } = await Permissions.getAsync(Permissions.NOTIFICATIONS)
  if (existingStatus !== 'granted') {
    console.log('existting status', existingStatus)
    // Android remote notification permissions are granted during the app
    // install, so this will only ask on iOS
    const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS)
    console.log('status', status)
    finalStatus = status
  }

above code result

existting status undetermined
status undetermined

I also uploaded my .p8 Apple Push Notifications service key as prompted (I got a “:heavy_check_mark: Successfully validated the Push Key you uploaded against Apple Servers” message)

I have checked Identifiers in developer portal ( which is auto generated by expo). Push notification have not checked. Is it ok?

Bundle ID
dev.expo.client.ogrbtb6qjs2r2ckysde7kawski6fq7mxgdx7uhy6t5t2g (explicit)

Hello danghung I had the same trouble.
On Apple Developper Portal on the Identifier auto-generated by Expo, if you check “Push Notification” and generate a Certificate you will be able to get a “granted” status from Permissions.askAsync(Permissions.NOTIFICATIONS) and retrieve a ExponentPushToken.
But then I am unable to send a Push Notification from server-side because of this Exponent::Push::InvalidCredentialsError …

On Apple Developper Portal on the Identifier auto-generated by Expo, if you check “Push Notification” and generate a Certificate you will be able to get a “granted” status from Permissions.askAsync(Permissions.NOTIFICATIONS)

Do we need to do it manual?
Because it does not appear in documents.
@quinlanj can you confirm this?

@danghung
oh hm… it looks like the apple developer portal does not automatically enable push notifications :confused:
With the current state of things, in order to get Permissions.NOTIFICATIONS, you will need to check off Push Notifications as @romainh described in the Apple Developer Portal. Next, you will need to build again to get a Client build with the appropriate configurations. This new build should allow you to obtain a token.

Building twice is not the most ideal state, so I’ll also look into automatically enabling push notifications so ppl dont have to manually do this from the developer portal.