OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
616 stars 213 forks source link

[Bug]: **external_id not registerd** #841

Closed salahturkmen closed 7 months ago

salahturkmen commented 7 months ago

What happened?

User Subscribed in dashboard but external_id not registerd

Steps to reproduce?

Tested in real devices
And two mothed
    OneSignal.login('Odun1');
    OneSignal.loginWithJwt('Odun1','******');

What did you expect to happen?

User Subscribed With external_id

OneSignal Flutter SDK version

Release 5.1.0

Which platform(s) are affected?

Relevant log output

D/OneSignal(17426): [OpRepo] LoginUserOperationExecutor(operation: [{"name":"login-user","appId":"**-**-**-**-**","onesignalId":"**-**-**-**-**","externalId":"Odun2","existingOnesignalId":"**-**-**-**-**","id":"**-**-**-**-**"}, {"name":"transfer-subscription","appId":"**-**-**-**-**","subscriptionId":"**-**-**-**-**","onesignalId":"**-**-**-**-**","id":"**-**-**-**-**"}])
D/OneSignal(17426): [OpRepo] IdentityOperationExecutor(operations: [{"name":"set-alias","appId":"**-**-**-**-**","onesignalId":"**-**-**-**-**","label":"external_id","value":"Odun2"}])
D/OneSignal(17426): [DefaultDispatcher-worker-5] HttpClient: PATCH apps/**-**-**-**-**/users/by/onesignal_id/**-**-**-**-**/identity - {"identity":{"external_id":"Odun2"}}
D/OneSignal(17426): [DefaultDispatcher-worker-5] HttpClient: PATCH apps/**-**-**-**-**/users/by/onesignal_id/**-**-**-**-**/identity - FAILED STATUS: 401
W/OneSignal(17426): [DefaultDispatcher-worker-5] HttpClient: PATCH RECEIVED JSON: {"errors":[{"code":"auth-1","title":"This operation requires 'Authorization' in the HTTP header"}]}
D/OneSignal(17426): [OpRepo] OperationRepo: execute response = FAIL_UNAUTHORIZED
E/OneSignal(17426): Operation execution failed without retry: [{"name":"login-user","appId":"**-**-**-**-**","onesignalId":"**-**-**-**-**","externalId":"Odun2","existingOnesignalId":"**-**-**-**-**","id":"**-**-**-**-**"}, {"name":"transfer-subscription","appId":"**-**-**-**-**","subscriptionId":"**-**-**-**-**","onesignalId":"**-**-**-**-**","id":"**-**-**-**-**"}]
E/OneSignal(17426): Could not login user

Code of Conduct

gitananun commented 7 months ago

Having the same issue. Login with any external_id is not working. After allowing the notifications, a new subscription is there with an empty external_id.

vydyas commented 7 months ago

@salahturkmen Do you have any other solution?

salahturkmen commented 7 months ago

not yet trying to update external id by rest api but nothing

nan-li commented 7 months ago

Hi @salahturkmen do you have Identity Verification turned on for your app?

The v5 SDKs currently do not support that feature yet so Identity Verification should be off.

salahturkmen commented 7 months ago

@nan-li Identity Verification?

vydyas commented 7 months ago

@nan-li Its already off for my app still login function is not setting the external id.

Screenshot 2024-02-23 at 9 50 54 PM
nan-li commented 7 months ago

Hi @salahturkmen,

If you go into the OneSignal Dashboard, go to Settings > Keys & IDs > Identity Verification for email + external_id is a toggle.

Screenshot 2024-02-23 at 10 10 23 AM

Can you confirm it is set to "off"?

nan-li commented 7 months ago

Hi @vydyas, I would not expect the error {"errors":[{"code":"auth-1","title":"This operation requires 'Authorization' in the HTTP header"}]} if you have Identity Verification turned off.

Is everyone else reporting also seeing this with Identity Verification turned to "off"?

salahturkmen commented 7 months ago

Hi @salahturkmen,

If you go into the OneSignal Dashboard, go to Settings > Keys & IDs > Identity Verification for email + external_id is a toggle.

Screenshot 2024-02-23 at 10 10 23 AM

Can you confirm it is set to "off"?

thank now it run

gitananun commented 6 months ago

Still having issues with external_id. For one user only, it works fine. But I'm testing with other user's phones, and it doesn't register the external_id for the users.

tamiratdereje commented 6 months ago

Still having issues with external_id. For one user only, it works fine. But I'm testing with other user's phones, and it doesn't register the external_id for the users.

I think you have to reinstall the app, and it will work perfectly.

FullstackWEB-developer commented 1 month ago

I got same issue with iOS. Strangely, all functions work smoothly with the same code on Android and iOS, but only on iOS, external_id registration does not work when logging in. await OneSignal.login('test_id');