-
Notifications
You must be signed in to change notification settings - Fork 61
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
Make OneSignalId and ExternalId nullable for Android #699
Conversation
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.
Lgtm!
I think the editor platform methods could also return null because the subscription doesn't get created on the backend. What do you think? Do you have an preferences?
https://github.com/OneSignal/OneSignal-Unity-SDK/blob/user-model/main/com.onesignal.unity.core/Editor/Platform/UserManager.cs#L35
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.
Is this also addressed for the UserState object? {"onesignalId": "123456789, "externalId": null}
Ok I just made that change. I think it will keep the code consistent regarding the default value of the IDs. |
Yes, both null and "" will make the getter to return null. |
For the UserState that is passed to observers? I am not sure how everything is translated across Unity bridges, but here it uses the |
Unity string is nullable and yes this line of code |
Ok! 👍🏼 Thanks! I did not know that also applied to the UserState |
Make OneSignalId and ExternalId nullable for Android
Make OneSignalId and ExternalId nullable for Android
Make OneSignalId and ExternalId nullable for Android
Make OneSignalId and ExternalId nullable for Android
Make OneSignalId and ExternalId nullable for Android
Make OneSignalId and ExternalId nullable for Android
Make OneSignalId and ExternalId nullable for Android
Make OneSignalId and ExternalId nullable for Android
Description
One Line Summary
Make OneSignalId and ExternalId nullable for Android. The result of calling the getter will be null if no ID is currently available.
Details
Motivation
To keep all wrappers consistent when dealing with the IDs.
Testing
Manual testing
I have modified the example scene so that it displays "null" if calling the ID getter results in a null string. Tested on Android emulator pixel 3a API 34
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is