expo: [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
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 24 (8 by maintainers)
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
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.
Fixed. Awesome. Expo rocks 😃
This should be fixed now 👍 let me know if you still run into the same issue
@andreas-arkulpa thanks but that’s exactly what I said I tested in this comment, so unfortunately that doesn’t help. What would help is to provide a consistent reproducible demo (going to mark these comments as duplicates so that my original comment stays visible)
@fedyk I tried reproducing this by installing an SDK 38 app, then updating to SDK 40 and updating the app via testflight, notifications still come through and the ExpoPushToken remained the same (even switching from LegacyNotifications to
expo-notifications
).Here is the repo to test this: https://github.com/cruzach/11304-repro/commits/master. You can use the
sdk 38
andsdk 40
commits to try for yourself.Please, if you are finding the issue, say exactly what error message you’re receiving (in your push tickets or push receipts, or in the app itself), and exactly the steps you’ve taken to consistently reproduce this issue from a blank app. otherwise there are a wide variety of reasons why notifications may not work, and it’s extremely difficult to diagnose your specific issue.