Coder Social home page Coder Social logo

spontit / spontit-api-python-wrapper Goto Github PK

View Code? Open in Web Editor NEW
33.0 4.0 2.0 9.96 MB

Send functional, flexible push notifications to iOS, Android, and desktop devices (without your own app or website).

License: MIT License

Python 99.91% Shell 0.09%
push-notifications push-api push notifications notificationserv notification pusher alerting pushover spontit

spontit-api-python-wrapper's Introduction

SPONTIT ๐Ÿ“ณ

Check out our complete API documentation at api.spontit.com. Our API repository is available here.

Send push notifications without your own app. ๐Ÿ‘Š

Using the Spontit API and Spontit app/webapp, you can send your own push notifications programmatically to Android, iOS, and Desktop devices. You can send your own in less than 5 minutes. ๐Ÿ˜Ž ๐Ÿ† (Without touching Swift, Objective-C, Java, XCode, Android Studio, the App Store approval process... ๐Ÿ˜ต).

This repository is the Python wrapper for our API. To see code snippets for several languages, see our documentation here.

RAPID START ๐Ÿƒ

Spontit is 100% free! Please star the repo and rate/review the Spontit app in the App Store as well. Please invite a friend or two to Spontit!

  1. Sign up at spontit.com (you might need to click "Take me to the Desktop version"). Note down your username. It should be displayed on your profile once you are signed in.

  2. Get a secret key at spontit.com/secret_keys.

  3. Get the iPhone app or Android app. Sign in with the same account and allow notifications. See Step 11 to invite others.

  4. pip install spontit --upgrade && pip install requests

  5. from spontit import SpontitResource

  6. resource = SpontitResource(my_username, my_secret_key)

  7. response = resource.push("Hello!")

  8. Run the command help(SpontitResource) in Python for complete documentation.

  9. Or try an example! Check out the examples.

  10. You can customize the image of the notification on the website, iPhone app, or via the API by setting the image for the respective channel. See the image example titled create_new_channel_with_profile_image_and_push_to_it in the examples.

  11. To push to others, you can do two things.
    a) Have them sign up with a known email or phone number. Then push to them directly using their email or phone number. They do not have to follow you in order to receive the push. See simple_push_to_specific_phone_numbers_and_emails_example for an example (in the examples file).
    b) Have them follow the channel to which you will push (e.g. share spontit.com/my_username). You can see available invite options by calling print(resource.get_channel(...)) and supply the channel name. See the functions titled create_new_channel_and_get_invite_options and get_invite_options_for_my_main_account in the examples.

  12. Spontit is more than just broadcasting. You can send pushes to specific users and push personalized content. See how to do so at simple_push_to_specific_followers_example, simple_push_to_specific_phone_numbers_and_emails_example, and specific_followers_and_channel_example in the examples. You simply input a list of usernames and it will push to those users (provided they follow the specified channel) -- or input a list of phone numbers and emails (they do not have to follow the given channel; see part 11(a)). You can list the usernames of those who follow one of your specified channels. See an example of how to do so at list_followers_example and list_followers_for_channel_example in the examples.

  13. We are constantly working on expanding the functionality of Spontit. We GREATLY appreciate your input - feel free to add a feature request on our Github. ๐Ÿ˜ƒ

Getting Started โœ…

Make an Account

First, go to spontit.com or download the Spontit app. Create an account and get your user ID. To see your user ID in the app, tap the "Profile" tab. To see your user ID on the website, look at the top of the screen.

You can change your user ID at any time here.

Generate a Secret Key

Once you have made an account, generate a secret key here. You might have to re-authenticate.

Push Notification UI Anatomy

You can change your user ID and display name at any time here.

Above we see a push notification sent to the main channel. Here, "Josh Wolff" is the display name of the user. The push message is the displayed text. The image shown is the personal profile picture of the user (see step 10 above). If the user opens the notification, they can open a link attached, if any, among other options (help(SpontitResource)). If they have an iPhone, they can like and comment on the notification.

Above we see a push notification to a channel (separate from the main channel). Josh owns this channel, but as you can see, it looks like its own account. "Dem 2020 Polls" is the channel name, the non-bold text is the message, and the image is the image set for the channel (see step 10 above). You can also change the push title with the pushTitle attribute.

Note on Our Development Priorities

We prioritize development of the iOS application over the website. If at any time, we describe a feature and it does not seem to be on the website, it might only exist in the iOS application. Please email us at info {at} spontit {dot} com so that we can clarify this to you and other developers. You are more than welcome to add a feature request.

spontit-api-python-wrapper's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

spontit-api-python-wrapper's Issues

White page on android App

Hi,

I know Spontit is focused on iOS but I just wanted to inform that on Android, App only displays a white page.
It seems app tries to reach www.spontit.me and does not follow the redirection to spontit.com.

Thanks again !

Fix badge count

Badge count not properly updating. Need to rewrite infrastructure for larger load

[Feature Request] Allow us to add x-callback-urls

I was going to use that service for Apple's Shortcuts app. But it seems doesn't support the x-callback-urls.

>>> resource.push("simple notification", link="shortcuts://gallery") {'Error': 'The URL you entered is not valid.'}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.