Push query result invalid , still push status is true.

9 views
Skip to first unread message

Tanzim Islam

unread,
Jun 9, 2020, 2:38:38 PM6/9/20
to Back4App
So I found this to be really weird.
I was writing a query for the installation class in my cloud code.

Parse.Cloud.define("newPush", async (request) => {
var query = new Parse.Query(Parse.Installation);
query.equalTo('username', "t...@g.com");

return Parse.Push.send({
        where: query,
        data: {
            title: "Hello from the Cloud Code",
            alert: "Back4App rocks!",
        }
    }, { useMasterKey: true });
});
});

No installation object exists with that username , yet when I call this code from postman , I get this.

{
    "result": {
        "result"true
    }
}

And when I went to the dashboard I got this

temp.JPG



As you can see Pushes send is 0 which makes sense but the status is "SENT" This is super confusing don't you think ?? If the query is invalid the push status should return failed or something as the push never went out ???

Charles Ramos

unread,
Jun 9, 2020, 8:51:59 PM6/9/20
to Back4App
Hi!

Usually, it happens when the installation is not being created properly.

Here are the required fields for each platform:

For android devices, the fields "GCMSenderId" and "DeviceToken".

For iOS devices, the fields "AppIdentifier" and "DeviceToken"

These fields are filled automatically when the user installs the app.

In case they are being filled, please, make sure that you are following all the steps of our guides and send me your app ID and we'll check if there's anything on our end that can help you to solve it.

We are moving the community to slack, feel free to join it and talk with us from there, here's the link: https://join.slack.com/t/back4appcommunity/shared_invite/zt-f2cenxgh-X31MHehznTGnZc1wxwTmVw

Regards,
Charles Ramos
Reply all
Reply to author
Forward
0 new messages