Skip to content

Commit 98d93ae

Browse files
committed
fix: ensure incoming call notification channel is created before checking its availability
1 parent 27fbf48 commit 98d93ae

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

android/src/main/kotlin/com/hiennv/flutter_callkit_incoming/CallkitNotificationManager.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ class CallkitNotificationManager(
180180
val notificationId =
181181
data.getString(CallkitConstants.EXTRA_CALLKIT_ID, "callkit_incoming").hashCode()
182182
createNotificationChanel(data)
183+
184+
if (incomingChannelEnabled()) {
185+
callkitSoundPlayerManager?.play(data)
186+
}
187+
183188
notificationBuilder = NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID_INCOMING)
184189
notificationBuilder?.setChannelId(NOTIFICATION_CHANNEL_ID_INCOMING)
185190
notificationBuilder?.setDefaults(NotificationCompat.DEFAULT_VIBRATE)
@@ -993,9 +998,6 @@ class CallkitNotificationManager(
993998
@SuppressLint("MissingPermission")
994999
fun showIncomingNotification(data: Bundle) {
9951000

996-
if (incomingChannelEnabled()) {
997-
callkitSoundPlayerManager?.play(data)
998-
}
9991001
val callkitNotification = getIncomingNotification(data)
10001002
callkitNotification?.let {
10011003
getNotificationManager().notify(

0 commit comments

Comments
 (0)