OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native iOS app with OneSignal. https://onesignal.com
Other
496
stars
263
forks
source link
Add `OneSignal-Subscription-Id` to Create User request #1372
Add the OneSignal-Subscription-Id header to Create User requests.
Details
Motivation
This was an ask of the SDK to support improved last_active tracking subscriptions that were actually active
What is currently happening is all subscriptions for this user were getting last_active updated.
Now, only the subscription that made the create user request is updated.
Also, changed a detail of User Update request to not be blocked if subscription ID header could not be added (may be missing subscription ID for example)
Scope
Changed the Update User requests to not be blocked if missing subscription-ID
A header in Create User requests for backend to process
I tested with server changes that only the device making the call has last_active updated.
Testing
Unit testing
None, we can add in future to make sure headers are included.
Manual testing
Building and running on iPhone 13 with iOS 17.2.
Change SDK version and call login while already logged into an identified user (this will send a Create User request)
With debug on, confirm the subscription ID is added to the request
Checked dashboard that only this subscription is updated
Affected code checklist
[ ] Notifications
[ ] Display
[ ] Open
[ ] Push Processing
[ ] Confirm Deliveries
[ ] Outcomes
[x] Sessions
[ ] In-App Messaging
[ ] REST API requests
[ ] Public API changes
Checklist
Overview
[x] I have filled out all REQUIRED sections above
[x] PR does one thing
[x] Any Public API changes are explained in the PR details and conform to existing APIs
Testing
[x] I have included test coverage for these changes, or explained why they are not needed
[x] All automated tests pass, or I explained why that is not possible
[x] I have personally tested this on my device, or explained why that is not possible
Final pass
[x] Code is as readable as possible.
[x] I have reviewed this PR myself, ensuring it meets each checklist item
Just tested today with server changes completed that last_active is now only updating the subscription making the request, instead of all subscriptions for the user.
Description
One Line Summary
Add the
OneSignal-Subscription-Id
header to Create User requests.Details
Motivation
last_active
tracking subscriptions that were actually activelast_active
updated.Scope
last_active
updated.Testing
Unit testing
None, we can add in future to make sure headers are included.
Manual testing
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is