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

[Bug]: Adding externalId, email, tags not working #1646

Open
3 tasks done
SohelIslamImran opened this issue Feb 7, 2024 · 6 comments
Open
3 tasks done

[Bug]: Adding externalId, email, tags not working #1646

SohelIslamImran opened this issue Feb 7, 2024 · 6 comments

Comments

@SohelIslamImran
Copy link

SohelIslamImran commented Feb 7, 2024

What happened?

I'm using "react-native-onesignal": "^5.0.4" with "onesignal-expo-plugin": "^2.0.2", and the below code to add externalId, email, tags :

  OneSignal.login(uid);
  OneSignal.User.addEmail(email);
  OneSignal.User.addTags({...})

But in the dashboard, Audience > Subscriptions, I can see no externalId, email, or tags have been set..

image

Steps to reproduce?

Follow all the steps here: https://documentation.onesignal.com/docs/react-native-expo-sdk-setup
Including adding externalId, email and tags

What did you expect to happen?

I expect when I'm calling OneSignal.login(uid);, OneSignal.User.addEmail(email); and OneSignal.User.addTags({...}) with data, I should see these externalId, email and tags in the dashboard

React Native OneSignal SDK version

5.0.4

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

Xcode logs
image

Code of Conduct

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

Anyone figured how to fix this?

@SohelIslamImran
Copy link
Author

Anyone figured how to fix this?

@JovanMwesigwa Yes.. Turn off this
image

https://documentation.onesignal.com/docs/identity-verification

@thomaskyr
Copy link

Hello,
using version "react-native-onesignal": "^5.0.6" I have the same issue using Onesignal.login(externalId) with the external id being something like:
R3Fpo3v+cAmelVpSxv5Y82tLY1JTJIZ250jXvGZbaEqjzL4fDEWHG9JT9fwfCnANxpxpAuCd9gmqKUXWj+DFGF==

In some cases I see that the user gets logged in (but even in these cases, the OneSignal.User.addTag method doesn't work). In most of the attempts though, the user doesn't get logged in.

Relevant Log:
VERBOSE: network response (OneSignalUser.OSRequestIdentifyUser): { errors = ( { code = "user-2"; meta = { "external_id" = "R3Fpo3v+cAmelVpSxv5Y82tLY1JTJIZ250jXvGZbaEqjzL4fDEWHG9JT9fwfCnANxpxpAuCd9gmqKUXWj+DFGF=="; }; title = "One or more Aliases claimed by another User"; } ); httpStatusCode = 409; }

VERBOSE: executeIdentifyUserRequest failed with error Optional(Error Domain=OneSignalError Code=409 "(null)" UserInfo={returned={ errors = ( { code = "user-2"; meta = { "external_id" = "R3Fpo3v+cAmelVpSxv5Y82tLY1JTJIZ250jXvGZbaEqjzL4fDEWHG9JT9fwfCnANxpxpAuCd9gmqKUXWj+DFGF=="; }; title = "One or more Aliases claimed by another User"; } ); httpStatusCode = 409; }})

DEBUG: executeIdentifyUserRequest returned error code user-2. Now handling user-2 error response... switch to this user. VERBOSE: network response (OneSignalUser.OSRequestFetchUser): { errors = ( { title = "Given alias (external_id: R3Fpo3v+cAmelVpSxv5Y82tLY1JTJIZ250jXvGZbaEqjzL4fDEWHG9JT9fwfCnANxpxpAuCd9gmqKUXWj+DFGF==) doesn't match an existing user"; } ); httpStatusCode = 404; }

ERROR: OSUserExecutor executeFetchUserRequest failed with error: Optional(Error Domain=OneSignalError Code=404 "(null)" UserInfo={returned={ errors = ( { title = "Given alias (external_id: R3Fpo3v+cAmelVpSxv5Y82tLY1JTJIZ250jXvGZbaEqjzL4fDEWHG9JT9fwfCnANxpxpAuCd9gmqKUXWj+DFGF==) doesn't match an existing user"; } ); httpStatusCode = 404; }})

VERBOSE: OSOperationRepo enqueueDelta: OSDelta OS_UPDATE_SUBSCRIPTION_DELTA with property: subscriptionId value: nil

As far as I understand, It seems like it confuses the external id with an alias.
If I change the external id to something like "abcdefg12345" it works fine. What could the issue be? The special characters? The length of the external id? In that case, why does the user get logged in randomly? And why does it work fine on Android?

@thomaskyr
Copy link

Update:
The issue is resolved only if I edit the external id, replacing the special characters (+, =, /) with underscore _ or dash -
When I do this, the OneSignal.User.addTag method works correctly.

@Raduc4
Copy link

Raduc4 commented Apr 5, 2024

Hi, I also have this bug. I'm trying to setup the external_id of a user, where the external_id is my users database uuid, however, the external Id is not set up in any way and I can't debug this.
I'm using pure react native for this and the flow is very simple, I initialize OneSignal, request the permission and then login the user, nothing special in my opinion.
image
Also I can get my externalId with OneSignal.User.getExternalId()
but, when trying to send the notification to the external id using the rest API I get this
{"id":"","errors":["All included players are not subscribed"]}⏎
but I have a subscription created for the current app running

@hafizusman2
Copy link

any updates here?

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