flutter_callkit_incoming
flutter_callkit_incoming copied to clipboard
[iOS 17] Can't play a sound when accepting call using callkit in ios 17, ios 15, 16 work fine.
[iOS 17] Can't play a sound when accepting call using callkit in ios 17 but just ios 15, 16 work fine.
@hiennguyen92 Can you help me?
it is works fine
@hiennguyen92 I use just audio to play sound, it work fine in ios 15,16 when accept call, but when I update it to ios 17 sound no play. So I research find err callkit with ios 17, Can you check it help me? Thank you https://github.com/ryanheise/just_audio/issues/1074
Are you using WebRTC @phuchuynh81qn ?
If you use webRTC, you should useManual and then configure as in the example (v2.0.1+1) didActivateAudioSession
didDeactivateAudioSession
@hiennguyen92 @pedromachadinho No, I no use webRTC, I use call kit and voip to push call with device and then use just audio to play audio sound but no play audio in ios 17. I research and find issue as link: https://forums.developer.apple.com/forums/thread/738940
@phuchuynh81qn In my opinion, you can try commenting out all the code in this function and then try again. it may have Interruption AVAudioSession https://github.com/hiennguyen92/flutter_callkit_incoming/blob/bf128fd69ad87b634c993ff779d69df390db9dce/ios/Classes/SwiftFlutterCallkitIncomingPlugin.swift#L428
@hiennguyen92 Thank you feedback but I try comment code of func sendDefaultAudioInterruptionNofificationToStartAudioResourceit but it still no work. Do you have any other solution?
@phuchuynh81qn I'm not sure how the problem occurs. However, there seems to be an AVAudioSession dispute between the two libs. I think you can try delay play audio a bit after accepting.
@hiennguyen92 When the call goes then I accept a call and I deplay it 2s before play , I test it in ios 15,16 it works fine.
@hiennguyen92 Is there a time when the call is active and Apple blocks the audio? I find many people with issues in ios 17 as link: https://github.com/hiennguyen92/flutter_callkit_incoming/issues/406
a phải set AVAudioSession để dùng ạ. e thấy a dùng just_audio, mà just_audio sử dụng https://github.com/ryanheise/audio_session https://github.com/ryanheise/audio_session/blob/master/ios/Classes/DarwinAudioSession.m audio_session dùng của sharedInstance
trong lib của e có callback ra didActivateAudioSession
didDeactivateAudioSession
e nghĩ a force cái lib kia, thêm 2 hàm set AVAudioSession cho nó thay cho cái sharedInstance, e nghĩ nó sẽ ok
@phuchuynh81qn hoặc a chờ nhận được event Event.actionCallToggleAudioSession: active=false, rồi hãy play audio
@hiennguyen92 A thử rồi mà nó vẫn bị á
E nghĩ khi đang call nó vẫn có cái interruption. A thử khi bấm accept xong thì chờ chút a endallCall luôn rồi play audio xem sao
@hiennguyen92 A endCall thì anh play bth á nhưng a muốn khi mình bấm accept cuộc thì nó phát ra âm thanh lúc đó, ios 15,16 thì nó chạy ngon lành, ios 17 là bị cái này không hiểu lun kaka
Vậy e thì nghĩ chỉ có cách như comment ở trên của e. Là a fork nó về rồi sửa cái just_section để nó sử dụng chung cái AVaudiosection
@hiennguyen92 I tried to play audio directly in Swift code but it didn't work. Can you help me?
you can try add this inside didActiveAudioSection
do {
try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default, options: [])
try AVAudioSession.sharedInstance().setActive(true)
} catch {
print("Error setting up AVAudioSession: \(error.localizedDescription)")
}
set active false inside didDeactivateAudioSection
I tried. But it still not work
@quanghd96 Nó không play đâu bác mình thử rồi á, này nhiều người bị rồi á.
@phuchuynh81qn nếu chỉ có nhu cầu bấm nút nghe thì phát 1 đoạn âm thanh gì đó mà phải dùng webrtc thì hơi kiểu dùng dao mổ trâu giết gà. Bác công nhận ko?
Tại bt cái này nó ưu tiên cho các cuộc gọi ott, voip. :D
@hiennguyen92 Hello e, Trên android có cách mô lấy event cuộc gọi đến khi app đã close rồi không e ơi. A dùng thèn này nhưng thấy một số device nó không support var calls = await FlutterCallkitIncoming.activeCalls();
I am having an issue and can not solve it for 3 months now :(
On iOS the onBackgroundMessage function from Fcm does't trigger at all. The notification arrive on time but the function doesn't trigger to start the incoming call screen :(
Somebody please share the solution.
thanks
@hiennguyen92 @Jazzykhan
After accepting the CallKit answer action, I am unable to hear the other person's voice on VoIP Push and Flutter Incoming Call Kit's latest version.
But the same issue is not occurring on flutter_callkit_incoming: 2.0.0+2 Old Version.
After I tried AVAudioSession enabling True in swift level also doesn't work
@kalyanchandra48 It not work in ios > 17 and it just work in ios < 17 . thank you