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]: Tags not appearing in OneSignal dashboard after being added. #1754

Open
3 tasks done
hamzaali98 opened this issue Oct 16, 2024 · 1 comment
Open
3 tasks done

Comments

@hamzaali98
Copy link

hamzaali98 commented Oct 16, 2024

What happened?

After adding tags to a user via OneSignal.User.addTags(), I can fetch the tags successfully using OneSignal.User.getTags() and see them logged in my application. However, these tags do not appear on the OneSignal dashboard.

  • React Native version: 0.74.3

Additional Information:
I have confirmed that the tags are being added successfully, and there are no visible network errors in the logs. This issue occurs even after refreshing the dashboard multiple times.

Steps to reproduce?

1. Use `OneSignal.User.addTags()` to add tags to the user.
2. Use `OneSignal.User.getTags()` to confirm that the tags are added and fetched correctly.
3. Check the OneSignal dashboard, and the tags do not appear there.

Code

useEffect(() => {
  if (patientProfile) {
    OneSignal.User.getTags()
      .then(tags => {
        console.log('Current tags for the user:', tags);
      })
      .catch(error => {
        console.error('Error fetching tags:', error);
      });

    OneSignal.User.pushSubscription.getIdAsync().then(id => {
      console.log('Push subscription ID:', id);
    });

    OneSignal.User.pushSubscription.getTokenAsync().then(token => {
      console.log('Push subscription token:', token);
    });

    console.log('Adding tags to OneSignal User');

    OneSignal.User.addTags({
      role: 'patient',
      email: String(patientProfile.user.email || ''),
      phone: String(patientProfile.user.phoneNumber || ''),
      donor: String(patientProfile.bloodDonor ? 'yes' : 'no'),
    });
  }
}, [patientProfile]);

What did you expect to happen?

The tags should appear on the OneSignal dashboard after being added.

React Native OneSignal SDK version

5.2.2

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

- Current tags for the user: `{"donor": "yes", "email": "[email protected]", "phone": "+218123123123", "role": "patient"}`
- Push subscription ID: `ed124ccb-a2b0-4b9c-a4ba-a8c81ed89796`
- Push subscription token: `94f7ca889631e9fc124477e4f2929cdcf0d74dcbeff8aa41711d8270d6c69189`

Code of Conduct

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

As can be seen in the following screenshot the user is being registered but the user tags are not there.

Screenshot 2024-10-16 at 21 26 02

Screenshot 2024-10-16 at 21 27 07

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

1 participant