'Pusher Push Notifications SDK for Android'

Pusher Push Notifications SDK for Android clients

Лицензия

Лицензия

MIT
Категории

Категории

Java Языки программирования
Группа

Группа

com.pusher
Идентификатор

Идентификатор

push-notifications-server-java
Последняя версия

Последняя версия

1.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

'Pusher Push Notifications SDK for Android'
Pusher Push Notifications SDK for Android clients
Ссылка на сайт

Ссылка на сайт

https://github.com/pusher/push-notifications-java
Система контроля версий

Система контроля версий

https://github.com/pusher/push-notifications-java

Скачать push-notifications-server-java

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.pusher/push-notifications-server-java/ -->
<dependency>
    <groupId>com.pusher</groupId>
    <artifactId>push-notifications-server-java</artifactId>
    <version>1.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.pusher/push-notifications-server-java/
implementation 'com.pusher:push-notifications-server-java:1.1.1'
// https://jarcasting.com/artifacts/com.pusher/push-notifications-server-java/
implementation ("com.pusher:push-notifications-server-java:1.1.1")
'com.pusher:push-notifications-server-java:jar:1.1.1'
<dependency org="com.pusher" name="push-notifications-server-java" rev="1.1.1">
  <artifact name="push-notifications-server-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.pusher', module='push-notifications-server-java', version='1.1.1')
)
libraryDependencies += "com.pusher" % "push-notifications-server-java" % "1.1.1"
[com.pusher/push-notifications-server-java "1.1.1"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.2.10
org.apache.httpcomponents : httpclient jar 4.5.4
com.google.code.gson : gson jar 2.8.0

runtime (1)

Идентификатор библиотеки Тип Версия
com.auth0 : java-jwt jar 3.7.0

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

Pusher Beams Java Server SDK

Build Status

Installation

The compiled library is available in two ways:

Maven

The push-notifications-server-java is available in Maven Central.

<dependencies>
    <dependency>
      <groupId>com.pusher</groupId>
      <artifactId>push-notifications-server-java</artifactId>
      <version>1.1.1</version>
    </dependency>
</dependencies>

Gradle

dependencies {
  compile 'com.pusher:push-notifications-server-java:1.1.1'
}

Download

You can download a version of the .jar directly from Maven.

Usage

Configuring the SDK for Your Instance

Use your instance id and secret (you can get these from the dashboard) to create a Beams PushNotifications instance:

Java

String instanceId = "8f9a6e22-2483-49aa-8552-125f1a4c5781";
String secretKey = "C54D42FB7CD2D408DDB22D7A0166F1D";

PushNotifications pushNotifications = new PushNotifications(instanceId, secretKey);

Kotlin

val instanceId = "8f9a6e22-2483-49aa-8552-125f1a4c5781"
val secretKey = "C54D42FB7CD2D408DDB22D7A0166F1D"

val pn = PushNotifications(instanceId, secretKey)

Publishing a Notification

Once you have created your PushNotifications instance you can publish a push notification to your registered & subscribed devices:

Java

List<String> interests = Arrays.asList("donuts", "pizza");

Map<String, Map> publishRequest = new HashMap();

Map<String, String> alert = new HashMap();
alert.put("alert", "hi");
Map<String, Map> aps = new HashMap();
aps.put("aps", alert);
publishRequest.put("apns", aps);

Map<String, String> fcmNotification = new HashMap();
fcmNotification.put("title", "hello");
fcmNotification.put("body", "Hello world");
Map<String, Map> fcm = new HashMap();
fcm.put("notification", fcmNotification);
publishRequest.put("fcm", fcm);

pushNotifications.publishToInterests(interests, publishRequest);

Kotlin

val interests = listOf("donuts", "pizza")
val publishRequest = hashMapOf(
  "apns" to hashMapOf("aps" to hashMapOf("alert" to "hi")),
  "fcm" to hashMapOf("notification" to hashMapOf("title" to "hello", "body" to "Hello world"))
)

pn.publishToInterests(interests, publishRequest)

com.pusher

Pusher

Pusher makes communication and collaboration APIs that power apps all over the world supported by easy to integrate SDKs for web, mobile, and backend.

Версии библиотеки

Версия
1.1.1
1.1.0
0.9.0