Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop using addPushTokenListener #4467

Merged
merged 6 commits into from
Jun 11, 2024
Merged

Conversation

haileyok
Copy link
Contributor

@haileyok haileyok commented Jun 10, 2024

Why

The callback in addPushTokenListener is not fired once the token changes on Android. This appears to be a possible regression in expo-notifications - we are inquiring on that now.

What we know:

  • Notifications.getDevicePushTokenAsync() still works on both iOS and Android
  • The callback in addPushTokenListener() does get called on iOS
  • The callback does not get called on Android

What is unclear:

  • If this is actually expected behavior. I do not believe it is because:
    • It certainly worked in the past (this isn't a guarantee that it's expected of course though)
    • It continues to work on iOS
    • The documentation suggests to use this callback for registering your push token.
  • What can happen if the listener is not added/it is broken. see https://docs.expo.dev/versions/latest/sdk/notifications/#addpushtokenlistenerlistener re the warning about it possibly changing.

Test Plan

Merge this in and see if notifications start coming through on some production devices.

Copy link

render bot commented Jun 10, 2024

Copy link

github-actions bot commented Jun 10, 2024

Old size New size Diff
7.39 MB 7.39 MB 7 B (0.00%)

@haileyok haileyok force-pushed the hailey/dont-use-addPushTokenListneer branch from 47d2f4e to d8ea418 Compare June 10, 2024 21:41
Copy link

The Pull Request introduced fingerprint changes against the base commit:

Fingerprint diff
[{"type":"dir","filePath":"node_modules/expo-notifications/android","reasons":["expoAutolinkingAndroid"],"hash":"67ae39dd56d831bd99c271ea574e1d25be036a78"},{"type":"dir","filePath":"patches","reasons":["patchPackage"],"hash":"e49d3cbf4e5b21ee9eee1e6ff38accd2606f3bc8"}]

Generated by PR labeler 🤖

@gaearon gaearon marked this pull request as ready for review June 11, 2024 01:15
Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verified notifs work on android now

@gaearon gaearon merged commit c73ad43 into main Jun 11, 2024
6 of 7 checks passed
@gaearon gaearon deleted the hailey/dont-use-addPushTokenListneer branch June 11, 2024 01:16
estrattonbailey added a commit that referenced this pull request Jun 11, 2024
* origin/main: (54 commits)
  patch `expo-notifications` to clear badge (#4475)
  Revert to old modal on android (#4458)
  Sort profile feedgens by likes (#4380)
  Revert "Fix undefined block (#4471)" (#4472)
  Fix undefined block (#4471)
  Open convo menu when tapping on chat with deleted account (#4470)
  stop using `addPushTokenListener` (#4467)
  add hitslop to repost button (#4469)
  Add a loading indicator to notifications when loading latest (#4468)
  Visually improve the empty state of feeds (#4466)
  Give a meaningful error in the composer when replying to a deleted post (#4464)
  Fix: show known feed error UI more reliably (#4463)
  Only validate persisted data for existing users (#4465)
  Check `canAskAgain` for notification permissions (#4460)
  Add support for new-tab clicks on feeds (#4462)
  Override legacy language codes for indonesian, hebrew, and yiddish (#4461)
  Ungate mobile web notification badge (#4459)
  Fix (#4430): Use separate hooks for shell mode animated styles (#4451)
  Throttle instead of debounce (#4456)
  debounce refetching listconvos (#4455)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants