react-native-onesignal icon indicating copy to clipboard operation
react-native-onesignal copied to clipboard

[Bug]: Tags not appearing in OneSignal dashboard after being added.

Open hamzaali98 opened this issue 1 year ago • 1 comments

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?

  • [X] iOS
  • [X] 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

  • [X] I agree to follow this project's Code of Conduct

hamzaali98 avatar Oct 16 '24 19:10 hamzaali98

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

hamzaali98 avatar Oct 16 '24 19:10 hamzaali98

Hello @hamzaali98 thanks for your patience. This may have just been a momentary lag in our dashboard logging. If you are still seeing this problem please let us know and we can investigate further!

jennantilla avatar Dec 06 '24 20:12 jennantilla

any updates here ? I've exact same issue

batuhanbag avatar Jan 23 '25 13:01 batuhanbag

Same issue. Very poor documentation.

vicnguyenqt avatar Oct 05 '25 14:10 vicnguyenqt