expo: Notifications.getExpoPushTokenAsync() never resolves on iOS with SDK 37 in bare (ejected) workflow

๐Ÿ› Bug Report

Summary of Issue (just a few sentences)

token = await Notifications.getExpoPushTokenAsync() never resolves on my iOS device (iPhone XS).

Environment - output of expo diagnostics & the platform(s) youโ€™re targeting

  Expo CLI 3.21.13 environment info:
    System:
      OS: macOS 10.15.4
      Shell: 3.0.2 - /usr/local/bin/fish
    Binaries:
      Node: 12.17.0 - /usr/local/bin/node
      Yarn: 1.22.4 - ~/.yarn/bin/yarn
      npm: 6.14.4 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.6 AI-192.7142.36.36.6308749
      Xcode: 11.5/11E608c - /usr/bin/xcodebuild
    npmPackages:
      expo: 37.0.12 => 37.0.12
      react: 16.9.0 => 16.9.0
      react-native: 0.61.4 => 0.61.4
      react-native-web: ^0.11.7 => 0.11.7
      react-navigation: ^4.0.10 => 4.0.10
    npmGlobalPackages:
      expo-cli: 3.17.15

Reproducible Demo

I copied the official snack and added back my app.json file. Is there anything else that needs to be configured? Maybe something for an ejected app?

Steps to Reproduce

Run the snack on device.

Expected Behavior vs Actual Behavior

Notifications.getExpoPushTokenAsync() should resolve, instead it never does.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

@cruzach - Yep, thatโ€™s it. My mistake. Specifically, we did not update the call to pass an experienceId after we ejected the app. The development option does not seem to matter in this case, perhaps because our app is live on the store? If we had wrapped the code in a try...catch we would have seen that error. I also see this is pretty well documented, so I apologize for not reading the docs more closely before posting.

Thank you. I really appreciate your help and time.

This seems very similar to https://github.com/expo/expo/issues/8757. I have also tried using experienceId:

token = await Notifications.getExpoPushTokenAsync({
                experienceId: '@garrettg/think-smart-journal',
              })