Skip to content

Sending Push Notifications - Master key is invalid #575

Closed
@adamofsky

Description

@adamofsky

I get Exception : "Master key is invalid, you should only use master key to send push"
I don't understand where i supposed to enter the master key
In Android :
androidQuery.whereEqualTo("deviceType", "android");
ParsePush androidPush = new ParsePush();
androidPush.setQuery(androidQuery);
androidPush.setData(androidData);
Log.i("androidData=", androidData + "");
Log.i("LOG", "Sending Android");
androidPush.sendInBackground(new SendCallback() {

                        @Override
                        public void done(ParseException e) {
                            if (e == null) {

IOS:
PFPush *androidPush = [[PFPush alloc] init];
[androidPush setQuery:androidQuery];
[androidPush setData:androidData];
NSLog(@"Sending Android Data");
[androidPush sendPushInBackgroundWithBlock:^(BOOL succeeded, NSError *error){
if (succeeded) {

My Server Settings:
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,
push: {
android: {
senderId: '12345678',
apiKey: 'My apikey'
},
ios: [
{
pfx: '/cer/developmentcertificate.p12',
bundleId: 'bundleId',
production: false // Dev
},
{
pfx: '/cer/distributioncertificate.p12',
bundleId: 'bundleId',
production: true // Prod
}
]
}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions