You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm migrating from version 3 to the latest release 5. After initialization, the device is successfully registered with OneSignal users, however, no other actions are performed successfully: addTags, listeners, option. All of these throw an "invalid action" exception. This way, tags are not updated in OneSignal, nor are external_ids, listeners to handle when pushes are opened are also not executed.
It seems to me to be a general instability in the library, any method other than "initialize" returns errors, even the methods for setting the Debug Level.
The second user registration is using the old API, version 3, which is why the Tag values are set
Steps to reproduce?
Lib version: "onesignal-cordova-plugin": "5.0.3"
I created some methods to call manually, to perform the initialize, add tags, listeners functions.
All of these actions below return an invalid action message.
initialize() {
// This set return a error
OneSignal.Debug.setLogLevel(6);
OneSignal.initialize("..."); let myClickListener = async function (event) { let notificationData = JSON.stringify(event); console.log(notificationData); }; //invalid action OneSignal.Notifications.addEventListener('click', myClickListener); //invalid action OneSignal.login("..."); }addTags() { OneSignal.User.addTags({ key: "value", key2: "value", }); OneSignal.User.addAlias('idek', idUserPush);}permission() { OneSignal.Notifications.requestPermission(true).then(s => { alert(s); });}optin() { OneSignal.User.pushSubscription.optIn();}optout() { let perm = OneSignal.Notifications.hasPermission(); console.log(perm); console.log(OneSignal.User.pushSubscription.optedIn); OneSignal.User.pushSubscription.optOut();}
### What did you expect to happen?
I want to start the session, set a user's tags and external id and control the opening of pushes with their parameters.
### OneSignal Cordova SDK version
5.0.3
### Which platform(s) are affected?
- [ ] iOS
- [X] Android
### Relevant log output
_No response_
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
<!-- probot = {"onesignal-probot":{"response_time_in_business_days":1}} -->
The text was updated successfully, but these errors were encountered:
eirielson
changed the title
[Bug]:
[Bug]: "Invalid action" message for any action (addTag, addAliases, requestPermission)
Nov 27, 2023
What happened?
Hi, I'm migrating from version 3 to the latest release 5. After initialization, the device is successfully registered with OneSignal users, however, no other actions are performed successfully: addTags, listeners, option. All of these throw an "invalid action" exception. This way, tags are not updated in OneSignal, nor are external_ids, listeners to handle when pushes are opened are also not executed.
It seems to me to be a general instability in the library, any method other than "initialize" returns errors, even the methods for setting the Debug Level.
The second user registration is using the old API, version 3, which is why the Tag values are set
Steps to reproduce?
The text was updated successfully, but these errors were encountered: