parse-community / parse-server-push-adapter

A push notification adapter for Parse Server
https://parseplatform.org
MIT License
87 stars 99 forks source link

Can not find sender for push type android/ios #16

Closed riccardoch closed 8 years ago

riccardoch commented 8 years ago

This is my Server configuration:

var api = new ParseServer({
  serverURL: process.env.PARSE_SERVER_URL || 'http://localhost:1337/parse', // $
  databaseURI: process.env.PARSE_SERVER_DATABASE_URL || 'mongodb://localhost:27017/dev',
  cloud: process.env.PARSE_SERVER_CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.PARSE_SERVER_APPLICATION_ID || 'myAppId',
  masterKey: process.env.PARSE_SERVER_MASTER_KEY || '' //Add your master key here. Keep it secret!
  javascriptKey: process.env.PARSE_SERVER_JAVASCRIPT_KEY,
  restAPIKey: process.env.PARSE_SERVER_REST_API_KEY,
  dotNetKey: process.env.PARSE_SERVER_DOTNET_KEY,
  clientKey: process.env.PARSE_SERVER_CLIENT_KEY,

  push: {
    android: {
        senderId: process.env.PARSE_ANDROID_SENDERID,
        apiKey: process.env.PARSE_ANDROID_APIKEY
      },

    ios: [
      {
        pfx: process.env.PARSE_IOS_DEV_CERT,
        bundleId: process.env.PARSE_IOS_BUNDLEID,
        production:false // Dev
      },
      {
        pfx: process.env.PARSE_IOS_PROD_CERT,
        bundleId: process.env.PARSE_IOS_BUNDLEID,
        production:true // Prod
      }
    ]
  }

});

Push doesn't work, both on iOS and Android (with parse-server-example everything works with the same configuration).

This is the log:

verbose: sending push to 6 installations
verb parse-server-push-adapter Can not find sender for push type ios, [object Object]
verb parse-server-push-adapter Can not find sender for push type android, [object Object]
verbose: sent push! 0 success, 0 failures 
mymanga commented 8 years ago

Same here

riccardoch commented 8 years ago

@flovilmart Can you help us?

natanrolnik commented 8 years ago

@riccardoch I see that you have pax instead of pfx in the first object of the ios array. Shouldn't it be pfx?

riccardoch commented 8 years ago

@natanrolnik yes, I've written wrong in my post, but in my parse server is correct

riccardoch commented 8 years ago

As I written in my first post, everything works fine in parse-server-example (which is not already updated to the last version of parse-server), but not with parse-server

The problem seems related to push Adapter and not with certificates or other push parameters. I've seen that the push Adapter has been removed from one of the latest versions of parse-server and it's a separate package

riccardoch commented 8 years ago

Problem solved. I've configured Parse Server with environment variables (named as suggested in the Wiki page) and started the server through parse-server command (in this case the index.js is not used) and not with npm run start (as the parse-server-example)