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

131
Visualizações
oneSignal multiple filters tag and location api

I have this function that I want it to send notifications based on user location and tags using OneSignal REST API.

 sendNotifiToDriver(lat, long) {
    console.log(lat, long);
    const body = {
      app_id: environment.onesignal.appId,
      headings: { en: 'كابتن , يوجد طلب جديد' },
      contents: { en: 'يوجد طلب جديد بالقرب منك . ' },
      filters: [
       {
        field: "location", 
        radius: "5000", 
        lat: lat, 
        long: long,
      },
      {field: "tag", "key": "driver", "relation": "=", "value": "lam_driver"}


    ],


    };
    const header = {
      headers: new HttpHeaders()
        .set('Content-Type', 'application/json')
        .set('Authorization', `Basic ${environment.onesignal.restKey}`)
    };
    return this.http.post('https://onesignal.com/api/v1/notifications', body, header).subscribe(res => {
      console.log("driver notifi", res);
    },err=>{
      console.log('driver error ',err)
    })

  }

The problem is l have the error " All included players are not subscribed" . l already have users subscribed with that tags and location. if l use only one filter such as location or only tag above. l will have successful receiving notification. if l used both of them l will have the error above.

any idea please ?

about 4 years ago · Juan Pablo Isaza
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