Skip to content

Commit 6d52602

Browse files
authored
Merge pull request #431 from mindbox-cloud/release/2.8.4
Release/2.8.4
2 parents 0ac87e4 + 829bbfa commit 6d52602

File tree

85 files changed

+2081
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2081
-129
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ jobs:
9797
- name: Publish to Sonatype
9898
run: ./gradlew --no-daemon publish -PsonatypeUsername=${{secrets.OSSRHUSERNAME}} -PsonatypePassword=${{secrets.OSSRHPASSWORD}}
9999

100+
#To update version in Github README.md
101+
- name: Version Upgrade
102+
run: ./maven-version-update.sh
103+
100104
- name: Job status notification
101105
uses: rtCamp/action-slack-notify@v2
102106
env:

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,57 @@
1+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/cloud.mindbox/mobile-sdk/badge.svg)](https://search.maven.org/artifact/cloud.mindbox/mobile-sdk/2.8.3/aar)
12

3+
# Mindbox SDK for Android
4+
5+
The Mindbox SDK allows you to integrate mobile push-notifications, in-app messages and client events into your Android projects.
6+
7+
## Getting Started
8+
9+
These instructions will help you integrate the Mindbox SDK into your Android app.
10+
11+
### Installation
12+
13+
To integrate Mindbox SDK into your Android app, follow the installation process detailed [here](https://developers.mindbox.ru/docs/androidhuawei-native-sdk). Here is an overview:
14+
15+
1. Add Mindbox's Maven repository to your project build.gradle file:
16+
```markdown
17+
repositories {
18+
maven()
19+
}
20+
```
21+
2. Now, add the Mindbox SDK to your app-level build.gradle file:
22+
```markdown
23+
dependencies {
24+
implementation 'cloud.mindbox:mobile-sdk:2.8.3'
25+
}
26+
```
27+
28+
### Initialization
29+
30+
Initialize the Mindbox SDK in your Activity or Application class. Check documentation [here](https://developers.mindbox.ru/docs/android-sdk-initialization) for more details.
31+
32+
33+
### Operations
34+
35+
Learn how to send events to Mindbox. Create a new Operation class object and set the respective parameters. Check the [documentation](https://developers.mindbox.ru/docs/android-integration-of-actions) for more details.
36+
37+
### Push Notifications
38+
39+
Mindbox SDK helps handle push notifications. Configuration and usage instructions can be found in the SDK documentation [here](https://developers.mindbox.ru/docs/huawei-send-push-notifications) and [here](https://developers.mindbox.ru/docs/firebase-send-push-notifications).
40+
41+
### Migration
42+
43+
If migrating from an older version, follow the instructions [here](https://developers.mindbox.ru/docs/v1-v2-android-sdk) to upgrade to the new version.
44+
45+
## Troubleshooting
46+
47+
Refer to the [Example of integration](https://github.com/mindbox-cloud/android-sdk/tree/develop/example) in case of any issues.
48+
49+
## Further Help
50+
51+
Reach out to us for further help and we'll be glad to assist.
52+
53+
## License
54+
55+
The library is available as open source under the terms of the [License](https://github.com/mindbox-cloud/android-sdk/blob/develop/LICENSE.md).
56+
57+
For a better understanding of this content, please familiarize yourself with the Mindbox [Android SDK](https://developers.mindbox.ru/docs/androidhuawei-native-sdk) documentation.

example/.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
/.idea/
11+
.DS_Store
12+
/build
13+
/captures
14+
.externalNativeBuild
15+
.cxx
16+
local.properties
17+
/app/agconnect-services.json
18+
/app/google-services.json

example/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
To run the example application with functioning mobile push notifications (complete only step 4 for in-app functionality to work), follow these steps:
3+
4+
1) Change the package identifier in the **app/build.gradle** file
5+
6+
2) Add your application to either Firebase or Huawei project, following the instructions provided at:
7+
[Firebase Key Generation](https://developers.mindbox.ru/docs/firebase-get-keys) /
8+
[Huawei Key Generation](https://developers.mindbox.ru/docs/huawei-get-keys)
9+
or add app in your existing project
10+
11+
3) Copy the **google-services.json** file (for Firebase) or/and **agcconnect-services.json** file (for Huawei) into the app folder of your project
12+
13+
4) Set your domain and endpoint in the [ExampleApplication](https://github.com/mindbox-cloud/android-sdk/blob/develop/example/app/src/main/java/com/mindbox/example/ExampleApplication.kt) class within the configuration builder
14+
15+
5) Run the application
16+
17+
6) After 5 minutes check your user in your Mindbox admin site
18+
19+
7) Run in-app and send mobile push

example/app/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build
2+
/.idea

example/app/build.gradle

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
id 'com.google.gms.google-services'
5+
id 'com.huawei.agconnect'
6+
}
7+
8+
android {
9+
namespace 'com.mindbox.example'
10+
compileSdk 34
11+
12+
defaultConfig {
13+
applicationId "com.mindbox.example"
14+
minSdk 19
15+
targetSdk 34
16+
versionCode 1
17+
versionName "1.0"
18+
}
19+
20+
buildTypes {
21+
release {
22+
minifyEnabled false
23+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24+
}
25+
}
26+
compileOptions {
27+
sourceCompatibility JavaVersion.VERSION_1_8
28+
targetCompatibility JavaVersion.VERSION_1_8
29+
}
30+
kotlinOptions {
31+
jvmTarget = '1.8'
32+
}
33+
viewBinding {
34+
enabled = true
35+
}
36+
buildFeatures {
37+
buildConfig = true
38+
}
39+
}
40+
41+
dependencies {
42+
43+
implementation 'androidx.core:core-ktx:1.12.0'
44+
implementation 'androidx.appcompat:appcompat:1.6.1'
45+
implementation 'com.google.android.material:material:1.11.0'
46+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
47+
48+
//Push services
49+
implementation platform('com.google.firebase:firebase-bom:32.7.1')
50+
implementation 'com.google.firebase:firebase-analytics-ktx'
51+
implementation 'com.google.firebase:firebase-messaging-ktx'
52+
implementation 'com.huawei.hms:push:6.11.0.300'
53+
54+
//Mindbox
55+
implementation 'cloud.mindbox:mobile-sdk:2.8.3'
56+
implementation 'cloud.mindbox:mindbox-firebase:2.8.3'
57+
implementation 'cloud.mindbox:mindbox-huawei:2.8.3'
58+
59+
//Glade for custom loader
60+
implementation 'com.github.bumptech.glide:glide:4.15.1'
61+
annotationProcessor 'com.github.bumptech.glide:compiler:4.15.1'
62+
}

example/app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
6+
7+
<application
8+
android:name=".ExampleApp"
9+
android:allowBackup="true"
10+
android:icon="@mipmap/ic_launcher"
11+
android:networkSecurityConfig="@xml/network_security_config"
12+
android:label="@string/app_name"
13+
android:roundIcon="@mipmap/ic_launcher_round"
14+
android:theme="@style/Theme.MindboxAndroidSdkExample">
15+
<meta-data
16+
android:name="com.huawei.hms.client.channel.androidMarket"
17+
android:value="false" />
18+
<service
19+
android:name=".MindboxHuaweiMessagingService"
20+
android:enabled="true"
21+
android:exported="false">
22+
<intent-filter>
23+
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
24+
</intent-filter>
25+
</service>
26+
27+
<service
28+
android:name=".MindboxFirebaseMessagingService"
29+
android:enabled="true"
30+
android:exported="false">
31+
<intent-filter>
32+
<action android:name="com.google.firebase.MESSAGING_EVENT" />
33+
</intent-filter>
34+
</service>
35+
36+
<activity
37+
android:name=".ActivityTransitionByPush"
38+
android:exported="false"
39+
android:launchMode="singleTask"/>
40+
41+
<activity
42+
android:name=".MainActivity"
43+
android:exported="true"
44+
android:launchMode="singleTop">
45+
<intent-filter>
46+
<action android:name="android.intent.action.MAIN" />
47+
48+
<category android:name="android.intent.category.LAUNCHER" />
49+
</intent-filter>
50+
</activity>
51+
</application>
52+
53+
<queries>
54+
<intent>
55+
<action android:name="com.huawei.hms.core.aidlservice" />
56+
</intent>
57+
</queries>
58+
</manifest>
12.7 KB
Loading
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.mindbox.example
2+
3+
import android.content.Intent
4+
import android.os.Bundle
5+
import androidx.appcompat.app.AppCompatActivity
6+
import cloud.mindbox.mobile_sdk.Mindbox
7+
import com.mindbox.example.databinding.ActivityTrasitionByPushBinding
8+
9+
10+
class ActivityTransitionByPush : AppCompatActivity() {
11+
private var _binding: ActivityTrasitionByPushBinding? = null
12+
private val binding: ActivityTrasitionByPushBinding
13+
get() = _binding!!
14+
15+
override fun onCreate(savedInstanceState: Bundle?) {
16+
super.onCreate(savedInstanceState)
17+
_binding = ActivityTrasitionByPushBinding.inflate(layoutInflater)
18+
setContentView(binding.root)
19+
20+
//Get data from push after click on push or button in push
21+
processMindboxIntent(intent, this)?.let { (url, payload) ->
22+
binding.tvPushUrlResultSecondActivity.text = url
23+
binding.tvPushPayloadResultSecondActivity.text = payload
24+
}
25+
}
26+
27+
override fun onNewIntent(intent: Intent?) {
28+
super.onNewIntent(intent)
29+
30+
//Get data from push after click on push or button in push
31+
processMindboxIntent(intent, this)?.let { (url, payload) ->
32+
binding.tvPushUrlResultSecondActivity.text = url
33+
binding.tvPushPayloadResultSecondActivity.text = payload
34+
}
35+
//https://developers.mindbox.ru/docs/android-app-start-tracking
36+
Mindbox.onNewIntent(intent)
37+
}
38+
39+
override fun onDestroy() {
40+
super.onDestroy()
41+
_binding = null
42+
}
43+
}

0 commit comments

Comments
 (0)