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
can you please format correctly your index.js configuration? It's impossible to see where your error is.... Also we have many users having a functional push setup.
I don't believe it will ever be enable as this is a very important security problem. Also, many users have worked around it by creating a cloud code function. Look through the issues, and other references, and you should be good to go.
Coming back to your issue, can we have a properly formatted index.js?
yes i have formatted it here it is
var api = new ParseServer({
databaseURI: databaseUri || 'mongodb',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID ||'',
masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret!
serverURL: process.env.SERVER_URL || 'http', // Don't forget to change to https if needed
in index,js we have to declare both push adapter , email adapter and server info(master key,app id,mongo db connection string) then the formateed code that have been provided in that where i would add push adapter
this was just an example, to show you how to properly format the code when you share it. Your shared file appear all flat, with multiple } on certain lines... I can't really say what's wrong in your configuration because it's just plain ugly and not readable
Activity
flovilmart commentedon Apr 6, 2016
What adapter are you using? Which devices are you sending to? Android, iOS? Can you get the _PushStatus object?
apurvaaggarwal commentedon Apr 6, 2016
I am using parse push adapter; sending to android devices
_PushStatus
{
"_id" : ObjectId("5704f607c87f874d22157520"),
"objectId" : "AJDiHp7HRu",
"pushTime" : "2016-04-06T11:41:59.478Z",
"_created_at" : ISODate("2016-04-06T11:41:59.478+0000"),
"query" : "{"objectId":"rJvrh1s0BH"}",
"payload" : {
"alert" : "4",
"sound" : "default"
},
"source" : "rest",
"title" : null,
"expiry" : null,
"status" : "succeeded",
"numSent" : NumberInt(0),
"pushHash" : "01538e1dfb45c0adc1c4bd63365cf403",
"_wperm" : [
}
flovilmart commentedon Apr 6, 2016
I'll have a look. what version of parse-server are you using?
apurvaaggarwal commentedon Apr 6, 2016
2.2.6
flovilmart commentedon Apr 6, 2016
thanks. It seems to be the parse-server-push-adapter that is not reporting correctly the statuses of the pushes.
flovilmart commentedon Apr 6, 2016
When running with VERBOSE=1, you should have that kind of logs:
Can you please provide them?
apurvaaggarwal commentedon Apr 6, 2016
verbose: POST /parse/push { 'user-agent': 'node-XMLHttpRequest, Parse/js1.8.1 (NodeJS 5.3.0)',
accept: '/',
'content-type': 'text/plain',
host: '166.62.82.202:1337',
'content-length': '278',
connection: 'close' } {
"where": {
"objectId": "KQPONXtIjb"
},
"data": {
"alert": "Hello",
"sound": "default"
}
}
verbose: {
"response": {
"result": true
}
}
success
verbose: {
"response": {
"result": "Push sent "
}
}
verbose: sending push to 1 installations
verbose: sent push! 0 success, 0 failures
i am getting this when i run using VERBOSE
flovilmart commentedon Apr 6, 2016
Seems to be a misconfiguration in parse-server-push adapter, how did you set it up?
apurvaaggarwal commentedon Apr 6, 2016
i have set it up in index.js using google project number and sender api key
flovilmart commentedon Apr 6, 2016
Would you care to show it?
apurvaaggarwal commentedon Apr 6, 2016
flovilmart commentedon Apr 6, 2016
what's the version of parse-server-push-adapter? in
node_modules/parse-server-push-adapter/package.jsonapurvaaggarwal commentedon Apr 6, 2016
1.0.4
apurvaaggarwal commentedon Apr 7, 2016
@estylehq elborate please
6 remaining items
apurvaaggarwal commentedon Apr 7, 2016
Updated index.js but the error is still same
flovilmart commentedon Apr 7, 2016
can you please format correctly your index.js configuration? It's impossible to see where your error is.... Also we have many users having a functional push setup.
apurvaaggarwal commentedon Apr 7, 2016
i have reformated the code of index.js and can you tell me that if want to send push to a specfic user using the object id of that users
flovilmart commentedon Apr 7, 2016
That question should be asked over stackoverlow, or any other forum. We're not here to provide support for your implementations.
apurvaaggarwal commentedon Apr 7, 2016
ok will the client push enable in future use
flovilmart commentedon Apr 7, 2016
I don't believe it will ever be enable as this is a very important security problem. Also, many users have worked around it by creating a cloud code function. Look through the issues, and other references, and you should be good to go.
Coming back to your issue, can we have a properly formatted index.js?
apurvaaggarwal commentedon Apr 7, 2016
yes i have formatted it here it is
var api = new ParseServer({
databaseURI: databaseUri || 'mongodb',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID ||'',
masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret!
serverURL: process.env.SERVER_URL || 'http', // Don't forget to change to https if needed
verifyUserEmails:true,
publicServerURL:'http:',
appName: 'Trakie',
emailAdapter:{
module: 'parse-server-simple-mailgun-adapter',
options:{
fromAddress:'@gmail.com',
domain:'.mailgun.org',
apiKey:'key-',}},
push: {
android: {
senderId:'',
apiKey:''
}
}
});
flovilmart commentedon Apr 7, 2016
this is not formatted....
formatted is:
apurvaaggarwal commentedon Apr 7, 2016
then what about push notification adapter
flovilmart commentedon Apr 7, 2016
what do you mean?
apurvaaggarwal commentedon Apr 7, 2016
in index,js we have to declare both push adapter , email adapter and server info(master key,app id,mongo db connection string) then the formateed code that have been provided in that where i would add push adapter
flovilmart commentedon Apr 7, 2016
this was just an example, to show you how to properly format the code when you share it. Your shared file appear all flat, with multiple } on certain lines... I can't really say what's wrong in your configuration because it's just plain ugly and not readable
apurvaaggarwal commentedon Apr 8, 2016
i have checked everything again but the problem is steill there
here is my main,js file
Parse.Cloud.define("sendPush2", function(request, response) {
var query = new Parse.Query(Parse.User);
query.equalTo("ObjectId", id);
useMasterKey:true,
success: function() {
// Push was successful
console.log("success");
response.success("Push sent ");
},
error: function(error) {
// Handle error
console.log("failed");
response.error(error);
}
});
flovilmart commentedon Apr 8, 2016
the query on push should be on Parse.Installation not on Parse.User... That's why you're not getting anything...