I am trying to implement Segment tag management system (segment.com) in my react native app. I have successfully implemented it with source as RN app, and destinations like Voucherify and Firebase Analytics. I had previously implemented OneSignal with it's APIs to my RN app.

Now, I was trying to implement OneSignal as a destination of Segment. But, it's not clear for me how to set external user ID of OneSignal through Segment. All the data I send through Segments identify call comes in the tags section of OneSignal. The external user ID section remains blank for a user record that came through Segment.

So, my question is, how to set external user ID of OneSignal through Segment. Is it possible? If so how?

1

There are 1 answers

0
Kvlknctk On

You can set onesignal external user ID after user logged.

 Platform.OS === 'ios' &&
      OneSignal.promptForPushNotificationsWithUserResponse(response => {
        if (response && auth.isLogged) {
          OneSignal.setExternalUserId(auth.user._id);
        }
      });

This is a simple example from my projects. But you can use everywhere what you want.

  OneSignal.setExternalUserId("_externalUserId");

After this setting, the id you set will appear on your panel. enter image description here