3
votes

I'm gettin an error with parse.com when I try to register an Android token device, for push notifications.

This is my request:

{

"deviceType": "android",

"deviceToken": "MY DEVICE ANDROID TOKEN",

"installationId": "acef4da2-98e8-484f-9688-cbb1c6a27c8e",

"channels": [ "" ]

}

and I get this response:

{

"code": 114,

"error": "deviceToken may not be set for deviceType android"

}

Someone knows why I get this error?

3

3 Answers

6
votes

I got the error too and solved it.

Registering an android device, You should add pushType.

Refer to : http://upbeat-sound.tistory.com/24

0
votes

From the push notification guide in the parse docs:

"deviceToken: The Apple generated token used for iOS devices, or the token used by GCM to keep track of registration ID (readonly)."

the field is readonly, and you are trying to write to it.

0
votes

You can simply use

    ParseInstallation.getCurrentInstallation().save();

This will automatically save your device info in as an Installation Object.