Parse server 2.2.4 on Elastic Beanstalk
My Server code:
var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'myAppId',
masterKey: process.env.MASTER_KEY || '',
serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse',
liveQuery: {
classNames: ["Mission"]
},
filesAdapter: new S3Adapter(
process.env.S3_ACCESS_KEY || '',
process.env.S3_SECRET_KEY || '',
process.env.S3_BUCKET || '',
{directAccess: true}
),
push: {
ios: {
pfx: 'certificates/development.p12',
bundleId: 'co.example.myApp',
production: false // Dev
}
}
});
Tried to send a push notification both through CURL and cloud code:
var installationQuery = new Parse.Query(Parse.Installation);
installationQuery.containedIn('user', specificUser);
Parse.Push.send({
where: installationQuery,
data: {
"alert": "Loren ipsum ",
"id": MyCustomId
}
}, { useMasterKey: true }, {
success: function() {
console.log("Push was successful!");
},
error: function(error) {
console.error(error);
}
});
parse-server-push-adapter APNS cannot find vaild connection for 9a86...21
(The error repeats for every installation device token.)
please look through all other issues related to push notifications, particularly on https://github.com/parse-server-modules/parse-server-push-adapter as this seem to be a problem in your configuration.
Hi @flovilmart - I've looked through all issues, doubled checked my configuration - I'm still stuck in this problem.
Any other ideas or directions?
try with a production certificate.
Thanks a lot @flovilmart. Worked with production certificate. Revoked and generated a new development profile and it worked as well.
^ +1
I have this error shown but push actually works. What does it mean?
^ +1 @sidan5
It means 脿 that for a given deviceToken/bundleId pair, the connection to APNS is unable to deliver the notification.
That can be caused by a number of reasons, like sending a notification to a deviceToken acquired by the wrong environment (prod vs dev) etc...
@flovilmart - in my case I receive an error, but the push actually does reach my device
Actually - I've been pushing to a channel - and I bet one of the devices is not prod, so it throws an error. I'll go ahead and clear my device list and see if that helps.
@profjared Did clearing the device list solve the issue for you? I'm also receiving the error; even though push notifications are working...
@jch-duran i believe it did - but it was a long ago and unfortunately don't remember
@profjared It did for me as well! Thanks!