Skip to content

showing push error #1394

Closed
Closed
@apurvaaggarwal

Description

@apurvaaggarwal

Android Code:
final Map<String, Object> params = new HashMap<>();
params.put("message", message);
params.put("userId", ParseUser.getCurrentUser().getObjectId());

ParseCloud.callFunctionInBackground("sendPush", params,
        new FunctionCallback<String>() {
            @Override
            public void done(String result, com.parse.ParseException e) {
                // TODO Auto-generated method stub

                if (e == null) {
                    Toast.makeText(context, "HEHE", Toast.LENGTH_SHORT)
                            .show();
                    Log.d("ANNOUNCEMENT", "SUCCESS");
                } else {
                    Toast.makeText(context, "FAilure " + e.toString(),
                            Toast.LENGTH_SHORT).show();

                    Log.d("ANNOUNCEMENT", "FAILURE" + e.toString());
                }
            }
        });

///////////////////////////////////////////////
main.js
Parse.Cloud.define("sendPush", function(request, response) {

var sendUserId = request.params.userId;
var msg = request.params.message;

var query = new Parse.Query(Parse.Installation);
query.equalTo('userId', sendUserId);

Parse.Push.send({
        where: query,
        data: {
                alert: msg,
                sound: 'default'
        }
}, {
        success: function() {
                // Push was successful
                response.success("Push sent");
        },
        error: function(error) {
                // Handle error
                response.error(error);
        },
        useMasterKey: true
});

});
But not getting push
Here is the verbose //////
verbose: sending push to 1 installations
verbose: sent push! 0 success, 0 failures

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