Skip to content

Commit ea2c6a7

Browse files
author
ariefnurputranto
committed
support android 12
1 parent ca87685 commit ea2c6a7

File tree

8 files changed

+43
-14
lines changed

8 files changed

+43
-14
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ apply plugin: 'com.android.application'
1818
apply from: rootProject.file('gradle/quality.gradle')
1919

2020
android {
21-
compileSdkVersion 30
21+
compileSdkVersion 31
2222
defaultConfig {
2323
applicationId "com.qiscus.dragonfly"
2424
minSdkVersion 16
25-
targetSdkVersion 30
25+
targetSdkVersion 31
2626
versionCode 1
2727
versionName "1.0"
2828
multiDexEnabled true

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
android:label="@string/app_name"
1010
android:largeHeap="true"
1111
android:theme="@style/AppTheme">
12-
<activity android:name=".MainActivity">
12+
<activity android:name=".MainActivity"
13+
android:exported="true">
1314
<intent-filter>
1415
<action android:name="android.intent.action.MAIN" />
1516

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ buildscript {
2121
google()
2222
}
2323
dependencies {
24-
classpath 'com.android.tools.build:gradle:4.1.0'
24+
classpath 'com.android.tools.build:gradle:4.1.3'
2525
classpath 'com.google.gms:google-services:4.2.0'
2626

2727
// NOTE: Do not place your application dependencies here; they belong

chat-core/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
1616
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
1717

18+
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
19+
1820
<application>
1921
<receiver
2022
android:name=".service.QiscusStartServiceReceiver"

chat/src/main/AndroidManifest.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@
3333
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
3434
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
3535

36+
<queries>
37+
<!-- Browser -->
38+
<intent>
39+
<action android:name="android.intent.action.VIEW" />
40+
<data android:scheme="https" />
41+
</intent>
42+
43+
<!-- Camera -->
44+
<intent>
45+
<action android:name="android.media.action.IMAGE_CAPTURE" />
46+
</intent>
47+
48+
<!-- Gallery -->
49+
<intent>
50+
<action android:name="android.intent.action.GET_CONTENT" />
51+
</intent>
52+
</queries>
53+
3654
<application android:largeHeap="true">
3755
<activity
3856
android:name=".ui.QiscusChatActivity"

chat/src/main/java/com/qiscus/sdk/util/QiscusPushNotificationUtil.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import androidx.core.app.RemoteInput;
3434
import androidx.core.content.ContextCompat;
3535
import androidx.core.util.Pair;
36+
37+
import android.os.Build;
3638
import android.text.TextUtils;
3739

3840
import com.bumptech.glide.request.target.SimpleTarget;
@@ -270,8 +272,14 @@ private static void pushNotification(Context context, QiscusComment comment,
270272
PendingIntent pendingIntent;
271273
Intent openIntent = new Intent(context, QiscusPushNotificationClickReceiver.class);
272274
openIntent.putExtra("data", comment);
273-
pendingIntent = PendingIntent.getBroadcast(context, QiscusNumberUtil.convertToInt(comment.getRoomId()),
274-
openIntent, PendingIntent.FLAG_CANCEL_CURRENT);
275+
276+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
277+
pendingIntent = PendingIntent.getBroadcast(context, QiscusNumberUtil.convertToInt(comment.getRoomId()),
278+
openIntent, PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_CANCEL_CURRENT);
279+
} else {
280+
pendingIntent = PendingIntent.getBroadcast(context, QiscusNumberUtil.convertToInt(comment.getRoomId()),
281+
openIntent, PendingIntent.FLAG_CANCEL_CURRENT);
282+
}
275283

276284
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context, notificationChannelId);
277285
notificationBuilder.setContentTitle(pushNotificationMessage.getRoomName())

dependencies.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ repositories {
2828
ext {
2929

3030
minSDKVersion = 16
31-
targetSDKVersion = 30
32-
compileSDKVersion = 30
31+
targetSDKVersion = 31
32+
compileSDKVersion = 31
3333

3434
versions = [
35-
support : "30.0.0",
35+
support : "31.0.0",
3636
firebaseCore : "19.0.0",
3737
firebaseMessaging: "22.0.0",
3838
okHttp : "3.12.5",
@@ -73,7 +73,7 @@ ext {
7373

7474
qiscusMqttDeps = [
7575
client : "org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.0",
76-
android: "com.qiscus.mqtt:android:1.1.2"
76+
android: "com.qiscus.mqtt:android:1.1.6"
7777
]
7878

7979
okHttpDeps = [

gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
# === qiscus chat library version ===
3737
chatVersionMajor=2
3838
chatVersionMinor=31
39-
chatVersionPatch=0
39+
chatVersionPatch=1
4040

4141
# === qiscus chat-core library version ===
4242
chatCoreVersionMajor=1
4343
chatCoreVersionMinor=3
44-
chatCoreVersionPatch=34
44+
chatCoreVersionPatch=35
4545

4646
# === qiscus default base url
4747
BASE_URL_SERVER="https://api.qiscus.com/"
@@ -57,8 +57,8 @@ android.enableR8=true
5757

5858
libraryGroupId=com.qiscus.sdk
5959
libraryArtifactId=chat-core
60-
libraryVersion=1.3.34
60+
libraryVersion=1.3.35
6161

6262
libraryGroupIdChat=com.qiscus.sdk
6363
libraryArtifactIdChat=chat
64-
libraryVersionChat=2.31.0
64+
libraryVersionChat=2.31.1

0 commit comments

Comments
 (0)