You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Master key is invalid, you should only use master key to send push #736
Activity
maruthi-wal commentedon Mar 1, 2016
Hello Everyone,
Iam getting Master key is invalid, you should only use master key to send push
Please find my cloud code below:
Parse.initialize("appid", "javascriptkey", "masterkey");
var pushQuery = new Parse.Query(Parse.Installation);
Parse.Push.send({
My index.js code
var api = new ParseServer({
databaseURI: databaseUri,
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID,
masterKey: process.env.MASTER_KEY,
clientKey: process.env.CLIENT_KEY,
restAPIKey: process.env.REST_API_KEY,
fileKey: process.env.FILE_KEY,
serverURL: 'http://IP/parse',
push: {
ios:
[
{
pfx: __dirname + '/name.p12', // Prod PFX or P12
bundleId: id',
production: false // Prod
},
{
pfx: __dirname + '/name.p12', // Prod PFX or P12
bundleId: 'id',
production: true // Prod
}
]
}
});
Please help me on this
Thanks,
flovilmart commentedon Mar 1, 2016
Did you set your master key in the environment before starting your server? with:
APP_ID=appid MASTER_KEY=masterKey node index.jsmaruthi-wal commentedon Mar 1, 2016
Yes.. Master key and App Id i given.. Please help me on this..
mithleshjs commentedon Mar 1, 2016
Pass the third argument as "true" to .send function.
maruthi-wal commentedon Mar 2, 2016
Its working for me. Thanks a lot for your suggestions.
My cloude code finally:
Parse.Push.send({
channels: ['Giants'],
data: {
alert: 'The Giants Mets 2-3.',
badge: 1,
sound: 'default'
}
}, {
success: function() {
console.log('##### PUSH OK');
},
error: function(error) {
console.log('##### PUSH ERROR');
},
useMasterKey: true
});
AlecKriebel commentedon Mar 2, 2016
@maruthi-wal Did you still have to call
Parse.initialize("appid", "javascriptkey", "masterkey");in the body of your cloud code function?If you did, did you just copied and pasted the keys in as strings?
maruthi-wal commentedon Mar 3, 2016
@AlecKriebel Thanks. Its working for me..
AlecKriebel commentedon Mar 3, 2016
@maruthi-wal It is not working for me. Did you still have the initialize call in your Cloud Code. I may need to add it to mine.
Thanks.
maruthi-wal commentedon Mar 3, 2016
@AlecKriebel Yep.. I added Parse.initialize("appid", "javascriptkey", "masterkey"); in my cloud code.
Make sure in index.js as below:
push: {
ios:
[
{
pfx: __dirname + '/name.p12', // Prod PFX or P12
bundleId: 'id',
production: false
}
]
}
Production should be false for testing.
mahabubakram commentedon Mar 4, 2016
{ params: { id: '45J1QIaKIi' },
master: false,
user: { _objCount: 0, className: '_User', id: '45J1QIaKIi' },
installationId: '82e1d517-7aac-d887-d02b-e407c3de5e7f' }
PUSH OK
APNS Connection 0 Socket Error
APNS Connection 0 Socket Error
APNS Connection 0 Socket Error
APNS Connection 0 Disconnected
APNS Connection 0 Socket Error
APNS Connection 0 Disconnected
APNS Connection 0 Socket Error
APNS Connection 0 Socket Error
APNS Connection 0 Disconnected
APNS Connection 0 Socket Error
APNS Connection 0 Socket Error
APNS Connection 0 Disconnected
APNS Connection 0 Socket Error
APNS Connection 0 Socket Error
APNS Connection 0 Disconnected
APNS Connection 0 Socket Error
APNS Connection 0 Socket Error
APNS Connection 0 Disconnected
APNS Connection 0 Socket Error
APNS Connection 0 Socket Error
APNS Connection 0 Disconnected
how to solve this problem when I send push it performs success but the it also shows these in the console.