Hi, Guys
I am trying to send a push notification to a signal device - I have done it with an Android devices see
Push notification - Sending to one device (with the new Firebase API)
Basically I took Erel's latest push notification example and changed topic to token and provide the token/ID of the phone.
However, I tried a similar technique on the iphone and it did not work - in fact I got the error (see below).
It suggests a bad device ID but I am sure it is correct.
Can anyone help (I will post the code if it helps)?
Dave
----------
Waiting for debugger to connect...
Program started.
{
"message": {
"notification": {
"title": "Title 001",
"body": "Body 001"
},
"data": {
"title": "Title 001",
"body": "Body 001"
},
"topic": "d4ku_kuscUEJsgROTmod1Y:APA91bESjzCsRKFTX-80BItlAzmOqSVA63I9S3C7D4N9uRZ1l0wnhZ4SqjZSCbDRWQPDQSn6eWar46c6Z6-XKWhmc1HhUshqhfY3HwVZBbxZEV2hXwI082A",
"apns": {
"headers": {
"apns-priority": "10"
},
"payload": {
"aps": {
"badge": 0,
"sound": "default"
}
}
}
}
}
ResponseError. Reason: , Response: {
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.firebase.fcm.v1.FcmError",
"errorCode": "INVALID_ARGUMENT"
},
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "message.token",
"description": "Invalid registration token"
}
]
}
]
}
}
----------------
I am trying to send a push notification to a signal device - I have done it with an Android devices see
Push notification - Sending to one device (with the new Firebase API)
Basically I took Erel's latest push notification example and changed topic to token and provide the token/ID of the phone.
However, I tried a similar technique on the iphone and it did not work - in fact I got the error (see below).
It suggests a bad device ID but I am sure it is correct.
Can anyone help (I will post the code if it helps)?
Dave
----------
Waiting for debugger to connect...
Program started.
{
"message": {
"notification": {
"title": "Title 001",
"body": "Body 001"
},
"data": {
"title": "Title 001",
"body": "Body 001"
},
"topic": "d4ku_kuscUEJsgROTmod1Y:APA91bESjzCsRKFTX-80BItlAzmOqSVA63I9S3C7D4N9uRZ1l0wnhZ4SqjZSCbDRWQPDQSn6eWar46c6Z6-XKWhmc1HhUshqhfY3HwVZBbxZEV2hXwI082A",
"apns": {
"headers": {
"apns-priority": "10"
},
"payload": {
"aps": {
"badge": 0,
"sound": "default"
}
}
}
}
}
ResponseError. Reason: , Response: {
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.firebase.fcm.v1.FcmError",
"errorCode": "INVALID_ARGUMENT"
},
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "message.token",
"description": "Invalid registration token"
}
]
}
]
}
}
----------------