All Projects → Fatal1ty → aioapns

Fatal1ty / aioapns

Licence: Apache-2.0 license
An efficient APNs Client Library for Python/asyncio

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to aioapns

Pushy
A Java library for sending APNs (iOS/macOS/Safari) push notifications
Stars: ✭ 1,353 (+2155%)
Mutual labels:  push-notifications, apns
Django Push Notifications
Send push notifications to mobile devices through GCM or APNS in Django.
Stars: ✭ 1,881 (+3035%)
Mutual labels:  push-notifications, apns
Net Core Push Notifications
Lightweight .NET Core Push Notifications for Android and iOS
Stars: ✭ 105 (+75%)
Mutual labels:  push-notifications, apns
Notificationpusher
Standalone PHP library for easy devices notifications push.
Stars: ✭ 1,143 (+1805%)
Mutual labels:  push-notifications, apns
mobile-push
A push notification library
Stars: ✭ 21 (-65%)
Mutual labels:  push-notifications, apns
Uniqush Push
Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices.
Stars: ✭ 1,238 (+1963.33%)
Mutual labels:  push-notifications, apns
apns2
Node client for connecting to Apple's Push Notification Service using the new HTTP/2 protocol with JSON web tokens
Stars: ✭ 66 (+10%)
Mutual labels:  push-notifications, apns
Aerogear Unifiedpush Server
🚀 AeroGear UnifiedPush Server
Stars: ✭ 432 (+620%)
Mutual labels:  push-notifications, apns
Onesignal Cordova Sdk
OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Ionic, PhoneGap CLI, PhoneGap Build, Cordova, or Sencha Touch app with OneSignal. Supports Android, iOS, and Amazon's Fire OS platforms. https://onesignal.com
Stars: ✭ 214 (+256.67%)
Mutual labels:  push-notifications, apns
Onesignal Unity Sdk
OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Unity app with OneSignal. https://onesignal.com
Stars: ✭ 161 (+168.33%)
Mutual labels:  push-notifications, apns
Gaurun
General push notification server in Go
Stars: ✭ 804 (+1240%)
Mutual labels:  push-notifications, apns
mobile-messaging-sdk-ios
Mobile Messaging SDK for iOS
Stars: ✭ 45 (-25%)
Mutual labels:  push-notifications, apns
Socket.io Push
整合了小米,华为,友盟,谷歌,苹果推送的统一解决方案
Stars: ✭ 605 (+908.33%)
Mutual labels:  push-notifications, apns
Onesignal Ionic Example
Stars: ✭ 89 (+48.33%)
Mutual labels:  push-notifications, apns
Node Pushnotifications
Push notifications for GCM, APNS, MPNS, AMZ (automatic detection from device token)
Stars: ✭ 432 (+620%)
Mutual labels:  push-notifications, apns
Pu.sh
A bash script to send iOS push notifications with the Apple Push Notification service (APNs)
Stars: ✭ 125 (+108.33%)
Mutual labels:  push-notifications, apns
Onesignal Ios Sdk
OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native iOS app with OneSignal. https://onesignal.com
Stars: ✭ 370 (+516.67%)
Mutual labels:  push-notifications, apns
Pushnotification
PHP and Laravel Package to send push notifications to Android and IOS devices.
Stars: ✭ 395 (+558.33%)
Mutual labels:  push-notifications, apns
Swift Apns
Swift Framework for sending Apple Push Notification over HTTP/2 API
Stars: ✭ 147 (+145%)
Mutual labels:  push-notifications, apns
OneSignal-Ionic-Sample
No description or website provided.
Stars: ✭ 85 (+41.67%)
Mutual labels:  push-notifications, apns

aioapns - An efficient APNs Client Library for Python/asyncio

aioapns is a library designed specifically for sending push-notifications to iOS devices via Apple Push Notification Service. aioapns provides an efficient client through asynchronous HTTP2 protocol for use with Python's asyncio framework.

aioapns requires Python 3.6 or later.

Performance

In my testing aioapns allows you to send on average 1.3k notifications per second on a single core.

Features

  • Internal connection pool which adapts to the current load
  • Support for certificate and token based connections
  • Ability to set TTL (time to live) for notifications
  • Ability to set priority for notifications
  • Ability to set collapse-key for notifications
  • Ability to use production or development APNs server

Installation

Use pip to install:

$ pip install aioapns

Basic Usage

import asyncio
from uuid import uuid4
from aioapns import APNs, NotificationRequest, PushType


async def run():
    apns_cert_client = APNs(
        client_cert='/path/to/apns-cert.pem',
        use_sandbox=False,
    )
    apns_key_client = APNs(
        key='/path/to/apns-key.p8',
        key_id='<KEY_ID>',
        team_id='<TEAM_ID>',
        topic='<APNS_TOPIC>',  # Bundle ID
        use_sandbox=False,
    )
    request = NotificationRequest(
        device_token='<DEVICE_TOKEN>',
        message = {
            "aps": {
                "alert": "Hello from APNs",
                "badge": "1",
            }
        },
        notification_id=str(uuid4()),  # optional
        time_to_live=3,                # optional
        push_type=PushType.ALERT,      # optional
    )
    await apns_cert_client.send_notification(request)
    await apns_key_client.send_notification(request)

loop = asyncio.get_event_loop()
loop.run_until_complete(run())

License

aioapns is developed and distributed under the Apache 2.0 license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].