Trying to get OneSignal Player ID from GoNative

@adeomomo Yes I did!

So in the footer on every page I have a Javascript to Bubble element (in my case the bubble_fn_suffix is player_id).

Then also in the footer I have a plain HTML element with this code inside of it:

<script type="text/javascript">
function gonative_onesignal_info(info) {
    bubble_fn_player_id(info.oneSignalUserId);
    console.log(info.oneSignalUserId);
}
</script>

The console.log line is optional, I just used it for debugging.

Finally, I have a workflow that takes the value of the Javascript to Bubble element and saves it to the current user in the database.

1 Like