-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
add env variables to the push adapter? #949
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
Comments
you can configure with a PARSE_SERVER_PUSH or --push in the JSON: { then JSON.stringify(pushOptions) |
@flovilmart Thanks , so if understand correctly in my ecosystem.json file I can set this full string in the PARSE_SERVER_PUSH="" ? |
That should work :) Let me know. BE careful with the path to the pushAdapter, this is tricky. The adapterLoader is in Adapter, so it should work passing: '{"module": "./Push/OneSignalPushAdapter", "options": {}}'
|
how do you write it in PUSH_SERVER_PUSH, I amalso not using index.js and I need to use this env var in my ecosystem but the parse is ignoring it so when I am trying to send Push it tells me It cannot find a sender... |
PARSE_SERVER_PUSH is an environment variable, just set it to the stringified JSON |
I did this and it doesnt work "PARSE_SERVER_PUSH": "'ios': [ { 'pfx': '/home/parse/dev_cert.p12', 'bundleId': 'SomeID', 'production': false },{ 'pfx': '/home/parse/production_cert.p12', 'bundleId': 'SomeID', 'production': true }]" |
The value you just set is not a valid JSON, |
it doesnt work too, parse is ignoring the PARSE_SERVER_PUSH |
Your configuration is malformed!
|
it doesnt work for me.... it keeps telling me in log that it cant find sender for push type..... I tried that on parse 2.1.4 and now on 2.1.6... |
Try to do it in a development environment, without pm2, I'm not familiar with pm2. but I can tell you that it works when properly setting environment variables. and running directly from command line |
@KudosGuy did you have any luck with this? Trying both OneSignal and the default with little success. |
no, I tried like 10 times to start the server with parse-server jsonconfig.json or npm start parse-server and many more and nothing worked, I would report it as a bug and maybe we can get more attention to this, but if you will install parse-server-example you will have the index.js and it is working there, but i really dont know why they are these two versions... |
I can confirm PARSE_SERVER_PUSH certainly does work. I got it to select the adapter ( OneSignal ) but struggling to pass the variables through. But i'm giving it a bash now. |
@Cliffordwh could you show me the syntax you used for PARSE_SERVER_PUSH? |
Options tho, doesn't seem to work for me. I'm getting Trying to initialize OneSignalPushAdapter without oneSignalAppId or oneSignalApiKey
|
I got it running that I hardcoded it in /usr/lib/node_modules/parse-server/lib/cli/cli-definitions.js
} |
Glad you got it working. I ended up coding in env's variables for the options too. |
Guys, this is not how it should be configured |
@flovilmart could you extend your response why? because for me it is the only solution for now... becasue when I add in my ecosystem.json PARSE_SERVER_PUSH it is never initialized, I can see that in log... but with my solution in cli-definitions.js it loads it on startup fine... |
Because the cli-definitions files is not supposed to be edited, as this file will be updated with npm when you update parse-server. There is either a bug when parsing/loading that environment variable, or, you're not providing a valid JSON or any other reason that make it fail. Locally, I can properly load the oneSignal adapter with that method. |
@flovilmart i agree. I've done so, but can you pass the options through? |
I just tested again and For the one signal push adapter, the correct JSON would be:
At that point, I'm not sure if pm2 parses or dumps the JSON a strings,
should work as expected, if it doesn't, try with enclosing the JSON with single quotes |
@flovilmart Thanks, i see it doesn't use "options". Makes sense now. |
@Cliffordwh this is actually a bug in the adapter loader that don't pass the .options for the push as it's been originally structured differently than other adapter options. Does it work with the basic options? |
fyi... you were right it didnt work becasue of the pm2, even though I reloaded and restarted the parse server via pm2 command it didnt load the new file config but some cached version so It never initialized the push so the PARSE_SERVER_PUSH works good, my mistake |
Hi Guys
Is is possible to add ENV variables to the push adapter? (Like we have just done for the S3 adapter in version 2.1.5)
or is this already available? PARSE_SERVER_PUSH?
Trying to set it in a json config with little success. Im not using the parse-server-example so i don't make use of a index.js initializer.
Making use of the oneSignalPushAdapter.
The text was updated successfully, but these errors were encountered: