Skip to content
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

[Looking for Feedback] OneSignal SDK 5.0.0-beta-02 Released! #1208

Closed
emawby opened this issue Jan 10, 2023 · 6 comments
Closed

[Looking for Feedback] OneSignal SDK 5.0.0-beta-02 Released! #1208

emawby opened this issue Jan 10, 2023 · 6 comments
Labels

Comments

@emawby
Copy link
Contributor

emawby commented Jan 10, 2023

📌 Latest beta release: 5.0.0-beta-02 📌

In this major version beta release for the OneSignal SDK, we are making a significant shift from a device-centered model to a user-centered model. A user-centered model allows for more powerful omni-channel integrations within the OneSignal platform.

For information please see the migration guide.

🚧 Beta release. Please test thoroughly prior to production use 🚧

Please post any feedback related to the beta under this issue.

@emawby emawby added the Beta label Jan 10, 2023
@emawby emawby pinned this issue Jan 10, 2023
@jfishman1
Copy link
Contributor

jfishman1 commented Jan 11, 2023

1 - In the previous SDK, we could get email and sms data like email address/phone number, email/sms player_id and email/sms subscription status: https://documentation.onesignal.com/docs/sdk-reference#email-user-properties

Does the new SDK not provide these options? Just adding emails and phone numbers?

2 - What happens if UserA adds EmailA and UserB adds EmailA, what happens in this scenario?

3 - setExternalUserId is now replaced by login. What happens if the device is offline? How are tags and other properties handled in this case since there are no callbacks like setExternalUserId had?

4 - Alias is a neat feature, is there a way to list all associated aliases assigned to the current User?

5 - Similar question to 3 above, what happens if you call addEmail, addTags, addSMSNumber, addAlias if the device is offline or what if this fails to update within OneSignal due to API errors?

6 - Is there a replacement for getTags method? There needs to be a way to delete multiple tags but unclear which are set on the user.

7 - is postNotification method being deprecated?

@nan-li
Copy link
Contributor

nan-li commented Jan 11, 2023

@jfishman1 These are really good points.

Overall, one of the intentions with this release is for OneSignal to serve less as a data store for app developers. The main responsibility will be on the app developer to know the state of their users. For example, the getDeviceState method that returns all of a device's data is removed.

Another side effect is that information is separated. For example, whether the app has system-level push notification permission or not can be retrieved by OneSignal.Notifications.permission while getting the opted in state is retrieved by OneSignal.User.pushSubscription.optedIn. These don't account for the existence of the push token or subscription ID which are retrieved by OneSignal.User.pushSubscription.token and OneSignal.User.pushSubscription.id respectively.

Another change is eventual consistency. On previous releases, many methods invoke immediate server calls to update device information. Now, the SDK batches updates and sends them on a regular interval (the specifics of which may still change, and may be modified by some parameter, but currently at every 5 seconds). Then, on app cold start and on every new session (app backgrounded for 30 seconds), the SDK fetches from the server to update the local state.

Questions

1 - In the previous SDK, we could get email and sms data like email address/phone number, email/sms player_id and email/sms subscription status: https://documentation.onesignal.com/docs/sdk-reference#email-user-properties. Does the new SDK not provide these options? Just adding emails and phone numbers?

True, in the alpha, app developers are not able to get the subscription ID for an email or sms subscription and that is something the SDK may need to provide. The previous boolean isEmailSubscribed and isSMSSubscribed just returns whether the player ID (now subscription ID) exists.

2 - What happens if UserA adds EmailA and UserB adds EmailA, what happens in this scenario?

The subscription for EmailA is removed from UserA and transferred to userB once UserB adds that email. As mentioned above, the main responsibility will still be on the app developer to manage adding emails to their users.

3 - setExternalUserId is now replaced by login. What happens if the device is offline? How are tags and other properties handled in this case since there are no callbacks like setExternalUserId had?

That is a good point and something we should try to address. Currently in the alpha, the SDK keep any updates queued in the device if they can't be sent due to not having a onesignal_id yet for the user, for example. This is not implemented yet but we should keep them in the queue if we don't have a network connection as well. Then, they will be sent once the device has a network connection. This change of not having callbacks for all updates relates to the point above about eventual consistency.

4 - Alias is a neat feature, is there a way to list all associated aliases assigned to the current User?

There is no SDK API to get aliases for the user as the app developer should know the aliases they have added to users. However, information about a specific user can be retrieved with the Fetch User endpoint through the REST API.

5 - Similar question to 3 above, what happens if you call addEmail, addTags, addSMSNumber, addAlias if the device is offline or what if this fails to update within OneSignal due to API errors?

See no.3 above about device offline. For other errors, the SDK will try to handle them, but we are open to feedback from OneSignal users on our removal of callbacks.

6 - Is there a replacement for getTags method? There needs to be a way to delete multiple tags but unclear which are set on the user.

There is no replacement for getTags. App developers should know about the tags they have added to and removed from users. If a tag does not exist, removing it will not error.

7 - is postNotification method being deprecated?

Yes, it is being deprecated since this seems mostly used for testing and developers can use the REST API instead.

@nan-li
Copy link
Contributor

nan-li commented Feb 6, 2023

📌 5.0.0-beta-01 has been released 📌

@nan-li nan-li changed the title [Looking for Feedback] OneSignal SDK 5.0.0-alpha-01 Released! [Looking for Feedback] OneSignal SDK 5.0.0-beta-01 Released! Feb 6, 2023
@nan-li nan-li changed the title [Looking for Feedback] OneSignal SDK 5.0.0-beta-01 Released! [Looking for Feedback] OneSignal SDK 5.0.0-beta-02 Released! Feb 18, 2023
@nan-li
Copy link
Contributor

nan-li commented Feb 18, 2023

📌 5.0.0-beta-02 has been released 📌

@deboralagemb
Copy link

I'm not sure what to use instead of OneSignal.postNotification

@artem-sherbachuk
Copy link

Why "postNotification" method is removed from SDK?
You seams not understands why developer switched to OneSignal, because it's allowed to send push notification from app. There is problem with backed in many apps, developers just don't want or can't do, spend a time on developing their backed. So they looking for solution to send push notification from an app. This method to send push notification from mobile app should be easy as possible.

@jkasten2 jkasten2 unpinned this issue Apr 1, 2024
@nan-li nan-li closed this as completed Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants