gcm-sender-async

An asynchronous GCM server library.

Лицензия

Лицензия

Группа

Группа

org.whispersystems
Идентификатор

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

gcm-sender-async
Последняя версия

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

0.1.6
Дата

Дата

Тип

Тип

jar
Описание

Описание

gcm-sender-async
An asynchronous GCM server library.
Ссылка на сайт

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

https://github.com/WhisperSystems/gcm-sender-async
Система контроля версий

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

https://github.com/WhisperSystems/gcm-sender-async

Скачать gcm-sender-async

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

<!-- https://jarcasting.com/artifacts/org.whispersystems/gcm-sender-async/ -->
<dependency>
    <groupId>org.whispersystems</groupId>
    <artifactId>gcm-sender-async</artifactId>
    <version>0.1.6</version>
</dependency>
// https://jarcasting.com/artifacts/org.whispersystems/gcm-sender-async/
implementation 'org.whispersystems:gcm-sender-async:0.1.6'
// https://jarcasting.com/artifacts/org.whispersystems/gcm-sender-async/
implementation ("org.whispersystems:gcm-sender-async:0.1.6")
'org.whispersystems:gcm-sender-async:jar:0.1.6'
<dependency org="org.whispersystems" name="gcm-sender-async" rev="0.1.6">
  <artifact name="gcm-sender-async" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.whispersystems', module='gcm-sender-async', version='0.1.6')
)
libraryDependencies += "org.whispersystems" % "gcm-sender-async" % "0.1.6"
[org.whispersystems/gcm-sender-async "0.1.6"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.apache.httpcomponents : httpasyncclient jar 4.0.2
com.fasterxml.jackson.core : jackson-databind jar 2.9.8
com.nurkiewicz.asyncretry : asyncretry-jdk7 jar 0.0.5

test (4)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.11
org.mockito : mockito-core jar 1.9.5
com.squareup.okhttp : mockwebserver jar 2.1.0
com.github.tomakehurst : wiremock jar 1.52

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

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

gcm-sender-async

An asynchronous HTTP library for Google Cloud Messaging.

Google provides a library for GCM (gcm-server), but it has a synchronous interface, along with an implementation that leaves something to be desired.

This is asynchronous, backed by Apache HttpAsyncClient, automatically handles asynchronous retries with backoff, simple to use, and fast.

Installing

Add to your pom:

<dependency>
  <groupId>org.whispersystems</groupId>
  <artifactId>gcm-sender-async</artifactId>
  <version>(latest version here)</version>
</dependency>

Using

String apiKey = "<myGcmApiKey>";
Sender sender = new Sender(apiKey);

ListenableFuture<Result> future = sender.send(Message.newBuilder()
                                                     .withDestination("<registration_id>")
                                                     .withDataPart("message", "hello world!");

Futures.addCallback(future, new FutureCallback<Result>() {
  @Override
  public void onSuccess(Result result) {
    if (result.isSuccess()) {
      // Maybe do something with result.getMessageId()
    } else {
      // Maybe do something with result.getError(), or check result.isUnregistered, etc..
    }
  }

  @Override
  public void onFailure(Throwable throwable) {
    // Handle network failure or server 500
  }
}

License

Copyright 2015 Open Whisper Systems

Licensed under the AGPLv3: https://www.gnu.org/licenses/agpl-3.0.html

org.whispersystems

Open Whisper Systems

The Signal repositories have moved to github.com/signalapp

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

Версия
0.1.6
0.1.5
0.1.4
0.1.3