fix: Correct payload to unbreak open link when clicking welcome notification #1207
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://app.asana.com/0/1208719710991963/1208760940956731/f
This issue boiled down to the "Open link when clicking welcome notification" feature not working, when you clicked the notification is opened the 'default' URL, not the option set.
After doing a bunch of digging, I was able to confirm that we were saving that setting and then servcing it to the SDK via the sync API.
I was then able to trace it through:
There we shovel that url into a dataPayload that we shovel into a service worker call.
That comes out the other side when you click the notifiction in:
There we cast via:
const osNotification = event.notification.data as IOSNotification;
IOSNotification is defined to have:
However, the struct we created had:
url != launchURL
Fixing the payload made it start working.
Systems Affected
Validation
Tests
Info
I only manually tested this. If we need automated tests, please show me where to get started.
Checklist
Programming Checklist
Interfaces:
Functions:
Typescript:
Other:
elem of array
syntax. PreferforEach
or usemap
context
if possible. Instead, we can pass it to function/constructor so that we don't callOneSignal.context
Screenshots
Info
Checklist
Related Tickets
https://app.asana.com/0/1208719710991963/1208760940956731/f
This change is