All Projects → reactive-hub → akka-stream-apns

reactive-hub / akka-stream-apns

Licence: other
Reactive Streams for APNs

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to akka-stream-apns

Codehub Push
Push notification server built in Node.js for the iOS application CodeHub
Stars: ✭ 86 (+75.51%)
Mutual labels:  apns
Smartpush
SmartPush,一款iOS苹果远程推送测试程序,Mac OS下的APNS工具APP,iOS Push Notification Debug App
Stars: ✭ 1,778 (+3528.57%)
Mutual labels:  apns
Apns Http2
A Java library for sending notifications via APNS using Apple's HTTP/2 API.
Stars: ✭ 194 (+295.92%)
Mutual labels:  apns
Pushy
A Java library for sending APNs (iOS/macOS/Safari) push notifications
Stars: ✭ 1,353 (+2661.22%)
Mutual labels:  apns
Pu.sh
A bash script to send iOS push notifications with the Apple Push Notification service (APNs)
Stars: ✭ 125 (+155.1%)
Mutual labels:  apns
Django Push Notifications
Send push notifications to mobile devices through GCM or APNS in Django.
Stars: ✭ 1,881 (+3738.78%)
Mutual labels:  apns
Notificationpusher
Standalone PHP library for easy devices notifications push.
Stars: ✭ 1,143 (+2232.65%)
Mutual labels:  apns
Pyapns2
Python library for interacting with the Apple Push Notification service (APNs) via HTTP/2 protocol
Stars: ✭ 246 (+402.04%)
Mutual labels:  apns
Light Push
轻量级推送服务和实时在线监控平台,同时用于开发即时通信系统,基于node的socket.io,支持web、android、ios客户端,支持移动端离线推送,可进行分布式部署
Stars: ✭ 128 (+161.22%)
Mutual labels:  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 (+228.57%)
Mutual labels:  apns
Apns
apns is a simple golang package for ios notification based http2 protocol
Stars: ✭ 100 (+104.08%)
Mutual labels:  apns
Net Core Push Notifications
Lightweight .NET Core Push Notifications for Android and iOS
Stars: ✭ 105 (+114.29%)
Mutual labels:  apns
Swift Apns
Swift Framework for sending Apple Push Notification over HTTP/2 API
Stars: ✭ 147 (+200%)
Mutual labels:  apns
Onesignal Ionic Example
Stars: ✭ 89 (+81.63%)
Mutual labels:  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 (+336.73%)
Mutual labels:  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 (+2426.53%)
Mutual labels:  apns
Appleapnpush
Send push notification to Apple Devices (iPhone, iPad)
Stars: ✭ 134 (+173.47%)
Mutual labels:  apns
mobile-push
A push notification library
Stars: ✭ 21 (-57.14%)
Mutual labels:  apns
Apns2
⚡ HTTP/2 Apple Push Notification Service (APNs) push provider for Go — Send push notifications to iOS, tvOS, Safari and OSX apps, using the APNs HTTP/2 protocol.
Stars: ✭ 2,569 (+5142.86%)
Mutual labels:  apns
Rpush
The push notification service for Ruby.
Stars: ✭ 1,886 (+3748.98%)
Mutual labels:  apns

Reactive APNs Connector

Akka-stream-apns is an Apple Push Notification Service (APNs) connector built on top of Akka Streams. As of version 0.2, akka-stream-apns uses the latest HTTP/2-based APNs provider API.

Installation

resolvers += Resolver.bintrayRepo("reactivehub", "maven")

libraryDependencies += "com.reactivehub" %% "akka-stream-apns" % "0.10"

Quick Start

To use the connector, you need a push notification client SSL certificate and a device token. See System Requirements for more details on how to choose a TLS provider.

import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.Source
import io.netty.channel.nio.NioEventLoopGroup
import reactivehub.akka.stream.apns.TlsUtil.loadPkcs12FromResource
import reactivehub.akka.stream.apns._
import reactivehub.akka.stream.apns.marshallers.SprayJsonSupport

object Main extends App with SprayJsonSupport {
  implicit val system = ActorSystem("system")
  implicit val _ = ActorMaterializer()

  import system.dispatcher

  val group = new NioEventLoopGroup()
  val apns = ApnsExt(system).connection[Int](
    Environment.Development,
    loadPkcs12FromResource("/cert.p12", "password"),
    group)

  val deviceToken = DeviceToken("64-chars hex string")

  val payload = Payload.Builder()
    .withAlert("Hello!")
    .withBadge(1)

  Source.single(1  Notification(deviceToken, payload))
    .via(apns)
    .runForeach(println)
    .onComplete { _ 
      group.shutdownGracefully()
      system.terminate()
    }
}

Payload Builder

Akka-stream-apns comes with a convenient payload builder. The payload is a JSON object with the required key apns and zero or more custom keys. The builder can use a JSON library of your choice; just mix in SprayJsonSupport, PlayJsonSupport or LiftJsonSupport or bring into scope your own PayloadMarshaller.

val payload = Payload.Builder()
  .withAlert("Bob wants to play poker")
  .withLocalizedAlert("GAME_PLAY_REQUEST_FORMAT", "Jenna", "Frank")
  .withTitle("Game Request")
  .withLocalizedTitle("GAME_PLAY_REQUEST_TITLE")
  .withLocalizedAction("PLAY")
  .withLaunchImage("Default.png")
  .withBadge(9)
  .withSound("chime.aiff")
  .withContentAvailable
  .withCategory("ACCEPT_IDENTIFIER")
  .withCustomField("acme1", "bar")
  .withCustomField("acme2", 42)

System Requirements

Akka-stream-apns works with Java 8 and newer.

HTTP/2 over TLS requires the use of ALPN. Java, however, currently does not support ALPN. As akka-stream-apns internally uses Netty's codec-http2 to connect to APNs servers, there are two options how to do TLS:

Limitations

  • No reconnect/resend on error (yet)

Consulting

Our professional consulting services are highly flexible to address specific issues such as troubleshooting or other services tailored to suit your needs.

Please contact us for more information.

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].