I am attempting to integrate ActiveTree:Meteor-Push into my app for iOS and Android. I have followed the example found in the repo and am able to get the notifications to fire successfully but when they do I experience never-ending repeating errors that state that “android.data must only contain string values”.
I have spent literal hours reading the small amount of documentation available, and exhaustively reviewing both the example app as well as the actual implementation of the package on github and am still unsure what I am doing wrong.
I have noticed that I do not receive the error if there are no devices registered _push_app_tokens collection in the db, but if I register an iPhone, this is what happens.
I have included relevant code and output snippets below - as you can see each value inside of the android.data object is a string. I can determine no way to alter this object despite various attempts.
App Token:
{
"_id": "vTx4c9p23hJgJzKFw",
"token": {
"apn":"eWUoR1R3yEY:APA91bGqTgfHtOARjGP..."
},
"appName":"App Name",
"userId":"5e207e5702dd88273aca77b4f",
"enabled":true,
"createdAt":"1611549799035.0",
"updatedAt":"1611549807207.0"
}
Notification send:
Push.send({
from: 'Test',
title: 'TEST',
body: 'this is a test',
userId: this.userId
})
Notification in _push_notifications collection:
{
"_id":"EWus4L7GAwzevQjty",
"createdAt":{"$numberDouble":"1611595420575.0"},
"createdBy":"<SERVER>",
"sent":false,
"sending":{"$numberInt":"60000"},
"from":"App name",
"title":"TEST",
"body":"this is a test",
"userId":"5e207e5702dd88273ac08b4f"
}
Error:
Push: Could not send notification id: "BrhNkZ9hntLCHCMCM", Error: android.data must only contain string values
Push: Send message "TEST" to user: [ '5e207e5702dd88273ac08b4f' ]
Send to token {
apn: 'eWUoR1R3yEY:APA91bGqTgfHt...'
}
Final notification right before shoot out: {
"android": {
"priority": "HIGH",
"data": {
"title": "TEST",
"body": "this is a test",
"color": "#337FAE",
"tag": "undefined",
"channel_id": "appName",
"notification_priority": "PRIORITY_DEFAULT",
"visibility": "PRIVATE"
},
"fcm_options": {
"analytics_label": "activitreeSomething"
}
},
"apns": {
"headers": {
"apns-priority": "10"
},
"payload": {
"aps": {
"alert": {
"title": "TEST",
"body": "this is a test",
"launch-image": ""
},
"badge": 1,
"sound": "",
"data": {}
}
},
"fcm_options": {
"analytics_label": "activitreeSomething"
}
},
"webpush": {
"headers": {
"Urgency": "high",
"TTL": "3600000"
},
"data": {},
"notification": {
"title": "TEST",
"body": "this is a test"
},
"fcm_options": {}
}