Skip to content

Commit 244cdd8

Browse files
committed
4.0.2-push-kotlin
1 parent 9512299 commit 244cdd8

16 files changed

+101
-293
lines changed

sample-pushnotifications-kotlin/app/build.gradle

+8-18
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
buildscript {
22
repositories {
33
google()
4-
jcenter()
5-
maven { url 'https://maven.fabric.io/public' }
4+
mavenCentral()
65
}
76
dependencies {
87
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinGradlePluginVersion"
9-
classpath "io.fabric.tools:gradle:$fabricToolsVersion"
108
}
119
}
1210

1311
apply plugin: 'com.android.application'
1412
apply plugin: 'kotlin-android'
1513
apply plugin: 'kotlin-android-extensions'
16-
apply plugin: 'io.fabric'
1714
apply from: "../artifacts.gradle"
1815
apply plugin: 'com.google.gms.google-services'
1916

@@ -23,27 +20,25 @@ androidExtensions {
2320

2421
repositories {
2522
google()
26-
jcenter()
23+
mavenCentral()
2724
maven {
2825
url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
2926
}
30-
maven { url 'https://maven.fabric.io/public' }
31-
flatDir { dirs 'libs' }
3227
}
3328

3429
android {
3530
def versionQACode = 1
3631

37-
compileSdkVersion 28
38-
buildToolsVersion "28.0.3"
32+
compileSdkVersion 31
33+
buildToolsVersion "31.0.0"
3934
flavorDimensions dimensionDefault
4035

4136
defaultConfig {
4237
applicationId "com.quickblox.sample.pushnotifications.kotlin"
43-
minSdkVersion 14
44-
targetSdkVersion 28
45-
versionCode 401000
46-
versionName '4.0.1-kotlin'
38+
minSdkVersion 21
39+
targetSdkVersion 31
40+
versionCode 402000
41+
versionName '4.0.2-kotlin'
4742
multiDexEnabled true
4843
}
4944

@@ -97,14 +92,9 @@ android {
9792
}
9893

9994
dependencies {
100-
10195
implementation("com.quickblox:quickblox-android-sdk-messages:$qbSdkVersion")
10296

10397
implementation "com.google.firebase:firebase-core:$firebaseCoreVersion"
10498
implementation("com.google.android.material:material:$materialVersion")
10599
implementation("com.github.johnkil.android-robototextview:robototextview:$robotoTextViewVersion")
106-
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinGradlePluginVersion")
107-
implementation("com.crashlytics.sdk.android:crashlytics:$crashlyticsVersion@aar") {
108-
transitive = true
109-
}
110100
}

sample-pushnotifications-kotlin/app/google-services.json

+10-135
Original file line numberDiff line numberDiff line change
@@ -1,154 +1,29 @@
11
{
22
"project_info": {
3-
"project_number": "247738611464",
4-
"firebase_url": "https://qb-prod-samples.firebaseio.com",
5-
"project_id": "qb-prod-samples",
6-
"storage_bucket": "qb-prod-samples.appspot.com"
3+
"project_number": "Put here your value",
4+
"firebase_url": "https://qb-samples.firebaseio.com",
5+
"project_id": "qb-samples",
6+
"storage_bucket": "qb-samples.appspot.com"
77
},
88
"client": [
99
{
1010
"client_info": {
11-
"mobilesdk_app_id": "1:247738611464:android:beb270faa2c3a789",
12-
"android_client_info": {
13-
"package_name": "com.quickblox.sample.chat.java"
14-
}
15-
},
16-
"oauth_client": [],
17-
"api_key": [
18-
{
19-
"current_key": "AIzaSyBFXAfVr6kkFJdDNOm8U-c7iju0qIUkc_A"
20-
}
21-
],
22-
"services": {
23-
"appinvite_service": {
24-
"other_platform_oauth_client": [
25-
{
26-
"client_id": "247738611464-v2nvd29bmqum7niosnfuh28oq3beh9f6.apps.googleusercontent.com",
27-
"client_type": 3
28-
}
29-
]
30-
}
31-
}
32-
},
33-
{
34-
"client_info": {
35-
"mobilesdk_app_id": "1:247738611464:android:1cdc72e9ffd29448",
36-
"android_client_info": {
37-
"package_name": "com.quickblox.sample.chat.kotlin"
38-
}
39-
},
40-
"oauth_client": [],
41-
"api_key": [
42-
{
43-
"current_key": "AIzaSyBFXAfVr6kkFJdDNOm8U-c7iju0qIUkc_A"
44-
}
45-
],
46-
"services": {
47-
"appinvite_service": {
48-
"other_platform_oauth_client": [
49-
{
50-
"client_id": "247738611464-v2nvd29bmqum7niosnfuh28oq3beh9f6.apps.googleusercontent.com",
51-
"client_type": 3
52-
}
53-
]
54-
}
55-
}
56-
},
57-
{
58-
"client_info": {
59-
"mobilesdk_app_id": "1:247738611464:android:06cb0de4c719ad84",
60-
"android_client_info": {
61-
"package_name": "com.quickblox.sample.pushnotifications.java"
62-
}
63-
},
64-
"oauth_client": [],
65-
"api_key": [
66-
{
67-
"current_key": "AIzaSyBFXAfVr6kkFJdDNOm8U-c7iju0qIUkc_A"
68-
}
69-
],
70-
"services": {
71-
"appinvite_service": {
72-
"other_platform_oauth_client": [
73-
{
74-
"client_id": "247738611464-v2nvd29bmqum7niosnfuh28oq3beh9f6.apps.googleusercontent.com",
75-
"client_type": 3
76-
}
77-
]
78-
}
79-
}
80-
},
81-
{
82-
"client_info": {
83-
"mobilesdk_app_id": "1:247738611464:android:c2749661061637f0",
11+
"mobilesdk_app_id": "Put here your value",
8412
"android_client_info": {
8513
"package_name": "com.quickblox.sample.pushnotifications.kotlin"
8614
}
8715
},
88-
"oauth_client": [],
89-
"api_key": [
90-
{
91-
"current_key": "AIzaSyBFXAfVr6kkFJdDNOm8U-c7iju0qIUkc_A"
92-
}
93-
],
94-
"services": {
95-
"appinvite_service": {
96-
"other_platform_oauth_client": [
97-
{
98-
"client_id": "247738611464-v2nvd29bmqum7niosnfuh28oq3beh9f6.apps.googleusercontent.com",
99-
"client_type": 3
100-
}
101-
]
102-
}
103-
}
104-
},
105-
{
106-
"client_info": {
107-
"mobilesdk_app_id": "1:247738611464:android:99e5b55a490c901c",
108-
"android_client_info": {
109-
"package_name": "com.quickblox.sample.videochat.java"
110-
}
111-
},
112-
"oauth_client": [],
113-
"api_key": [
16+
"oauth_client": [
11417
{
115-
"current_key": "AIzaSyBFXAfVr6kkFJdDNOm8U-c7iju0qIUkc_A"
18+
"client_id": "Put here your value",
19+
"client_type": 3
11620
}
11721
],
118-
"services": {
119-
"appinvite_service": {
120-
"other_platform_oauth_client": [
121-
{
122-
"client_id": "247738611464-v2nvd29bmqum7niosnfuh28oq3beh9f6.apps.googleusercontent.com",
123-
"client_type": 3
124-
}
125-
]
126-
}
127-
}
128-
},
129-
{
130-
"client_info": {
131-
"mobilesdk_app_id": "1:247738611464:android:ac22e0d1b3a3e86b",
132-
"android_client_info": {
133-
"package_name": "com.quickblox.sample.videochat.kotlin"
134-
}
135-
},
136-
"oauth_client": [],
13722
"api_key": [
13823
{
139-
"current_key": "AIzaSyBFXAfVr6kkFJdDNOm8U-c7iju0qIUkc_A"
140-
}
141-
],
142-
"services": {
143-
"appinvite_service": {
144-
"other_platform_oauth_client": [
145-
{
146-
"client_id": "247738611464-v2nvd29bmqum7niosnfuh28oq3beh9f6.apps.googleusercontent.com",
147-
"client_type": 3
148-
}
149-
]
24+
"current_key": "Put here your value"
15025
}
151-
}
26+
]
15227
}
15328
],
15429
"configuration_version": "1"
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# Add project specific ProGuard rules here.
22
# By default, the flags in this file are appended to flags specified
3-
# in /home/tereha/Android/sdk/tools/proguard/proguard-android.txt
3+
44
# You can edit the include path and order by changing the proguardFiles
55
# directive in build.gradle.
66
#
77
# For more details, see
8-
# http://developer.android.com/guide/developing/tools/proguard.html
9-
10-
# Add any project specific keep options here:
8+
# http://developer.android.com/guide/developing/tools/proguard.html
119

1210
# If your project uses WebView with JS, uncomment the following
1311
# and specify the fully qualified class name to the JavaScript interface
@@ -23,48 +21,16 @@
2321
##---------------Begin: proguard configuration for Gson ----------
2422
# Gson uses generic type information stored in a class file when working with fields. Proguard
2523
# removes such information by default, so configure it to keep all of it.
24+
-keepattributes EnclosingMethod
25+
-keepattributes InnerClasses
2626
-keepattributes Signature
27+
-keepattributes Exceptions
2728

2829
# For using GSON @Expose annotation
2930
-keepattributes *Annotation*
3031

31-
# Gson specific classes
32-
-keep class sun.misc.Unsafe { *; }
33-
#-keep class com.google.gson.stream.** { *; }
34-
35-
# Application classes that will be serialized/deserialized over Gson
36-
-keep class com.quickblox.core.account.model.** { *; }
37-
38-
39-
##---------------End: proguard configuration for Gson ----------
40-
#quickblox sample chat
41-
42-
-keep class com.quickblox.auth.parsers.** { *; }
43-
-keep class com.quickblox.auth.model.** { *; }
44-
-keep class com.quickblox.core.parser.** { *; }
45-
-keep class com.quickblox.core.model.** { *; }
46-
-keep class com.quickblox.core.server.** { *; }
47-
-keep class com.quickblox.core.rest.** { *; }
48-
-keep class com.quickblox.core.error.** { *; }
49-
-keep class com.quickblox.core.Query { *; }
50-
51-
-keep class com.quickblox.users.parsers.** { *; }
52-
-keep class com.quickblox.users.model.** { *; }
53-
54-
-keep class com.quickblox.chat.parser.** { *; }
55-
-keep class com.quickblox.chat.model.** { *; }
56-
57-
-keep class com.quickblox.messages.parsers.** { *; }
58-
-keep class com.quickblox.messages.model.** { *; }
59-
60-
-keep class com.quickblox.content.parsers.** { *; }
61-
-keep class com.quickblox.content.model.** { *; }
62-
63-
-keep class org.jivesoftware.** { *; }
64-
65-
#sample chat
66-
-keep class android.support.v7.** { *; }
67-
-keep class com.bumptech.** { *; }
32+
#quickblox sdk
33+
-keep class com.quickblox.** { *; }
6834

69-
-dontwarn org.jivesoftware.smackx.**
70-
-dontwarn android.support.v4.app.**
35+
#google gms
36+
-keep class com.google.android.gms.** { *; }

sample-pushnotifications-kotlin/app/src/main/AndroidManifest.xml

+7-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
<activity
1919
android:name=".activities.SplashActivity"
20+
android:exported="true"
2021
android:screenOrientation="portrait">
2122
<intent-filter>
2223
<action android:name="android.intent.action.MAIN" />
@@ -45,13 +46,17 @@
4546
</intent-filter>
4647
</service>
4748

48-
<service android:name="com.quickblox.messages.services.fcm.QBFcmPushListenerService">
49+
<service
50+
android:name="com.quickblox.messages.services.fcm.QBFcmPushListenerService"
51+
android:exported="false">
4952
<intent-filter>
5053
<action android:name="com.google.firebase.MESSAGING_EVENT" />
5154
</intent-filter>
5255
</service>
5356

54-
<service android:name="com.quickblox.messages.services.fcm.QBFcmPushInstanceIDService">
57+
<service
58+
android:name="com.quickblox.messages.services.fcm.QBFcmPushInstanceIDService"
59+
android:exported="false">
5560
<intent-filter>
5661
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
5762
</intent-filter>

sample-pushnotifications-kotlin/app/src/main/java/com/quickblox/sample/pushnotifications/kotlin/App.kt

+3-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package com.quickblox.sample.pushnotifications.kotlin
22

33
import android.app.Application
44
import android.util.Log
5-
import com.crashlytics.android.Crashlytics
65
import com.google.android.gms.common.GoogleApiAvailability
76
import com.quickblox.auth.session.QBSession
87
import com.quickblox.auth.session.QBSessionManager
@@ -11,15 +10,14 @@ import com.quickblox.auth.session.QBSettings
1110
import com.quickblox.messages.services.QBPushManager
1211
import com.quickblox.sample.pushnotifications.kotlin.utils.ActivityLifecycle
1312
import com.quickblox.sample.pushnotifications.kotlin.utils.shortToast
14-
import io.fabric.sdk.android.Fabric
1513

16-
//App Credentials
14+
// app credentials
1715
private const val APPLICATION_ID = ""
1816
private const val AUTH_KEY = ""
1917
private const val AUTH_SECRET = ""
2018
private const val ACCOUNT_KEY = ""
2119

22-
//Default user config
20+
// default user config
2321
const val DEFAULT_USER_PASSWORD = "quickblox"
2422

2523
class App : Application() {
@@ -38,7 +36,6 @@ class App : Application() {
3836
checkConfig()
3937
initCredentials()
4038
initQBSessionManager()
41-
initFabric()
4239
initPushManager()
4340
}
4441

@@ -53,7 +50,7 @@ class App : Application() {
5350
QBSettings.getInstance().init(applicationContext, APPLICATION_ID, AUTH_KEY, AUTH_SECRET)
5451
QBSettings.getInstance().accountKey = ACCOUNT_KEY
5552

56-
// Uncomment and put your Api and Chat servers endpoints if you want to point the sample
53+
// uncomment and put your Api and Chat servers endpoints if you want to point the sample
5754
// against your own server.
5855
//
5956
// QBSettings.getInstance().setEndpoints("https://your_api_endpoint.com", "your_chat_endpoint", ServiceZone.PRODUCTION);
@@ -109,10 +106,4 @@ class App : Application() {
109106
}
110107
})
111108
}
112-
113-
private fun initFabric() {
114-
if (!BuildConfig.DEBUG) {
115-
Fabric.with(this, Crashlytics())
116-
}
117-
}
118109
}

0 commit comments

Comments
 (0)