Skip to content

Commit

Permalink
Add HMS support
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Latypov authored and Konstantin Latypov committed Jul 1, 2020
1 parent a043304 commit e5230bd
Show file tree
Hide file tree
Showing 629 changed files with 3,239 additions and 10,405 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Mobile Messaging SDK for Android

[![Download](https://api.bintray.com/packages/infobip/maven/infobip-mobile-messaging-android-sdk/images/download.svg)](https://bintray.com/infobip/maven/infobip-mobile-messaging-android-sdk/_latestVersion)
[![License](https://img.shields.io/github/license/infobip/mobile-messaging-sdk-android.svg?label=License)](https://github.com/infobip/mobile-messaging-sdk-android/blob/master/LICENSE)
[![Download](https://api.bintray.com/packages/infobip/maven/infobip-mobile-messaging-huawei-sdk/images/download.svg)](https://bintray.com/infobip/maven/infobip-mobile-messaging-huawei-sdk/_latestVersion)
[![License](https://img.shields.io/github/license/infobip/mobile-messaging-sdk-huawei.svg?label=License)](https://github.com/infobip/mobile-messaging-sdk-huawei/blob/master/LICENSE)

Mobile Messaging SDK is designed and developed to easily enable push notification channel in your mobile application. In almost no time of implementation you get push notification in your application and access to the features of <a href="https://www.infobip.com/en/products/mobile-app-messaging" target="_blank">Infobip Mobile Apps Messaging</a>. The document describes library integration steps. Additional information can be found in our <a href="https://github.com/infobip/mobile-messaging-sdk-android/wiki" target="_blank">Wiki</a>.
Mobile Messaging SDK is designed and developed to easily enable push notification channel in your mobile application. In almost no time of implementation you get push notification in your application and access to the features of <a href="https://www.infobip.com/en/products/mobile-app-messaging" target="_blank">Infobip Mobile Apps Messaging</a>. The document describes library integration steps. Additional information can be found in our <a href="https://github.com/infobip/mobile-messaging-sdk-huawei/wiki" target="_blank">Wiki</a>.

## Requirements

- Android Studio
- API Level: 14 (Android 4.0 - Ice Cream Sandwich)
- API Level: 19 (Android 4.4 - KitKat)
- [AppGallery](https://huaweimobileservices.com/appgallery/)

## Quick start guide

Expand All @@ -17,22 +18,21 @@ Mobile Messaging SDK is designed and developed to easily enable push notificatio
```groovy
dependencies {
...
implementation ('org.infobip.mobile.messaging.api:infobip-mobile-messaging-android-sdk:2.4.0@aar') {
implementation ('org.infobip.mobile.messaging.api:infobip-mobile-messaging-huawei-sdk:1.0.0@aar') {
transitive = true
}
}
```
<img src="https://github.com/infobip/mobile-messaging-sdk-android/wiki/images/QSGGradle.png?raw=true" alt="Gradle dependencies"/>
3. Add <a href="https://dev.infobip.com/push-messaging/firebase-cloud-messaging-fcm-server-api-key-setup" target="_blank">`Firebase Sender ID`</a> and Infobip <a href="https://dev.infobip.com/push-messaging/create-application" target="_blank">`Application Code`</a> obtained in step 1 to `values/strings.xml`

3. Add <a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-config-agc-0000001050170137" target="_blank">`HMS App ID`</a> and Infobip <a href="https://dev.infobip.com/push-messaging/create-application" target="_blank">`Application Code`</a> obtained in step 1 to `values/strings.xml`
```groovy
<resources>
<string name="google_app_id">SENDER ID</string>
<string name="app_id">SENDER ID</string>
<string name="infobip_application_code">APPLICATION CODE</string>
...
</resources>
```
<img src="https://github.com/infobip/mobile-messaging-sdk-android/wiki/images/QSGStrings.png?raw=true" alt="String resources"/>
Do not add `google_app_id` if you're using <a href="https://developers.google.com/android/guides/google-services-plugin" target="_blank">Google Services Gradle Plugin</a> and `google-services.json`.

4. Add code to `MainActivity#onCreate`

```java
Expand All @@ -57,12 +57,11 @@ Mobile Messaging SDK is designed and developed to easily enable push notificatio

> ### Notes
> 1. All required manifest components are merged to application manifest automatically by manifest merger. Please include <a href="https://github.com/infobip/mobile-messaging-sdk-android/wiki/Android-Manifest-components#push-notifications" target="_blank">push-related components</a> to manifest manually if manifest merger was disabled.
> 2. MobileMessaging library has geofencing service disabled by default. In order to opt-in the service, follow <a href="https://github.com/infobip/mobile-messaging-sdk-android/wiki/Geofencing-API" target="_blank">this guide</a>.
> 3. Keep in mind that some proprietary android versions may restrict network traffic for your app. It may in turn affect delivery of push notifications.
> 2. Keep in mind that some proprietary android versions may restrict network traffic for your app. It may in turn affect delivery of push notifications.

<br>

| If you have any questions or suggestions, feel free to send an email to support@infobip.com or create an <a href="https://github.com/infobip/mobile-messaging-sdk-android/issues" target="_blank">issue</a>. |
| If you have any questions or suggestions, feel free to send an email to support@infobip.com or create an <a href="https://github.com/infobip/mobile-messaging-sdk-huawei/issues" target="_blank">issue</a>. |
|---|


Expand Down
26 changes: 11 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ buildscript {
}

repositories {
jcenter()
maven {
url 'https://oss.jfrog.org/artifactory/plugins-release'
credentials {
username = "${artifactoryUsername}"
password = "${artifactoryPassword}"
}
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
jcenter()
// huawei maven
maven { url 'http://developer.huawei.com/repo/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.android.tools.build:gradle:3.6.2'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.4.7'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
Expand All @@ -32,23 +31,20 @@ plugins {
}

ext {
mm_minSdkVersion = 14
mm_minSdkVersion = 17
mm_compileSdkVersion = 28
mm_targetSdkVersion = 28
mm_buildToolsVersion = "28.0.3"
mm_supportLibrariesVersion = "28.0.0"
mm_firebaseMessagingVersion = "17.6.0"
mm_gcmVersion = "16.1.0"
mm_gmsLocationVersion = "16.0.0"
mm_apiVersion = "3.0.4"
}

allprojects {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
// huawei maven
maven { url 'http://developer.huawei.com/repo/' }
}
}

Expand Down Expand Up @@ -104,7 +100,7 @@ task updateVersionInReadme {
def readmeFile = new File('README.md')
def text = readmeFile.text
readmeFile.withWriter { w ->
w << text.replaceFirst('infobip-mobile-messaging-android-sdk:\\d+\\.\\d+\\.\\S+@aar', "infobip-mobile-messaging-android-sdk:$version@aar")
w << text.replaceFirst('infobip-mobile-messaging-huawei-sdk:\\d+\\.\\d+\\.\\S+@aar', "infobip-mobile-messaging-huawei-sdk:$version@aar")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
version=2.5.0-SNAPSHOT
version=1.1.0-SNAPSHOT
group=org.infobip.mobile.messaging.api
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Sep 16 17:44:32 CEST 2019
#Tue Mar 31 11:01:47 MSK 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

This file was deleted.

This file was deleted.

Loading

0 comments on commit e5230bd

Please sign in to comment.