OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Ionic, PhoneGap CLI, PhoneGap Build, Cordova, or Sencha Touch app with OneSignal. Supports Android, iOS, and Amazon's Fire OS platforms. https://onesignal.com
Other
251
stars
199
forks
source link
[Bug]: Problem with upgrade from v3 to v5. Problem with post request #996
### What did you expect to happen?
Have to work
### OneSignal Cordova SDK version
5.1.4
### Which platform(s) are affected?
- [ ] iOS
- [X] Android
### Relevant log output
```Shell
I am trying to upgrade from "onesignal-cordova-plugin": "3.3.1" to 5.1.4
Everything worked but right now I am getting error in my Android Studio
2024-05-21 14:53:10.341 1065-1065 LayerHistory surfaceflinger I com.ca.goteamo/com.ca.goteamo.MainActivity$_3895#6773 Max (can't resolve refresh rate)
2024-05-21 14:53:10.648 3895-4752 OneSignal com.ca.goteamo D [OpRepo] processQueueForever:ops:
[bucket:0, retries:0, operation:{"name":"login-user","appId":"34c87996-464b-4e05-9ee9-c03b2e269aec","onesignalId":"local-84ee9d6f-0361-48fa-9a7f-4767c9e8112c","id":"e9bc67e3-b4db-460b-a55c-cac5a59bfa4f"}
, bucket:0, retries:0, operation:{"name":"create-subscription","appId":"34c87996-464b-4e05-9ee9-c03b2e269aec","onesignalId":"local-84ee9d6f-0361-48fa-9a7f-4767c9e8112c","subscriptionId":"local-a0844f2f-90b1-4041-8dec-56b9a459c94b","type":"PUSH","enabled":false,"address":"","status":"NO_PERMISSION","id":"c40a7fed-f3a5-41a7-b08f-d787c3b25e47"}
]
2024-05-21 14:53:10.650 3895-4752 OneSignal com.ca.goteamo D [OpRepo] LoginUserOperationExecutor(operation: [{"name":"login-user","appId":"34c87996-464b-4e05-9ee9-c03b2e269aec","onesignalId":"local-84ee9d6f-0361-48fa-9a7f-4767c9e8112c","id":"e9bc67e3-b4db-460b-a55c-cac5a59bfa4f"}, {"name":"create-subscription","appId":"34c87996-464b-4e05-9ee9-c03b2e269aec","onesignalId":"local-84ee9d6f-0361-48fa-9a7f-4767c9e8112c","subscriptionId":"local-a0844f2f-90b1-4041-8dec-56b9a459c94b","type":"PUSH","enabled":false,"address":"","status":"NO_PERMISSION","id":"c40a7fed-f3a5-41a7-b08f-d787c3b25e47"}])
2024-05-21 14:53:10.685 3895-4746 OneSignal com.ca.goteamo D [DefaultDispatcher-worker-3] HttpClient: Request Sent = POST https://api.onesignal.com/apps/34c87996-464b-4e05-9ee9-c03b2e269aec/users - Body: {"subscriptions":[{"type":"AndroidPush","token":"","enabled":false,"notification_types":0,"sdk":"050113","device_model":"SM-X510","device_os":"14","rooted":false,"net_type":0,"app_version":"4"}],"properties":{"timezone_id":"America\/Vancouver","language":"en"},"refresh_device_metadata":true} - Headers: Accept=[application/vnd.onesignal.v1+json], Content-Type=[application/json; charset=UTF-8], OneSignal-Install-Id=[3a06d0de-b748-440d-b0f5-6b2d3c4de217], OneSignal-Subscription-Id=[local-a0844f2f-90b1-4041-8dec-56b9a459c94b], SDK-Version=[onesignal/android/050113], SDK-Wrapper=[onesignal/cordova/050104]
2024-05-21 14:53:10.696 3895-4746 CapacitorCookies com.ca.goteamo I Getting cookies at: 'https://api.onesignal.com/apps/34c87996-464b-4e05-9ee9-c03b2e269aec/users'
2024-05-21 14:53:10.895 3895-4746 OneSignal com.ca.goteamo D [DefaultDispatcher-worker-3] HttpClient: Got Response = POST https://api.onesignal.com/apps/34c87996-464b-4e05-9ee9-c03b2e269aec/users - FAILED STATUS: 401
2024-05-21 14:53:10.899 3895-4746 OneSignal com.ca.goteamo W [DefaultDispatcher-worker-3] HttpClient: Got Response = POST - STATUS: 401 - Body: {"errors":[{"code":"auth-1","title":"This operation requires 'Authorization' in the HTTP header"}]}
2024-05-21 14:53:10.902 3895-4752 OneSignal com.ca.goteamo D [OpRepo] OperationRepo: execute response = FAIL_UNAUTHORIZED
2024-05-21 14:53:10.905 3895-4752 OneSignal com.ca.goteamo E Operation execution failed without retry: [{"name":"login-user","appId":"34c87996-464b-4e05-9ee9-c03b2e269aec","onesignalId":"local-84ee9d6f-0361-48fa-9a7f-4767c9e8112c","id":"e9bc67e3-b4db-460b-a55c-cac5a59bfa4f"}, {"name":"create-subscription","appId":"34c87996-464b-4e05-9ee9-c03b2e269aec","onesignalId":"local-84ee9d6f-0361-48fa-9a7f-4767c9e8112c","subscriptionId":"local-a0844f2f-90b1-4041-8dec-56b9a459c94b","type":"PUSH","enabled":false,"address":"","status":"NO_PERMISSION","id":"c40a7fed-f3a5-41a7-b08f-d787c3b25e47"}]
2024-05-21 14:53:10.919 3895-4752 OneSignal com.ca.goteamo D [OpRepo] retryAfterSeconds: null
2024-05-21 14:53:11.120 3895-4752 OneSignal com.ca.goteamo D [OpRepo] processQueueForever:ops:
null
What happened?
Problem with login request or initialize
Steps to reproduce?
I have the js code in my app
How to fix this? Please assist