Skip to content

Conversation

@Nightsd01
Copy link
Contributor

@Nightsd01 Nightsd01 commented Dec 4, 2018

• Adds setExternalUserId() and removeExternalUserId() as public functions to the OneSignal SDK
• Adds tests to verify the request is working correctly and the API request is correctly formatted
• Adds a test to verify that removeExternalUserId() works the same except it sends an empty string (which is what the API wants)


This change is Reviewable

• Adds setExternalUserId() and removeExternalUserId() as public functions to the OneSignal SDK
• Adds tests to verify the request is working correctly and the API request is correctly formatted
• Adds a test to verify that removeExternalUserId() works the same except it sends an empty string (which is what the API wants)
@Nightsd01 Nightsd01 requested a review from jkasten2 December 4, 2018 01:15
• We have a (very) simple dev project for the SDK. This commit adds a text field and button to set an arbitrary external User ID, as well as a button to remove the ID
Copy link
Member

@jkasten2 jkasten2 left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 9 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

• Persists the most recently set external user ID so that if a developer sets it every time a user opens the app (setting the same ID every time), the SDK does not send unnecessary duplicate API requests
• Adds tests to verify that unnecessary API requests don't occur in this scenario
• I had implemented external user ID for Push players but it turns out we want to support it for Email user records as well.
• This commit adds external_user_id to email user records, in a similar matter to how we execute simultaneous requests for sendTags and so on.
• Added an integration test in EmailTests to make sure external ID methods work correctly, duplicate requests don't generate unnecessary API traffic, etc.
• Changes the OneSignalClientOverrider so that it maintains an array of executed OneSignalRequest (API request) objects. This makes testing more flexible
Copy link
Member

@jkasten2 jkasten2 left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 7 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@Nightsd01 Nightsd01 merged commit 8bab228 into master Dec 6, 2018
@Nightsd01 Nightsd01 deleted the set_external_id branch December 6, 2018 02:33
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.

3 participants