Skip to content

request.installationId not set #325

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

Closed
steven-supersolid opened this issue Feb 9, 2016 · 3 comments
Closed

request.installationId not set #325

steven-supersolid opened this issue Feb 9, 2016 · 3 comments

Comments

@steven-supersolid
Copy link
Contributor

It seems installationId is not available in the request object in Cloud Code.

Example code:
Parse.Cloud.define('GetInstallationId', function(request, response) { response.success('installationId ' + request.installationId); });

Calling locally using parse-server:
curl \ -H "X-Parse-Application-Id: XXX" \ -H "X-Parse-Installation-Id: a" \ -H "Content-Type: application/json" \ -d '{}' \ http://localhost:1337/parse/functions/GetInstallationId

{"result":"installationId undefined"}

Calling on parse.com:
curl \ -H "X-Parse-Application-Id: XXX" \ -H "X-Parse-REST-API-Key: YYY" \ -H "X-Parse-Installation-Id: a" \ -H "Content-Type: application/json" \ -d '{}' \ https://api.parse.com/1/functions/GetInstallationId

{"result":"installationId a"}

@steven-supersolid
Copy link
Contributor Author

I think this could be fixed in functions.handleCloudFunction(req)

  var request = {
    params: req.body || {},
    master: req.auth && req.auth.isMaster,
    user: req.auth && req.auth.user,
    installationId: req.info.installationId
  };

Will try and test once my setup is complete.

@steven-supersolid
Copy link
Contributor Author

PR #338

@gfosco
Copy link
Contributor

gfosco commented Feb 26, 2016

Merged 238. 👍

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

2 participants