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

Parse Platform #208

Closed
millette opened this issue Feb 23, 2020 · 8 comments · Fixed by #212
Closed

Parse Platform #208

millette opened this issue Feb 23, 2020 · 8 comments · Fixed by #212
Labels
blocked Blocked due to missing information and/or an issue outside of this project. enhancement

Comments

@millette
Copy link

📢 What is the name of the service?

Parse Platform

🔗 Provide some details about the service that can help with it's development.

@caronc
Copy link
Owner

caronc commented Feb 26, 2020

Thanks for creating this suggestion. I had a look here and it looks like this just wraps Apple (APNS) and Android (FCM. So it's not just as simple and passing in a title and a body.

The security keys alone needed to be generated (and attached to the Apprise URL) would make it rather tidious and un-useable..

However the other ticket you created looks like it should be do-able. So thank you for sharing that!

Before I close this ticket off (for Parse Platform), do you agree or disagree with my comments above? Perhaps I'm overlooking something and it's much easier then I think?

Chris

@millette
Copy link
Author

In all honesty, I'm not that familiar with either platforms, but they were mentionned in an f-droid/joplin discussion.

@dplewis probably has a better idea.

@millette
Copy link
Author

millette commented Mar 2, 2020

@caronc I believe we can close this issue, unless you want to give @dplewis more time to respond.

@dplewis
Copy link

dplewis commented Mar 2, 2020

Sorry for the late reply. You are correct, we use a wrapper around both services. This allows us to use a title, alert, and deviceToken or query to send push notifications.

I'm not familiar with apprise to offer more feedback. I am interested however.

We could turn the following into a URL

curl -X POST \
  -H "X-Parse-Application-Id: you_app_id" \
  -H "X-Parse-Master-Key: your_master_key" \
  -H "Content-Type: application/json" \
  -d '{
        "where": {
          "deviceType": {
            "$in": [
              "ios",
              "android"
            ]
          }
        },
        "data": {
          "title": "The Shining",
          "alert": "All work and no play makes Jack a dull boy."
        }
      }'\   http://your_server_address/parse/push

You can view our adapter here

@caronc
Copy link
Owner

caronc commented Mar 3, 2020

Thanks for your feedback; i guess i'll need to investigate more 🙂 . Your adapter/application looks great.

Apprise has it's limitations as since it's configuration is based on a URL (all inline) Firebase/IOS based ones could get really long. But if you're managing the credentials to these online services within your own (Parse) platform and the only thing you need is the masterkey and app id to interface with, then the Apprise URL might just have to look like:

  • parsep://{app_id}:{master_key}@{your_server}/ios
  • parsep://{app_id}:{master_key}@{your_server}/android
  • parsep://{app_id}:{master_key}@{your_server} (defaults to both ios and android as per your example).

Under the hood i guess i just need to construct the URL you've identified to add support? Does that sound about right?

I don't have a Firebase/IOS hookup, so if i do implement this, would one of you kindly be able to test it out for me? I'd certainly share the instructions as to how.

@dplewis
Copy link

dplewis commented Mar 4, 2020

I'll gladly help you test this out. Let me know what I can do

@caronc
Copy link
Owner

caronc commented Mar 16, 2020

I think I nailed it provided your example URL is all I need to do! 🙂

The Apprise URL looks similar to what was discussed above (altered just slightly).

  • parsep://{app_id}:{master_key}@{hostname}
  • parseps://{app_id}:{master_key}@{hostname}

Note: parsep:// is for insecure (http://) where as parseps:// is for secure (https://) connections.

By default, it will notify both the ios and android configuration you have set up with the Parse Platform Setup. If you wish to override this and only notify one, you can use the device directive:

  • parsep://{app_id}:{master_key}@{hostname}?device=android
  • parsep://{app_id}:{master_key}@{hostname}?device=ios

There is no need to specify /parse/push in the pparse:// URL's as it is implied.


So basically to test this out, you kind of need to install the Apprise package. But you could always do it in a mock environment:

# clone repo
git clone git@github.com:caronc/apprise.git

# Change into it:
cd apprise

# Change to the branch
git checkout 208-parse-platform-support

# Install Virtual Environment (so you don't need to hurt your global environment)
python -m venv .
source ./bin/activate

# Now you should be able to safely install Apprise (it will just go into the very
# virtual environment you prepared)
pip install -r requirements
python setup.py install

At this point you can use configuration files to make life easy, or just test it right from the command line. With respect to the example shared above, you'd just write:

apprise -t 'Test Title' -b 'Test Body' \
   parsep://your_app_id:your_master_key@your_server_address

@caronc caronc added the blocked Blocked due to missing information and/or an issue outside of this project. label Apr 14, 2020
@caronc
Copy link
Owner

caronc commented Jul 23, 2020

I just wanted to ping this ticket to see if anyone could test this for me (that already has a Parse Platform setup); instructions are in my previous comments. If all works, then I'll merge this into the master to be pushed with next major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked due to missing information and/or an issue outside of this project. enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants