'Pusher Platform SDK'

Pusher Platform SDK for Kotlin and Java

License

License

MIT
Categories

Categories

ORM Data
GroupId

GroupId

com.pusher
ArtifactId

ArtifactId

pusher-platform-core
Last Version

Last Version

1.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

'Pusher Platform SDK'
Pusher Platform SDK for Kotlin and Java
Project URL

Project URL

https://github.com/pusher/pusher-platform-android
Source Code Management

Source Code Management

https://github.com/pusher/pusher-platform-android

Download pusher-platform-core

How to add to project

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

Dependencies

runtime (3)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-jdk7 jar 1.2.51
com.squareup.okhttp3 : okhttp jar 3.10.0
com.google.code.gson : gson jar 2.8.2

Project Modules

There are no modules declared in this project.

Pusher Platform Kotlin/Java/Android

Twitter GitHub license codecov Travis branch


Core: Targets JVM/Kotlin Android: Targets Android (includes core)


Table of Contents

Installation

Gradle

In the build.gradle for your app make sure you have jcenter() repository as one of your repositories:

repositories {
    // other repos i.e. google()
    jcenter()
}

Then add this dependency when targeting Android:

dependencies {
    // ...
    api 'com.pusher:pusher-platform-android:$pusher_platform_version'
}

The latest version can be found here:

Android

Alternatively, if you want to target JVM 1.7 and upwards you can add this line:

dependencies {
    // ...
    api 'com.pusher:pusher-platform-core:$pusher_platform_version'
}

With the latest version for Core found here:

Core

Usage

The main entity used to access to platform services is Instance.

The simpler way to create a new instance uses 4 things:

  • locator: Instance locator id in the form of 'v1:us1:1a234-123a-1234-12a3-1234123aa12'
  • serviceName: The name of the service this instance will use
  • serviceVersion: The version of the service
  • dependencies: An object containing the requirements for the instance. The default implementation for Android provides all that is needed in com.pusher.platform.AndroidDependencies

Examples:

class KotlinExample {
    val instance = Instance(
         locator = "v1:us1:1a234-123a-1234-12a3-1234123aa12",
         serviceName = "service",
         serviceVersion = "v1",
         dependencies = AndroidDependencies()
    )
}
class JavaExample {
    Instance instance = new Instance(
        "v1:us1:1a234-123a-1234-12a3-1234123aa12",
        "service",
        "v1",
        new AndroidDependencies()
    );
}

Testing

We use Junit 5 and/or Spek to run unit and integration tests. In pusher-platform-core we have two test folders. Unit tests can be located in test and integration tests in integrationTest. In order to run integration tests locally we have to do a couple of extra steps. They can be found here.

Publishing

jCenter

The two artifacts this project produces (pusher-platform-core and pusher-platform-android) are published in jCenter.

Firstly, make sure you have a BinTray account. To get the api key go to Profile > Edit > Api Key

Then you need to set up a user name and api key.

Either on your local ~/.gradle/gradle.properties as:

bintrayUser=you-bintray-user-name
bintrayApiKey=your-bintray-api-key

Or as environment variables (mainly for CI):

BINTRAY_USER=you-bintray-user-name
BINTRAY_API_KEY=your-bintray-api-key

You will also need to have SONATYPE_GPG_PASSPHRASE set as an environment variable. This is, as the name suggests, the GPG passphrase for the Pusher Maven account.

Now, to do the actual release run:

gradlew bintrayUpload

Note: The publish action will both override the current release (if it has the same version name as the current) and automatically publish the new version.

Maven

Syncing the artifacts to Maven is also setup. It involves logging into bintray and syncing an uploaded release.

Communication

  • Found a bug? Please open an issue.
  • Have a feature request. Please open an issue.
  • If you want to contribute, please submit a pull request (preferably with some tests 🙂 ).
  • For further questions, you can come say hi on Slack

License

pusher-platform-android is released under the MIT license. See LICENSE for details.

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.

Versions

Version
1.0.5
1.0.4
1.0.3
1.0.1
1.0.0
0.4.2