Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

245
Visualizações
How to set External_User_Id in OneSignal using web(js)?

I noticed that OneSignal is creating a unique player_id and adding a column in its database when my web app is loaded for the first time by any user.

I'm trying to add a custom external_user_id into the same one signal DB field using below code (as per OneSignal docs):

<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" ></script>
<script>
let externalUserId = "123456789"; 

OneSignal.push(function() {
  OneSignal.setExternalUserId(externalUserId);
});
</script>

But somehow, the external_user_id field is still set to empty.

So I added the below code to it.

<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" ></script>
<script>
let externalUserId = "123456789"; 

window.OneSignal = window.OneSignal || [];
OneSignal.push(function() {
    OneSignal.init({
        appId: "xoxoxoxoxoxoxoxoxo",
    });
});

OneSignal.push(function() {
  console.log("triggering");
  OneSignal.setExternalUserId(externalUserId);
  console.log("triggering");
});

It has no errors, yet external_user_id is still not updated.

This is the OneSignal code I have added to my Android Studio

package com.appgrep.xoxoxo;

import android.app.Application;

public class OneSignal extends Application {

    private static final String ONESIGNAL_APP_ID = "xoxoxoxoxoxoxoxoxo";

    @Override
    public void onCreate() {
        super.onCreate();

        // OneSignal Initialization
        com.onesignal.OneSignal.initWithContext(this);
        com.onesignal.OneSignal.setAppId(ONESIGNAL_APP_ID);
    }
}

I just am trying to add External_User_Id in OneSignal using Web (JS) Any help is greatly appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I think it's not possible through web buddy.

What you are trying to do is to update a field in onesignl using website. Which i don't think one signal let's you do.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda