Hi,
I’m using Modulus to host an app that uses the raix:push package to send push notifications to Android and IPhone.
After sending a test message in the browser console using
Push.send({
from: 'Test',
title: 'Hello',
text: 'World',
badge: 1,
query: {}
});
The app successfully sends the message to the connected Android phone and then crashes before successfully sending to the connected IPhone 6. The following message is displayed in the server logs:
Push: Send message "Hello" via query {}
send to token { apn: 'XXXXXXXXXXXXXXX' }
send to token { gcm: 'XXXXXXXXXXXXXXX' }
sendGCM [ 'XXXXXXXXXXX' ] { _id: XXXXXXXXXXX',
createdAt: Mon Oct 12 2015 16:09:35 GMT+0000 (UTC),
createdBy: 's5ChTPWBYsmuXWX9b',
from: 'Test',
title: 'Hello',
text: 'World',
badge: 1,
query: {} }
Create GCM Sender using "XXXXXXXXXXX"
A:Send message to: XXXXXXXXXXXXXX
Push: Sent message "Hello" to 1 ios apps 1 android apps
ANDROID: Result of sender: {"multicast_id":6731539663436230000,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1444666183074808%b9fbd54e0027b8b2"}]}
npm ERR! meteor-dev-bundle@0.0.0 start: `node ../../main`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the meteor-dev-bundle@0.0.0 start script.
npm ERR! This is most likely a problem with the meteor-dev-bundle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ../../main
npm ERR! You can get their info via:
npm ERR! npm owner ls meteor-dev-bundle
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-46-generic
npm ERR! command "/mnt/home/.nvm/v0.10.40/bin/node" "/mnt/home/.nvm/v0.10.40/bin/npm" "start"
npm ERR! cwd /mnt/app/programs/server
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm
ERR!
npm
ERR!
Additional logging details can be found in:
npm
ERR!
/mnt/app/programs/server/npm-debug.log
npm
ERR!
not ok
code 0
This has only started happening since and Iphone has been connected prior to that the app was sending push messages without crashing. The app receives the token for both Iphone and Android when they connect.
My config.push.json is in the project root and looks like this:
{
"gcm": {
"apiKey": "XXXXXXX",
"projectNumber": "XXXXXX"
},
"apn": {
"passphrase": "XXXXXXXX",
"key": "XXXXXX.pem",
"cert": "XXXXXXX.pem",
"gateway": "XXXXXXX.com"
},
"apn-dev": {
"passphrase": "XXXXXXXXXX",
"cert": "XXXXXXXXX",
"key": "XXXXXXXXXXX",
"gateway": "XXXXXXXXXX"
},
"production": false
// "badge": true,
// "sound": true,
// "alert": true,
// "vibrate": true
}
I have successfully verified my keys with Apple.
I’ve been unable to find any issues related to this either on SO or in the issues for this package on Github. However I’m doubtful it’s a bug in the package so I’m posting here before I raise it as an issue on Github. The project is quite large so it’s not feasible to post the code but hopefully this is enough to at least give me a few possibilities to look into.
Many thanks