Simple implementation of Pushe SDK using Android studio and Java.
- Install git if you don't have it.
- Run:
git clone https://github.com/pusheco/android-studio-sample.git
- Open it with Android studio and run it on your device.
dependencies {
def latest = "$LATEST"
implementation("co.pushe.plus:base:$latest")
implementation("co.pushe.plus:hms:$latest") // Huawei PushKit support
}
Notice for
HMS
you should checkout the documentation of HMS setup for Pushe, so you can actually use it
All releases are published to mavenCentral()
since the death of JCenter
allprojects {
repositories {
maven { url 'https://developer.huawei.com/repo/' } // For HMS (Huawei messaging service)
mavenCentral() // For Pushe itself (and many others)
// ...
}
}
In order to run this application follow bellow steps:
- Signup to Pushe Console
- Create application
- Get the manifest content and add it to your project
AndroidManifest.xml
The manifest content will be a tag like this:
<meta-data android:name="pushe_token"
android:value="PUSHE_TOKEN" />
If you need location-based features, add Location permissions
to the manifest as well.
All features are added to the sample. You can check them out.
Now run and install your app on a device or emulator that has google-play-service installed. Pushe needs minimum android api=15 and google-play-service version >= 3 to run.
For detailed documentations visit https://docs.pushe.co/docs/android/intro
Feel free to add anything you think is suitable to be in this sample.
It does not follow any specific code style. So just read the code a little bit and send a pull request at anytime. We'll be happy :D.
If you have any problem, please contact us using this email, we will get back to you right away:
hi [at] pushe.co