[push-notifications] Cannot send notifications using ExpoPushToken (Expo 40)

🐛 Bug Report

Summary of Issue

After upgrade to Expo 40 and iOS, I have a problem with sending Push Notifications using ExpoPushToken. The issue happens only on a standalone app, in Expo client everything works fine.

During the debug process, I had tried to use DevicePushToken and I managed to send and receive notifications (using node-apn with keys from expo fetch:ios:certs). The device token is 645f97af437250b8207c3e4ddaff9d9850350bc4391cf895cdb526f502a9716d.

When I call exp.host/getExpoPushToken with deviceToken above I receive token ExponentPushToken[pXoWnIHNZytciNSC7M0LtC]. The notifications sent by this ExpoPushToken do not appear on iOS device.

IMO, the standalone build and certificates are just fine, as I manage to receive notifications using node-apn. Most probably the issue is somewhere in exp.host/--/api/v2/push/send or in the method that “links” ExpoPushToken and DeviceToken.

Can you check if there were any changes on expo.api that can cause the following regression?

I’d appreciate any help here.

Environment – output of expo diagnostics & the platform(s) you’re targeting

Expo CLI 4.0.13 environment info:
System:
OS: macOS 10.15.7
Shell: 3.2.57 – /bin/bash
Binaries:
Node: 12.19.1 – /usr/local/bin/node
Yarn: 1.22.10 – /usr/local/bin/yarn
npm: 6.14.8 – /usr/local/bin/npm
Watchman: 4.9.0 – /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 – /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
Android SDK:
API Levels: 28, 29, 30
Build Tools: 28.0.3, 29.0.2
System Images: android-24 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-R | Google APIs Intel x86 Atom
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6626763
Xcode: 12.2/12B45b – /usr/bin/xcodebuild
npmPackages:
expo: 40.0.0 => 40.0.0
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz => 0.63.2
npmGlobalPackages:
expo-cli: 4.0.13
Expo Workflow: managed

2 thoughts on “[push-notifications] Cannot send notifications using ExpoPushToken (Expo 40)

  1. Okay, I think I was able to reproduce the behavior -> you need to install a fresh SDK 40 iOS app, then uninstall it, then reinstall it again. The ExpoPushToken doesn’t change, and the push notifications aren’t sent.

  2. We will need to deploy the fix, I’ll update here once we do. It won’t require any changes or updates on your end