FB FCM-Fehler: 'InvalidRegistration'

Ich bin versucht derzeit, senden Sie eine PushNotification zu einem Device Group mit FCM mit Hilfe von Firebase Cloud Functions aber sobald die Meldung gesendet wird, gibt es mit dem code 200 aber mit Fehler :

SUCCESS response= {
multicast_id: 8834986220110966000,
success: 0,
failure: 1,
canonical_ids: 0,
results: [ { error: 'InvalidRegistration' } ] 
}

Hier ist der code, den ich verwende, um diese Benachrichtigung zu senden... was bin ich?

const options = {
    method: 'POST',
    uri: 'https://fcm.googleapis.com/fcm/send',
    headers: {
       'Authorization': 'key=' + serverKey,
    },
    body: {
       to: groupId,
       data: {
        subject: message
       },
       notification: {
         title: title,
         body: body,
         badge: 1,
        },
       content_available: true
    },
    json: true
};

return rqstProm(options)
    .then((parsedBody) => {
        console.log('SUCCESS response=', parsedBody);
    })
    .catch((err) => {
        console.log('FAILED err=', err);
    });

Wo die JSON-Werte title, body, subject, message sind String

InformationsquelleAutor John | 2017-05-17

Schreibe einen Kommentar