-
Notifications
You must be signed in to change notification settings - Fork 262
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
Add getters and observer for onesignal ID and external ID #1344
Merged
Commits on Dec 5, 2023
-
Use another class to be push subscription namespace
Background: The User Manager is itself the user namespace AND the push subscription namespace via implementing both protocols. The problem is that we will be adding an `addObserver` method to the User namespace and this will conflict with the existing `addObserver` method that exists on the Push Subscription namespace. Solution: Use a separate class `OSPushSubscriptionImpl` that will implement the push subscription namespace. And an instance of this class will live on the User Manager. Also update existing code to go through pushSubscriptionImpl.
Configuration menu - View commit details
-
Copy full SHA for 9c4a05f - Browse repository at this point
Copy the full SHA 9c4a05fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 03d09f0 - Browse repository at this point
Copy the full SHA 03d09f0View commit details -
Problem: App developers want to know the onesignal ID for a user, but it can be null if we have not received the response from the server after a fresh install or after logging in. Solution: Offer a user state observer that will fire when the response is received and fire with the onesignal ID and external ID. Implementation Details: On Identity Model hydration from the server (when onesignal_id is received), we will snapshot the onesignal_id and external_id as the conclusive IDs for the current user. On future hydrations after logging in, we will compare to the previous snapshot to know if the observer should be fired. We must not only compare onesignal_id but also external_id for the case of logging in Anonymous -> New Identified. In this case, the onesignal_id will not change but the external_id will be attached to the user on the server.
Configuration menu - View commit details
-
Copy full SHA for 920662c - Browse repository at this point
Copy the full SHA 920662cView commit details -
Configuration menu - View commit details
-
Copy full SHA for e2c5323 - Browse repository at this point
Copy the full SHA e2c5323View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd8f47b - Browse repository at this point
Copy the full SHA dd8f47bView commit details -
Json representation of User State uses empty string, not "nil"
When giving a jsonRepresentation of OSUserState, choose empty string as the representation of a null value instead of the string literal "nil". The string "nil" can be interpreted as an existing value whereas the empty string is a better option as it can be checked for `isEmpty`.
Configuration menu - View commit details
-
Copy full SHA for d3bae81 - Browse repository at this point
Copy the full SHA d3bae81View commit details
Commits on Dec 6, 2023
-
Remove previous from user state changed
* We are removing the previous user state from the public user state changed state. We will consider adding this in the future.
Configuration menu - View commit details
-
Copy full SHA for 813933c - Browse repository at this point
Copy the full SHA 813933cView commit details
Commits on Dec 11, 2023
-
Add in-code documentation on user state observer
* Add a callout on the usage of the user state observer. * App developers should be checking the `externalId` when they retreive the `onesignalId`. This is to make sure they are grabbing the onesignalId for the user that they expect.
Configuration menu - View commit details
-
Copy full SHA for 06ab04a - Browse repository at this point
Copy the full SHA 06ab04aView commit details
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.