Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not initializing correctly #21

Open
jcguarinpenaranda opened this issue Aug 17, 2016 · 0 comments
Open

Not initializing correctly #21

jcguarinpenaranda opened this issue Aug 17, 2016 · 0 comments

Comments

@jcguarinpenaranda
Copy link

Hello,

I am trying to use your package but it tells me "Trying to initialize OneSignalPushAdapter without oneSignalAppId or oneSignalApiKey"

I copied and pasted the example shown at the README.md.

That said, I have been trying to debug the package putting a console.log() when it initializes.

Here is what I am doing:

var OneSignalPushAdapter = exports.OneSignalPushAdapter = function () {
  function OneSignalPushAdapter() {
    var pushConfig = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

    // I am adding this line
    console.log("pushConfig", pushConfig) 

    //.....

Now, I am testing the code like this:

var OneSignalPushAdapter = require('parse-server-onesignal-push-adapter');

var oneSignalPushAdapter = new OneSignalPushAdapter({
  oneSignalApiKey: "123",
  oneSignalAppId: "123"
});

When this piece of code executes, I see in the console that OneSignalPushAdapter tries to be initialized 3 times. (i don't know why)

The console.log result i am getting is:

pushConfig { oneSignalApiKey: '123', oneSignalAppId: '123' }
pushConfig { adapter: [Function: OneSignalPushAdapter] }
pushConfig { adapter: [Function: OneSignalPushAdapter] }

/home/jcguarinpenaranda/workspace/myapp/node_modules/parse-server-onesignal-push-adapter/lib/OneSignalPushAdapter.js:41
      throw "Trying to initialize OneSignalPushAdapter without oneSignalAppId or oneSignalApiKey";
      ^
Trying to initialize OneSignalPushAdapter without oneSignalAppId or oneSignalApiKey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant