parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

struggling with Push adapter -- parseError { code: 115, message: 'Missing push configuration' }

Open TheRyanHickman opened this issue 10 years ago • 4 comments

Not really sure why I continue to get the error, but I've found nothing to assist hence submitting the issue

The Setup

-- Server is running on elastic beanstalk -- Running Parse Server 2.2.12 -- I have enough memory and CPU so its not performance related (running 4x m4.xlarge) -- MLab database -- I am using the parse-server-onesignal-push-adapter v 1.0 -- My p12 files (prod and dev) work perfect on parse.com dashboard if I send push -- I've tried to do production-only cert and then dev-only cert, no luck -- Tried localhost, same error -- terminated the EB servers and launched new ones, same error -- started with a fresh clone of parse-server-example, same error

Dependencies

"dependencies": {
    "express": "~4.11.x",
    "kerberos": "~0.0.x",
    "mailgun-js": "0.7.10",
    "parse-server-onesignal-push-adapter": ">= 1.0.0",
    "parse": "~1.8.0",
    "parse-server": "~2.2.12"
  },

The configuration code

var OneSignalPushAdapter = require('parse-server-onesignal-push-adapter');
var pushConfig = {
  oneSignalAppId:"OMITTED,
  oneSignalApiKey:"OMITTED"
  };
var oneSignalPushAdapter = new OneSignalPushAdapter(pushConfig);


/*********************************************************************************/

const api                           = new ParseServer({
  databaseURI: 'mongodb://OMITTED.mlab.com',
  cloud:  __dirname + '/cloud/main.js',
  appId:  'OMITTED',
  masterKey: 'OMITTED', 
  fileKey:  'OMITTED',
  serverURL: 'http://parseserver-OMITTED.elasticbeanstalk.com/parse/',  
  push: {
   adapter: oneSignalPushAdapter,
   },
 appName: "OMITTED",
  publicServerURL: 'http://parseserver-OMITTED.elasticbeanstalk.com/parse/',
  verbose: true, 
  oauth: {
   twitter: {
     consumer_key: "OMITTED",
     consumer_secret: "OMITTED"
   },
   facebook: {
     appIds: "OMITTED"
   },
   emailAdapter: {
    module: 'parse-server-simple-mailgun-adapter',
    options: {
      fromAddress: 'OMITTED',
      domain: 'OMITTED',
     apiKey: 'OMITTED'
    }
  },
  */

}
});

The Cloud Code

var queryx = new Parse.Query(Parse.Installation);
queryx.equalTo('appVersion',  "36");

                                           Parse.Push.send({
                                            where: queryx, 
                                            data: {
                                               alert: "Just Testing",
                                               sound: "default"
                                            }
                                                }, { 
                                                  useMasterKey: true,
                                                  success: function(e) { 

                                                    console.log(e)
                                                    console.log("win")


                                                }, error: function(err) { 

                                                  console.log(err)

                                                }
                                          });

The Error

ParseError { code: 115, message: 'Missing push configuration' }

TheRyanHickman avatar Jul 02 '16 02:07 TheRyanHickman

Found issue. was a misplaced closure } bummer.

TheRyanHickman avatar Jul 03 '16 02:07 TheRyanHickman

Where was the misplaced closure as I'm having the same problem.

ryryan avatar Aug 04 '16 15:08 ryryan

@ryhart18 paste your config and I can take a look. Im a good 12 migrations so far and at this point things are flying high!

TheRyanHickman avatar Aug 11 '16 18:08 TheRyanHickman

i have the same error code. @TheRyanHickman If you have a solution for me that would be great. I am hosting via AWS on the Bitnami Parse API. I edit this in server.js in /apps/parse/htdocs

express = require('express');
var ParseServer = require('parse-server').ParseServer;
var app = express();
// Specify the connection string for your mongodb database
// and the location to your Parse cloud code 
var api = new ParseServer({
    databaseURI: "mongodb://root:XXXXXXXXXXXXXX7/bitnami_parse",
    cloud: "./node_modules/parse-server/lib/cloud-code/Parse.Cloud.js",
    appId: "1XXXXXXXXXXXd",
    masterKey: "eXXXXXXXXXXXXXX8",
    fileKey: "8XXXXXXXXXXXX0",
    serverURL: "http://1XXXXXXXXXXX0/parse",
push: {
      android: {
        senderId: '',
        apiKey: ''
      },
      ios: {
        pfx: '/home/bitnami/pushNotificationStudyPlay.p12',
        passphrase: '', // optional password to your p12/PFX
        bundleId: 'StudXXXXXXXXlay',
        production: false
      }
    }
});
// Serve the Parse API on the /parse URL prefix
app.use('/parse', api);

var port = 1337;
app.listen(port, function() {
    console.log('parse-server running on port ' + port);
});

//Parse Dashboard
var ParseDashboard = require('parse-dashboard');
var dashboard = new ParseDashboard({
    apps: [
        {
            appName: "My Bitnami Parse API",
            appId: "1XXXXXXXXXXXXXd",
            masterKey: "eXXXXXXXXXXXXXXX8",
            fileKey: "8XXXXXXXXXXXXX0",
            production: true,
            serverURL: "http://1XXXXXXXXX0/parse"
        }
    ],
    users: [
        {
            user: "AXXXXXXXn",
            pass: "$2XXXXXXXXXXXXXXXXC"
        }
    ], useEncryptedPasswords: true
});

var allowInsecureHTTP = true;

// Serve the Parse Dashboard on the /parsedashboard URL prefix
app.use('/', dashboard);

var portdash = 4XX0;
app.listen(portdash, function() {
    console.log('parse-dashboard running on port ' + portdash);
});

Thanks al lot.

Arthur-der-Coder avatar Nov 17 '19 18:11 Arthur-der-Coder