Skip to content

Received an error with invalid JSON from Parse: Cannot POST /push\n Error code 107 #1335

Closed
@hafizapp

Description

@hafizapp

Check out this issue for an ideal bug report. The closer your issue report is to that one, the more likely we are to be able to help, and the more likely we will be to fix the issue quickly!

For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Environment Setup

Every thing okay, except push notification.

Steps to reproduce

screen shot 2016-04-02 at 3 43 00 pm

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({
                query: 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
        });
});

index.js -->

var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || '',
masterKey: process.env.MASTER_KEY || '', 
serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse',

push: {
android: {
senderId: 'my id',
apiKey: 'my apiKey'
},

ios: [{
pfx: '/push/Certificates_Dev.p12', // Dev PFX or P12
bundleId: 'my_bundle_id',
production: false // Dev
},
{
pfx: '/push/Certificates_Prod.p12', // prod PFX or P12
bundleId: 'my_bundle_id',
production: true // Prod
}]
}
});

Logs/Trace

Please help...

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