Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOS] terminated and background state call not working #151

Closed
Tim-byte-afk opened this issue Jun 6, 2024 · 7 comments
Closed

[IOS] terminated and background state call not working #151

Tim-byte-afk opened this issue Jun 6, 2024 · 7 comments

Comments

@Tim-byte-afk
Copy link

Tim-byte-afk commented Jun 6, 2024

Hello, thank you for your work and support. I have a problem with incoming calls not showing up when the app is in the background or closed. If the app is in the foreground then the call is showing up fine.

I use:

<key>UIBackgroundModes</key>
  <array>
    <string>fetch</string>
    <string>remote-notification</string>
    <string>voip</string>
  </array>

I send:

[VoIPController][pushRegistry][didReceiveIncomingPushWith] payload: [AnyHashable("ios_voip"): 1, AnyHashable("caller_name"): Test Test, AnyHashable("call_type"): 0, AnyHashable("session_id"): 2a3eb904-9640-4a93-a645-9a53c33c2772, AnyHashable("call_opponents"): 9503, AnyHashable("caller_id"): 5475, AnyHashable("message"): Входящий вызов, AnyHashable("signal_type"): startCall, AnyHashable("aps"): {
    alert = VoIP;
}]
[CallKitController][reportIncomingCall] call data: 2a3eb904-9640-4a93-a645-9a53c33c2772, 0, 5475, Test Test, [9503], nil
[CallKitController][reportIncomingCall] report new call: 2a3eb904-9640-4a93-a645-9a53c33c2772
[VoIPController][didReceiveIncomingPushWith] reportIncomingCall SUCCESS
[CallKitController][configureAudioSession] active: true
[CallStreamHandler][onListen] actionListener: incomingCall
flutter: [initEventsHandler] rawData: {uuid: 2a3eb904-9640-4a93-a645-9a53c33c2772, args: {caller_name: Test Test, call_type: 0, call_opponents: 9503, session_id: 2a3eb904-9640-4a93-a645-9a53c33c2772, caller_id: 5475}, event: incomingCall}
flutter: [CallEvent.fromMap] map: {caller_name: Test Test, call_type: 0, call_opponents: 9503, session_id: 2a3eb904-9640-4a93-a645-9a53c33c2772, caller_id: 5475}

But when the app is in the background or terminated I don't get any event log, like nothing is being processed

@TatankaConCube
Copy link
Contributor

have you checked similar issues for this repo? can it be your case #115 or this #141

@Tim-byte-afk
Copy link
Author

Yes, I read all the issues here.
#115 about UIBackgroundModes, I specified the ones I used, this matches what is specified in the README
You write there that you need to additionally specify "audio" and "processing", but this does not match the README

#141 about the error that occurs on the lock screen, but I do not have a single error in the debug version, callkit is simply displayed in the foreground, in the background and when the screen is locked there is none

@Tim-byte-afk
Copy link
Author

Tim-byte-afk commented Jun 6, 2024

I test sending notifications from the console

curl -v -d '{"session_id":"48303339-9431-4f61-be83-45e545f28784","caller_id":378,"call_opponents":"[\"4444\"]","caller_name":"Test Test","call_type":0,"signal_type":"startCall","message":"incomingCall"}' -H "apns-topic: com.*****.voip" -H "apns-push-type: voip" --http2 --cert ~/certs/VOIP.pem:*****https://api.development.push.apple.com/3/device/***********************

@Tim-byte-afk
Copy link
Author

@TatankaConCube please, help

@TatankaConCube
Copy link
Contributor

have you any overrides in your ios/Runner/AppDelegate.swift file for VoIP notifications? I have no ideas why it doesn't work in the terminated state but works in background and foreground(((

what device do you use for tests? is it a real device or a simulator?

@Tim-byte-afk
Copy link
Author

The solution turned out to be simple, need to initiate listening to events by adding:
ConnectycubeFlutterCallKit.initEventsHandler();

Perhaps this should be added to the README

Thanks for responding

@kevin4dhd
Copy link

The solution turned out to be simple, need to initiate listening to events by adding: ConnectycubeFlutterCallKit.initEventsHandler();

Perhaps this should be added to the README

Thanks for responding

Where did you add that code, in the main? Could you show an example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants