Closed ramithks closed 4 days ago
I had logged in using OneSignal.login
and then called addSms
and addEmail
. I could see these pieces of information in the OneSignal Dashboard as different channels (i.e., Push, SMS, and Email). However, they were appearing in different rows, which was unexpected.
Additionally, when I called the OneSignal.Notifications.requestPermission(true)
method, I received the following error message: "Invalid token
format for device type SMS." In the OneSignal dashboard, it also indicated "permission not granted."
I resolved this issue by taking the following steps:
login()
method after addSms()
and addEmail()
.This approach worked for me, and I am now closing this issue.
Hi @ramithks thank you for reporting this. This looks like a bug in the SDK. The correct order is to call login
then add email and SMS to ensure the email and SMS are applied to the correct external ID.
To workaround the current bug, you can delay adding email and SMS until later.
Hi @ramithks thank you for reporting this. This looks like a bug in the SDK. The correct order is to call
login
then add email and SMS to ensure the email and SMS are applied to the correct external ID.
Hey @nan-li,
For me, it's the opposite. I was initially using the approach you mentioned, but since it wasn't working, I'm now calling the login
method after adding the SMS and email.
I believe there might be an issue with the SDK (perhaps we are attaching the wrong token while sending a patch/post request).
Additionally, I have a question: Typically, in most apps, users first click on "ask," then the prompt appears. If they allow notifications, we can enable them later in the settings. If they disallow notifications, we can re-enable them in the settings.
However, we are confused about which method to use for different scenarios. There are so many observables, Booleans, permissions, and more. The example provided includes all the methods and just calls them.
Is there a proper example or blog post supporting this? I've been working on this for a week but still haven't figured it out, and even ChatGPT, Claude AI, and Gemini are confused too. Any help would be much appreciated.
Hi @ramithks the initial approach is correct, but when the email and SMS are added at the same time as login
, the SDK interpreted some server responses incorrectly. We are actively fixing this now.
You are asking about prompting and managing notifications permissions, correct? We have a mobile SDK reference here. Can you explain more what you mean by "If they allow notifications, we can enable them later in the settings. If they disallow notifications, we can re-enable them in the settings."?
Hi @ramithks the initial approach is correct, but when the email and SMS are added at the same time as
login
, the SDK interpreted some server responses incorrectly. We are actively fixing this now.You are asking about prompting and managing notifications permissions, correct? We have a mobile SDK reference here. Can you explain more what you mean by "If they allow notifications, we can enable them later in the settings. If they disallow notifications, we can re-enable them in the settings."?
What I meant is that we will allow notifications at the beginning (from the system prompt). Later, users should be able to disable them in the app’s settings (if allowed). Conversely, if notifications are disallowed initially, we need to enable them later, right?
Regarding the mobile SDK reference, it's very much confusing. There is no practical guidance. If you provide me with sample projects or any blog posts that would be helpful. 🚀
What happened?
I have logged in using
OneSignal.login
and then calledaddSms
andaddEmail
. I can see these pieces of information in the OneSignal Dashboard as different channels (i.e., Push, SMS, and Email). My question is: why are they being created as different channels (or why are they appearing in different rows)?Additionally, when I called the
Signal.Notifications.requestPermission(true)
method, I received the following error message: "Invalidtoken
format for device type SMS." In the OneSignal dashboard, it also indicates "permission not granted."My PushNotificationsController:
What did you expect to happen?
No errors should be displayed when requesting permission, and the push notifications permission should be granted.
OneSignal Flutter SDK version
^5.2.1
Which platform(s) are affected?
Relevant log output
Code of Conduct