-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Track Push Notification Opt-In Status #14579
Conversation
…ication opt-in status
@mollfpr You should be able to check the NVP result by:
|
@mollfpr Not able to reproduce this. Did you run |
# Conflicts: # tests/unit/NetworkTest.js
99d799d
Merge conflicts resolved (the only conflict was in a test) |
Thanks @roryabraham I'll test it again this morning 🙏 |
@roryabraham I kept getting the |
@mollfpr are you testing with an iOS simulator? Simulators can't receive push notifications so I wonder if that's the cause. Did you opt-in to push notifications when prompted? |
@roryabraham Yes, I opted in when it prompted. I’ll try it on the physical device then. |
@roryabraham I ask on Slack how to run the dev app on the iPhone physical device, but there's not possible for the contributors right now. Any suggestion? |
Myself, @arosiclair, or @stitesExpensify can test iOS. I can't do this today, but should be able to find time tomorrow. |
# Conflicts: # src/libs/Notification/PushNotification/index.native.js
Conflicts resolved |
Working on the checklist right now |
Reviewer Checklist
Screenshots/VideosMobile Web - ChromeN/A Mobile Web - SafariN/A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests well!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Thanks for taking this over the finish line @arosiclair 🚀 |
Performance Comparison Report 📊Significant Changes To DurationThere are no entries Meaningless Changes To DurationShow entries
Show details
|
🚀 Deployed to staging by https://github.com/arosiclair in version: 1.2.74-0 🚀
|
@roryabraham, we are struggling with this PR.
Let me know if this is expected or should be logged as a separate issue Action Performed:
Expected Result: Actual Result: |
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.2.74-0 🚀
|
HOLD on https://github.com/Expensify/Web-Expensify/pull/36368
Note that a require cycle was recently added by a different PR unrelated to this one.
Details
This PR starts tracking whether a user is opted-in to push notifications on a per-device basis.
Relevant comment: urbanairship/react-native-airship#427 (comment)
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/209233
Tests / QA Steps
Web
Run the web app, and search console logs for
deviceID
.Verify that you see a log line like:
Refresh the page. Verify that you see a log line like so (with a matching GUID):
Close the tab, then open it again. Verify that you see a log line like so:
Log out then refresh the page. Verify that you see a log line like so:
Desktop
Run the desktop app, and search console logs for
deviceID
. You can open the dev console in the desktop app withCMD + Option + I
Verify that you see a log line like:
Close the app and reopen it. Verify that you see a log line like:
Log out, then close the app and reopen it. Verify that you see that same log line.
Completely uninstall and reinstall the app, then open the app. Verify that you see the same log line.
iOS
Sign into the app.
When prompted, accept push notifications.
Look at the value of the
pushNotificationsEnabled
NVP, either with a CQ:Or by signing into the same account on https://staging.expensify.com, then running
NVP.get('pushNotificationsEnabled')
in the console.Verify that the NVP shows that you opted in to push notifications for the current device. It should look like this:
Where
iPhone15,2_90CD2827-B91E-45E5-A63E-76ADC67F47F0
is the deviceID, the most recent value of the NVP is at the end of the array, andisEnabled
should be true.Sign out and sign back in with a different account, then accept notifications when prompted.
Look at the NVP again for the new account and verify that it shows the same deviceID w/
isEnabled: true
.Sign out and sign back in with the first account.
Look at the NVP again for the first account and verify that it hasn't changed.
Completely uninstall and reinstall the app.
Sign in to the same account and accept push notifications when prompted.
Look at the NVP again, and verify that it hasn't changed.
Completely uninstall and reinstall the app.
Sign in to the same account, but this time reject push notifications when prompted.
Look at the NVP again and verify that there's a new entry at the end of the array that shows
isEnabled: false
.Now open settings, scroll down to
New Expensify
, and enable notifications. Then come back to the app.Look at the NVP again and verify that there's a new entry at the end of the array that shows
isEnabled: true
.Now open settings, scroll down to
New Expensify
, and disable notifications. Then come back to the app.Look at the NVP again and verify that there's a new entry at the end of the array that shows
isEnabled: false
.Android
Sign into the app on Android.
Look at the value of the
pushNotificationsEnabled
NVP , either with a CQ:Or by signing into the same account on https://staging.expensify.com, then running
NVP.get('pushNotificationsEnabled')
in the console.Verify that the NVP shows that you opted in to push notifications for the current device.
Sign out, then sign back in with a different account.
Look at the NVP again for the different account and verify that you see the same deviceID with
isEnabled: true
.Sign out, then sign back in with the first account.
Look at the NVP again for the first account and verify that it hasn't changed.
Close the app and reopen it.
Look at the NVP again and verify that it hasn't changed.
Now go into settings and disable notifications for New Expensify, then open the app again.
Look at the NVP again and verify that there's a new entry showing
isEnabled: false
Close the app and reopen it.
Look at the NVP again and verify that it hasn't changed.
Now go into settings and re-enable notifications for New Expensify, then open the app again.
Look at the NVP again and verify that there's a new entry showing
isEnabled: true
.Offline tests
None.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
Mobile Web - Chrome
No tests or QA for mobile web.
Mobile Web - Safari
No tests or QA for mobile web.
Desktop
iOS
https://www.youtube.com/watch?v=WAVT4B_ph9w
Android
Android.mov