Socket
Socket
Sign inDemoInstall

apns2-client

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    apns2-client

apns2-client is a python package designed for simple, flexible and fast Apple Push Notifications on iOS, OSX and Safari using the new HTTP/2 Push provider API.


Maintainers
1

Readme

apns2-client

apns2-client is a python package designed for simple, flexible and fast Apple Push Notifications on iOS, OSX and Safari using the new HTTP/2 Push provider API.

Creation of this package was inspired by @sideshow's apns2 golang package.

Features

  • Uses new Apple APNs HTTP/2 connection
  • Supports new iOS 10 features such as Collapse IDs, Subtitles and Mutable Notifications
  • Supports persistent connections to APNs

Cautions

  • Works only with Python 3.5 and later

Install

  • Make sure you have pip installed.

  • Install apns2-client:

    pip install apns2-client
    

Example

import apns2


cli = apns2.APNSClient(mode="dev", client_cert="/your/path.pem")
alert = apns2.PayloadAlert(body="body!", title="title!")
payload = apns2.Payload(alert=alert)
n = apns2.Notification(payload=payload, priority=apns2.PRIORITY_LOW)
response = cli.push(n=n, device_token="your_token")
assert response.status_code == 200, response.reason
assert response.apns_id

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc