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

[question]: Creating a User requires at least one Alias or Subscription #2229

Open
1 task done
helloimfrog opened this issue Dec 9, 2024 · 5 comments
Open
1 task done

Comments

@helloimfrog
Copy link

helloimfrog commented Dec 9, 2024

How can we help?

I tried to integrate OneSignal to my Android app but OneSignal dashboard did not have any new subscription.
image
Then I set OneSignal.Debug.logLevel = LogLevel.DEBUG. I saw this error in logcat:
[DefaultDispatcher-worker-4] HttpClient: Got Response = POST - STATUS: 400 - Body: {"errors":[{"code":"user-3","title":"Creating a User requires at least one Alias or Subscription"}]}
How to fix this? Please help me :(

Code of Conduct

  • I agree to follow this project's Code of Conduct
@doonje
Copy link

doonje commented Dec 9, 2024

@helloimfrog
I think you are using version 5.2.0-beta-02. I got the same error when I set it to [5.0.0,5.99.99] recommended by onesignal. I temporarily defined it as [5.0.0,5.1.15] and downgraded it to 5.1.15 to solve it.

@jinliu9508
Copy link
Contributor

@helloimfrog If you navigate to the dashboard -> Settings -> Keys & IDs -> Identity Verification, is the Token Identity Verification option enabled? If it is, you'll need version 5.2.0-beta-02 to fully utilize this feature. If you don't require this feature, you can simply use the latest production version (5.1.25) to resolve the issue.

@helloimfrog
Copy link
Author

helloimfrog commented Dec 10, 2024

@helloimfrog I think you are using version 5.2.0-beta-02. I got the same error when I set it to [5.0.0,5.99.99] recommended by onesignal. I temporarily defined it as [5.0.0,5.1.15] and downgraded it to 5.1.15 to solve it.

@doonje I tried to downgrade to 5.1.15 but still didn't work. Here is my log (deleted IDs):

D  [OpRepo] processQueueForever:ops:
                                                                                                    [bucket:0, retries:0, operation:{"name":"login-user","appId":"---","onesignalId":"---","id":""}
                                                                                                    , bucket:0, retries:0, operation:{"name":"update-subscription","appId":"---","onesignalId":"---","subscriptionId":"---","type":"PUSH","enabled":true,"address":"---"}
                                                                                                    ]
D  [OpRepo] LoginUserOperationExecutor(operation: [{"name":"login-user","appId":"---","onesignalId":"---","id":""}, {"name":"update-subscription","appId":"---","onesignalId":"---","subscriptionId":"---","type":"PUSH","enabled":true,"address":"---"}])
D  [DefaultDispatcher-worker-2] HttpClient: Request Sent = POST https://api.onesignal.com/apps/---/users - Body: {"properties":{"timezone_id":"Asia\/Ho_Chi_Minh","language":"vi"},"refresh_device_metadata":true} - Headers: Accept=[application/vnd.onesignal.v1+json], Content-Type=[application/json; charset=UTF-8], OneSignal-Install-Id=[189b108e-970b-459a-9d0c-ad08946120b4], SDK-Version=[onesignal/android/050115]
D  [DefaultDispatcher-worker-2] HttpClient: Got Response = POST https://api.onesignal.com/apps/---/users - FAILED STATUS: 400
I  Logging network request trace: https://api.onesignal.com/apps/---/users (responseCode: 400, responseTime: 328,668ms)
W  [DefaultDispatcher-worker-2] HttpClient: Got Response = POST - STATUS: 400 - Body: {"errors":[{"code":"user-3","title":"Creating a User requires at least one Alias or Subscription"}]}
D  [OpRepo] OperationRepo: execute response = FAIL_PAUSE_OPREPO
E  Operation execution failed with eventual retry, pausing the operation repo: [{"name":"login-user","appId":"---","onesignalId":"---","id":""}, {"name":"update-subscription","appId":"---","onesignalId":"---","subscriptionId":"---","type":"PUSH","enabled":true,"address":"---"}]
D  [OpRepo] retryAfterSeconds: null
D  [OpRepo] OperationRepo is paused

@malcriad0
Copy link

malcriad0 commented Dec 20, 2024

Your log show:

[DefaultDispatcher-worker-2] HttpClient: Request Sent = POST https://api.onesignal.com/apps/---/users

I think your solution is that you are not putting the API ID that OneSignal gives you, as I see your http queries do not include the API ID. Check your code to see if you are sending it correctly.

@nan-li
Copy link
Contributor

nan-li commented Dec 21, 2024

Hi @helloimfrog, for the operation that says {"name":"login-user","appId":"---","onesignalId":"---","id":""}, what kind of value does onesignalId have? Is it a random UUID or does the random UUID start with the prefix local-?

For example: "onesignalId":"98535fd1-830c-4a9c-9a5b-248f39ce9765" or does it look like "onesignalId":"local-98535fd1-830c-4a9c-9a5b-248f39ce9765"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants