Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Incorrect player_id format in include_player_ids (not a valid UUID): [object Object]" #592

Closed
ctfrancia opened this issue Dec 10, 2019 · 5 comments

Comments

@ctfrancia
Copy link

ctfrancia commented Dec 10, 2019

Description:

I always get the error when trying to send a mobil notification, it works fine when using postman, but when sending through the app it gives the error.
(your description here)

Environment

  1. cordova v: 9.0.0
  2. don't think plugins are usefull information when trying to use a non native api.

Steps to Reproduce Issue:

make an http POST request to this address from within an ionic4 angular 8 application:
https://onesignal.com/api/v1/notifications

{ 
   "app_id":"valid app_id",
   "appearence":{ 
      "small_icon":"https://picsum.photos/id/681/24/24"
   },
   "contents":{ 
      "en":"sfdgsdf"
   },
   "headings":{ 
      "en":"Christian Francia"
   },
   "big_picture":"https://commons.wikimedia.org/wiki/Commons:Quality_images#/media/File:Gull_portrait_ca_usa.jpg",
   "data":{ 
      "origin":"Christian Francia",
      "firstNames":"Christian",
      "lastNames":"Francia",
      "picture":"",
      "type":"message",
      "originId":"Francia12495",
      "message":{ 
         "userId":"Francia12495",
         "author":"Christian",
         "content":"sdfg",
         "timeStamp":"2019-12-10T15:05:25.587Z",
         "recipient":"Francia12495",
         "FCMToken":"my push token",
         "profilePicture":"",
         "id":"118",
         "email":"[email protected]"
      }
   },
   "include_player_ids":[ 
      "883f6544-e9f2-4ad2-95fb-b6de687b8302"
   ]
}

Anything else:

(crash stacktraces, as well as any other information here)

if I copy and paste the JSON into postman and make a post request to the address then I receive the notification, however, when sending a post request from within the application I always get that error.

thanks for your help

@mikechoch
Copy link
Contributor

mikechoch commented Jan 7, 2020

May I see your code example?

Also you might want to try converting the array of ids into a string before inserting it into the JSON

@mikechoch
Copy link
Contributor

mikechoch commented Jan 7, 2020

I used the public method from our SDK and was able to send a notification to 2 users with no issue. Here is the format I followed for the JSON and the example code.

var json = {
    "contents": {"en": "Test notification"},
    "include_player_ids": ["b4c7ec09-7610-4d8c-8847-1bbebefc0f7d", "a17d9d5e-b5ca-42c9-a30c-884374bb12f6"]
};
window.plugins.OneSignal.postNotification(json,
    (result) => {
        console.log("Success");
    },
    (error) => {
        console.log("Error");
    });

@ctfrancia
Copy link
Author

I changed it to use the api instead of using a server because this was just too frustrating to solve

@Darrow8
Copy link

Darrow8 commented Mar 17, 2021

Ran into this error, still happening to me. Anyone else?

@ikalashniuk
Copy link

Trying to figure out
image

Can't get player by any of ids (Subscription ID or OneSignal ID)

irb(main):021:0> osid = 'd4971211-2cc3-4ba1-ac67-135821f473ed'
=> "d4971211-2cc3-4ba1-ac67-135821f473ed"
irb(main):022:0> osr = OneSignal::Player.get(id: osid)
Traceback (most recent call last):
        1: from (irb):22
OneSignal::OneSignalError (OneSignal::Player#Get error - uri: https://onesignal.com/api/v1/players/d4971211-2cc3-4ba1-ac67-135821f473ed params:  - http status : 400 - http body : {"errors":["app_id must be a valid UUID"]})
irb(main):023:0> osid = 'bdb85739-9f0d-4460-a2d2-d53dac617607'
=> "bdb85739-9f0d-4460-a2d2-d53dac617607"
irb(main):024:0> osr = OneSignal::Player.get(id: osid)
Traceback (most recent call last):
        1: from (irb):24
OneSignal::OneSignalError (OneSignal::Player#Get error - uri: https://onesignal.com/api/v1/players/bdb85739-9f0d-4460-a2d2-d53dac617607 params:  - http status : 400 - http body : {"errors":["app_id must be a valid UUID"]})
irb(main):025:0>

Getting the "app_id must be a valid UUID" error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants