Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR! parse-server-push-adapter GCM send errored: 401 #2074

Closed
alexanther1012 opened this issue Jun 15, 2016 · 5 comments
Closed

ERR! parse-server-push-adapter GCM send errored: 401 #2074

alexanther1012 opened this issue Jun 15, 2016 · 5 comments

Comments

@alexanther1012
Copy link

alexanther1012 commented Jun 15, 2016

I have the next problem, when I intend to send a push notification with parse server response:
captura
It is when I insert:
captura1

My code of configuration is:

var express = require('express');
var ParseServer = require('parse-server').ParseServer;

var app = express();

// Specify the connection string for your mongodb database
// and the location to your Parse cloud code
var api = new ParseServer
(
  {
    databaseURI: 'mongodb://localhost:27017/myapp',
    appId: 'tc',
    masterKey: 'master',
    clientKey: 'token',
    serverURL: 'http://localhost:1337/parse',
    push: 
    {
      android:
      {
        senderId: '1066279412344',
        apiKey: 'AIzaSyD2ysuFbFnNJNBwvILdemlxwf55q7yIHgI'
      }
    }
  }
);

// Serve the Parse API on the /parse URL prefix
app.use('/parse', api);

// Hello world
app.get('/', function(req, res) {
  res.status(200).send('Express is running here.');
});

var port = process.env.PORT || 1337;
app.listen(port, function() {
  console.log('Parse Server running on port ' + port + '.');
});
@kwstasna
Copy link

I have the same problem and i have tried these steps

  1. Change APIKEY
  2. Open PORTS in firewall 5228,5229,5230

The pushes are being sent to iOS phones normal.

@Silkjaer
Copy link

Make sure the API key is a server API key and wait 5 minutes from creating it to testing.

@pinguineras
Copy link

pinguineras commented Jun 21, 2016

I'm having the same problem with parse-server in aws.

The ports 522, 5229, 5230 are open, but im still getting error.

Im using the sample post, just with the difference of installationId of my APP:
curl -X POST \ -H "X-Parse-Application-Id: PARSE_APP_ID" \ -H "X-Parse-Master-Key: PARSE_MASTER_KEY" \ -H "Content-Type: application/json" \ -d '{ "where": { "installationId": "89cbbbe8-7115-4eb6-902b-c5e9fbb07cb5", "deviceType": { "$in": [ "android" ] } }, "data": { "title": "The Shining", "alert": "All work and no play makes Jack a dull boy." } }' \ http://PARSE_SERVER_URL/push

And the verbose response is:
`
verbose: POST /push { host: 'PARSE_SERVER_URL',
'user-agent': 'curl/7.47.0',
accept: '/',
'x-parse-application-id': PARSE_APP_ID,
'x-parse-master-key': PARSE_MASTER_KEY,
'content-type': 'application/json',
'content-length': '322' } {
"where": {
"installationId": "89cbbbe8-7115-4eb6-902b-c5e9fbb07cb5",
"deviceType": {
"$in": [
"ios",
"android"
]
}
},
"data": {
"title": "The Shining",
"alert": "All work and no play makes Jack a dull boy."
}
}

verbose: {
"headers": {
"X-Parse-Push-Status-Id": "nkTAXFhoEs"
},
"response": {
"result": true
}
}
verbose: sending push to 1 installations
verb parse-server-push-adapter GCM sending to 1 device
ERR! parse-server-push-adapter GCM send errored: {}
verbose: sent push! 0 success, 1 failures
`

The errored getting empty

@flovilmart
Copy link
Contributor

This issue is related to the parse-server-push-adapter, please open on the relevant repository.

@thailey01
Copy link

@Silkjaer You are a savior!!! I had been working on this for hours and couldn't figure out the problem! It was confusing that it was asking for an apikey and gcm gives you the option to make an Android apikey. I now realize that is used for upstream notifications!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@Silkjaer @flovilmart @pinguineras @alexanther1012 @thailey01 @kwstasna and others