File tree Expand file tree Collapse file tree 4 files changed +27
-17
lines changed
src/main/kotlin/com/hiennv/flutter_callkit_incoming Expand file tree Collapse file tree 4 files changed +27
-17
lines changed Original file line number Diff line number Diff line change 1+ ## 2.5.7
2+ * Fix build Android
3+ * Fix stop sound notification when screen off Android
4+
15## 2.5.6
26* Fix bug duplicate permission Android
37* Replaces MediaPlayer with Ringtone Android
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ apply plugin: 'com.android.library'
2828apply plugin : ' kotlin-android'
2929
3030android {
31- compileSdk 34
31+ compileSdk 35
3232
3333 if (project. android. hasProperty(" namespace" )) {
3434 namespace " com.hiennv.flutter_callkit_incoming"
@@ -39,10 +39,19 @@ android {
3939 }
4040 defaultConfig {
4141 minSdk 16
42- targetSdk 34
42+ targetSdk 35
4343
4444 consumerProguardFiles ' consumer-rules.pro'
4545 }
46+
47+ compileOptions {
48+ sourceCompatibility JavaVersion . VERSION_17
49+ targetCompatibility JavaVersion . VERSION_17
50+ }
51+
52+ kotlinOptions {
53+ jvmTarget = " 17"
54+ }
4655}
4756
4857java {
@@ -51,10 +60,6 @@ java {
5160 }
5261}
5362
54- kotlin {
55- jvmToolchain(17 )
56- }
57-
5863dependencies {
5964 implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version "
6065 implementation ' androidx.core:core-ktx:1.13.1'
Original file line number Diff line number Diff line change @@ -33,37 +33,38 @@ class CallkitSoundPlayerManager(private val context: Context) {
3333 private var screenOffCallkitIncomingBroadcastReceiver = ScreenOffCallkitIncomingBroadcastReceiver ()
3434
3535
36- init {
37- val filter = IntentFilter (Intent .ACTION_SCREEN_OFF )
38- context.registerReceiver(screenOffCallkitIncomingBroadcastReceiver, filter)
39- }
40-
41-
4236 fun play (data : Bundle ) {
37+ this .isPlaying = true
4338 this .prepare()
4439 this .playSound(data)
4540 this .playVibrator()
46- this .isPlaying = true
41+
42+ val filter = IntentFilter (Intent .ACTION_SCREEN_OFF )
43+ context.registerReceiver(screenOffCallkitIncomingBroadcastReceiver, filter)
4744 }
4845
4946 fun stop () {
5047 this .isPlaying = false
48+
5149 ringtone?.stop()
5250 vibrator?.cancel()
53-
5451 ringtone = null
5552 vibrator = null
53+ try {
54+ context.unregisterReceiver(screenOffCallkitIncomingBroadcastReceiver)
55+ }catch (_: Exception ){}
5656 }
5757
5858 fun destroy () {
5959 this .isPlaying = false
60- context.unregisterReceiver(screenOffCallkitIncomingBroadcastReceiver)
6160
6261 ringtone?.stop()
6362 vibrator?.cancel()
64-
6563 ringtone = null
6664 vibrator = null
65+ try {
66+ context.unregisterReceiver(screenOffCallkitIncomingBroadcastReceiver)
67+ }catch (_: Exception ){}
6768 }
6869
6970 private fun prepare () {
Original file line number Diff line number Diff line change 11name : flutter_callkit_incoming
22description : Flutter Callkit Incoming to show callkit screen in your Flutter app.
3- version : 2.5.6
3+ version : 2.5.7
44homepage : https://github.com/hiennguyen92/flutter_callkit_incoming
55repository : https://github.com/hiennguyen92/flutter_callkit_incoming
66issue_tracker : https://github.com/hiennguyen92/flutter_callkit_incoming/issues
You can’t perform that action at this time.
0 commit comments