connectycube-flutter-call-kit icon indicating copy to clipboard operation
connectycube-flutter-call-kit copied to clipboard

Getting call notifications on iphone but not able to receive call

Open geetakher opened this issue 4 years ago • 5 comments

**please find below logs

This below logs from the sender side:**

/flutter (29521): CB-SDK: : ********************************************************* I/flutter (29521): *** RESPONSE *** 200 *** cd783fe3-8e0d-44b1-99e1-b7998b8cf568 *** I/flutter (29521): HEADERS I/flutter (29521): {cb-token-expirationdate: 2022-01-27 14:56:50 UTC, connection: keep-alive, date: Thu, 27 Jan 2022 12:56:50 GMT, strict-transport-security: max-age=15768000; includeSubDomains, content-length: 412, access-control-expose-headers: CB-Token-ExpirationDate, content-type: application/json; charset=utf-8, server: nginx/1.16.1} I/flutter (29521): BODY I/flutter (29521): {"user":{"_id":"61ee3698276f93005bbd41a0","id":5365103,"created_at":"2022-01-24T05:18:16Z","updated_at":"2022-01-27T12:50:48Z","last_request_at":"2022-01-27T12:50:48Z","login":"963ee51e2ff94bb6b15f18cae4226d8a","email":"[email protected]","full_name":"xyz","external_user_id":32,"phone":null,"website":null,"twitter_id":null,"facebook_id":null,"custom_data":null,"user_tags":null,"avatar":null,"external_id":null}} I/flutter (29521): I/flutter (29521): startNewCall{5365103} I/flutter (29521): startNewCallInstance of 'P2PClient' I/flutter (29521): P2PSession _currentCall I/flutter (29521): CB-SDK: : {parameters: {message: Incoming Audio call, call_type: 2, session_id: 3e097536-9389-4923-addf-4f424e2c8029, caller_id: 5352743, caller_name: null, call_opponents: 5365103, ios_voip: 1, signal_type: startCall, question_id: 366, seeker_id: 32, provider_id: 78, created_at: 2022-01-27 18:26:15}, notificationType: push, environment: development, eventType: null, usersIds: [5365103], externalUsersIds: [], usersTagsAll: [], usersTagsAny: [], usersTagsExclude: [], date: null, endDate: null, period: null, name: null} I/flutter (29521): CB-SDK: : ========================================================= I/flutter (29521): === REQUEST ==== d32d2e73-4a8a-4cec-b861-4069f00779b3 === I/flutter (29521): REQUEST I/flutter (29521): POST https://api.connectycube.com/events I/flutter (29521): HEADERS I/flutter (29521): {Content-type: application/json, ConnectyCube-REST-API-Version: 0.1.1, CB-SDK: Flutter 2.0.9, CB-Token: 1218D504DEE3E5E1CC4CE2E89345DEED8949} I/flutter (29521): BODY I/flutter (29521): {"event":{"id":null,"created_at":null,"updated_at":null,"notification_type":"push","environment":"development","message":"eyJtZXNzYWdlIjoiSW5jb21pbmcgQXVkaW8gY2FsbCIsImNhbGxfdHlwZSI6Miwic2Vzc2lvbl9pZCI6IjNlMDk3NTM2LTkzODktNDkyMy1hZGRmLTRmNDI0ZTJjODAyOSIsImNhbGxlcl9pZCI6NTM1Mjc0MywiY2FsbGVyX25hbWUiOm51bGwsImNhbGxfb3Bwb25lbnRzIjoiNTM2NTEwMyIsImlvc192b2lwIjoxLCJzaWduYWxfdHlwZSI6InN0YXJ0Q2FsbCIsInF1ZXN0aW9uX2lkIjoiMzY2Iiwic2Vla2VyX2lkIjoiMzIiLCJwcm92aWRlcl9pZCI6Ijc4IiwiY3JlYXRlZF9hdCI6IjIwMjItMDEtMjcgMTg6MjY6MTUifQ==","user":{"ids":"5365103"}}} I/flutter (29521): I/flutter (29521): Question==366 I/flutter (29521): Question==32 I/flutter (29521): Question==78 I/flutter (29521): CB-SDK: : start call null I/FlutterWebRTCPlugin(29521): getUserMedia(audio): mandatory: [], optional: [googNoiseSuppression: true, googEchoCancellation: true, echoCancellation: true, googEchoCancellation2: true, googDAEchoCancellation: true] D/FlutterWebRTCPlugin(29521): MediaStream id: 25f39c98-15ec-4075-9aee-5482881ad877 I/flutter (29521): CB-SDK: _ConversationCallScreenState: _addLocalMediaStream I/flutter (29521): CB-SDK: _ConversationCallScreenState: _onStreamAdd for user 5352743 I/org.webrtc.Logging(29521): EglRenderer: Initializing EglRenderer I/org.webrtc.Logging(29521): EglRenderer: EglBase.create shared context I/org.webrtc.Logging(29521): EglBase14Impl: Using OpenGL ES version 2 I/flutter (29521): CB-SDK: PeerConnection: _createOffer for opponent 5365103 I/org.webrtc.Logging(29521): EglRenderer: Duration: 4009 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA. I/org.webrtc.Logging(29521): EglRenderer: Duration: 4003 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA. I/org.webrtc.Logging(29521): WebRtcAudioRecordExternal: enableBuiltInAEC(true) I/org.webrtc.Logging(29521): WebRtcAudioEffectsExternal: setAEC(true) I/org.webrtc.Logging(29521): WebRtcAudioRecordExternal: enableBuiltInNS(true) I/org.webrtc.Logging(29521): WebRtcAudioEffectsExternal: setNS(true) I/org.webrtc.Logging(29521): NetworkMonitor: Start monitoring with native observer 528391510528 I/org.webrtc.Logging(29521): NetworkMonitorAutoDetect: Network becomes available: 614 D/FlutterWebRTCPlugin(29521): onIceGatheringChangeGATHERING I/flutter (29521): CB-SDK: PeerConnection: onSignalingState changed to RTCSignalingState.RTCSignalingStateHaveLocalOffer for opponent 5365103 I/org.webrtc.Logging(29521): NetworkMonitorAutoDetect: capabilities changed: [ Transports: WIFI Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&VALIDATED&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED LinkUpBandwidth>=42453Kbps LinkDnBandwidth>=44687Kbps SignalStrength: -39 AdministratorUids: [] RequestorUid: -1 RequestorPackageName: null] I/org.webrtc.Logging(29521): NetworkMonitorAutoDetect: link properties changed D/FlutterWebRTCPlugin(29521): onIceCandidate I/flutter (29521): CB-SDK: PeerConnection: onIceGatheringState changed to RTCIceGatheringState.RTCIceGatheringStateGathering for opponent 5365103 I/flutter (29521): CB-SDK: BaseSession: onIceGatheringStateChanged state= RTCIceGatheringState.RTCIceGatheringStateGathering for userId= 5365103 D/FlutterWebRTCPlugin(29521): onIceCandidate D/FlutterWebRTCPlugin(29521): onIceCandidate D/FlutterWebRTCPlugin(29521): onIceCandidate D/FlutterWebRTCPlugin(29521): onIceCandidate D/FlutterWebRTCPlugin(29521): onIceCandidate I/org.webrtc.Logging(29521): EglRenderer: Duration: 4003 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.

======== Exception caught by image resource service ================================================ The following ArgumentError was thrown resolving an image codec: Invalid argument(s): No host specified in URI

When the exception was thrown, this was the stack: #0 _HttpClient._openUrl (dart:_http/http_impl.dart:2662:9) #1 _HttpClient.openUrl (dart:_http/http_impl.dart:2568:7) #2 IOClient.send (package:http/src/io_client.dart:35:38) #3 HttpFileService.get (package:flutter_cache_manager/src/web/file_service.dart:35:44) #4 WebHelper._download (package:flutter_cache_manager/src/web/web_helper.dart:121:24) #5 WebHelper._updateFile (package:flutter_cache_manager/src/web/web_helper.dart:103:28) #6 WebHelper._downloadOrAddToQueue (package:flutter_cache_manager/src/web/web_helper.dart:71:7) Image provider: CachedNetworkImageProvider("", scale: 1.0) Image key: CachedNetworkImageProvider("", scale: 1.0): CachedNetworkImageProvider("", scale: 1.0)

D/FlutterWebRTCPlugin(29521): onIceCandidate D/FlutterWebRTCPlugin(29521): onIceCandidate I/org.webrtc.Logging(29521): EglRenderer: Duration: 4004 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA. D/FlutterWebRTCPlugin(29521): onIceCandidate I/org.webrtc.Logging(29521): EglRenderer: Duration: 4005 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA. I/flutter (29521): CB-SDK: : ********************************************************* I/flutter (29521): *** RESPONSE *** 201 *** d32d2e73-4a8a-4cec-b861-4069f00779b3 *** I/flutter (29521): HEADERS I/flutter (29521): {cb-token-expirationdate: 2022-01-27 14:56:52 UTC, connection: keep-alive, date: Thu, 27 Jan 2022 12:56:52 GMT, strict-transport-security: max-age=15768000; includeSubDomains, content-length: 1506, access-control-expose-headers: CB-Token-ExpirationDate, content-type: application/json; charset=utf-8, server: nginx/1.16.1} I/flutter (29521): BODY I/flutter (29521): [{"event":{"_id":"61f29694a06c820040ae59de","event_type":"one_shot","message":"eyJtZXNzYWdlIjoiSW5jb21pbmcgQXVkaW8gY2FsbCIsImNhbGxfdHlwZSI6Miwic2Vzc2lvbl9pZCI6IjNlMDk3NTM2LTkzODktNDkyMy1hZGRmLTRmNDI0ZTJjODAyOSIsImNhbGxlcl9pZCI6NTM1Mjc0MywiY2FsbGVyX25hbWUiOm51bGwsImNhbGxfb3Bwb25lbnRzIjoiNTM2NTEwMyIsImlvc192b2lwIjoxLCJzaWduYWxfdHlwZSI6InN0YXJ0Q2FsbCIsInF1ZXN0aW9uX2lkIjoiMzY2Iiwic2Vla2VyX2lkIjoiMzIiLCJwcm92aWRlcl9pZCI6Ijc4IiwiY3JlYXRlZF9hdCI6IjIwMjItMDEtMjcgMTg6MjY6MTUifQ==","user_id":5352743,"environment":"development","date":null,"period":null,"kind":"API","end_date":null,"active":true,"created_at":"2022-01-27T12:56:52Z","updated_at":"2022-01-27T12:56:52Z","tag_query":null,"name":null,"notification_channel":{"name":"apns_voip"},"id":764079391}},{"event":{"_id":"61f29694a06c820040ae59df","event_type":"one_shot","message":"eyJtZXNzYWdlIjoiSW5jb21pbmcgQXVkaW8gY2FsbCIsImNhbGxfdHlwZSI6Miwic2Vzc2lvbl9pZCI6IjNlMDk3NTM2LTkzODktNDkyMy1hZGRmLTRmNDI0ZTJjODAyOSIsImNhbGxlcl9pZCI6NTM1Mjc0MywiY2FsbGVyX25hbWUiOm51bGwsImNhb I/flutter (29521): I/flutter (29521): CB-SDK: : Event for offliners created: [{id: 764079391, created_at: 2022-01-27T12:56:52.000Z, updated_at: 2022-01-27T12:56:52.000Z, notification_type: null, environment: development, message: {message: Incoming Audio call, call_type: 2, session_id: 3e097536-9389-4923-addf-4f424e2c8029, caller_id: 5352743, caller_name: null, call_opponents: 5365103, ios_voip: 1, signal_type: startCall, question_id: 366, seeker_id: 32, provider_id: 78, created_at: 2022-01-27 18:26:15}, event_type: one_shot, notification_channel: apns_voip, user_id: 5352743}, {id: 689385009, created_at: 2022-01-27T12:56:52.000Z, updated_at: 2022-01-27T12:56:52.000Z, notification_type: null, environment: production, message: {message: Incoming Audio call, call_type: 2, session_id: 3e097536-9389-4923-addf-4f424e2c8029, caller_id: 5352743, caller_name: null, call_opponents: 5365103, ios_voip: 1, signal_type: startCall, question_id: 366, seeker_id: 32, provider_id: 78, created_at: 2022-01-27 18:26:15}, event_type: one_shot, notification_channel: ap I/org.webrtc.Logging(29521): EglRenderer: Duration: 4004 ms. Frame

This is log from receiver side "created_at" = "2022-01-27 18:26:15"; message = "Incoming Audio call"; "provider_id" = 78; "question_id" = 366; "seeker_id" = 32; "session_id" = "3e097536-9389-4923-addf-4f424e2c8029"; "signal_type" = startCall; } [FlutterCallKitPlugin][reportNewIncomingCall] uuidString = 3e097536-9389-4923-addf-4f424e2c8029, handle = 5352743, handleType = generic, hasVideo = 0, localizedCallerName = null, fromPushKit = 1 [FlutterCallKitPlugin][reportNewIncomingCall] uuid = 3E097536-9389-4923-ADDF-4F424E2C8029 [FlutterCallKitPlugin][getProviderConfiguration] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CXProviderConfiguration initWithLocalizedName:]: parameter 'localizedName' cannot be nil' *** First throw call stack: (0x1823e805c 0x19a902f54 0x18243f190 0x1a7a7bfcc 0x10411ed60 0x10411bff8 0x10411fb74 0x102850fc8 0x1028512a8 0x1b4753e34 0x182058c04 0x18205a950 0x182068d30 0x1823a0ce4 0x18235aebc 0x18236e3c8 0x19db7f38c 0x184d14060 0x184a91b8c 0x1028518c8 0x102be9a24) libc++abi: terminating with uncaught exception of type NSException

  • thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT frame #0: 0x00000001b8e399c4 libsystem_kernel.dylib__pthread_kill + 8 libsystem_kernel.dylib__pthread_kill: -> 0x1b8e399c4 <+8>: b.lo 0x1b8e399e4 ; <+40> 0x1b8e399c8 <+12>: pacibsp 0x1b8e399cc <+16>: stp x29, x30, [sp, #-0x10]! 0x1b8e399d0 <+20>: mov x29, sp Target 0: (Runner) stopped. Lost connection to device. Exited (sigterm)

geetakher avatar Jan 27 '22 13:01 geetakher

which version of the plugin do you use?

TatankaConCube avatar Jan 27 '22 14:01 TatankaConCube

it looks like the issue thrived not from this plugin but from the FlutterCallKitPlugin cause in logs I can see [FlutterCallKitPlugin][reportNewIncomingCall]

TatankaConCube avatar Jan 27 '22 14:01 TatankaConCube

Please do something I have implemented this below code in appdelegate which is the same in your demo

And one more thing can you please check again my log beacuse i am getting callername null from sender side to receiver so receiver side getting caller name null so it causing issue for the call and working in call from android to ios but not from ios to android

import Flutter import Firebase import PushKit import CallKit import flutter_voip_push_notification import flutter_call_kit

@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate, PKPushRegistryDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { FirebaseApp.configure() GeneratedPluginRegistrant.register(with: self) self.voipRegistration() if #available(iOS 10.0, *) { UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound] UNUserNotificationCenter.current().requestAuthorization( options: authOptions, completionHandler: { status, error in print("completionHandler") print("error = ", error) print("status = ", status) } ) } else { let settings: UIUserNotificationSettings = UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil) application.registerUserNotificationSettings(settings) } application.registerForRemoteNotifications() return super.application(application, didFinishLaunchingWithOptions: launchOptions) }

// Handle incoming pushes public func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Swift.Void){ print("didReceiveIncomingPushWith")

    FlutterVoipPushNotificationPlugin.didReceiveIncomingPush(with: payload, forType: type.rawValue)
    
    let signalType = payload.dictionaryPayload["signal_type"] as! String
    if(signalType == "endCall" || signalType == "rejectCall"){
        return
    }
    
    let uuid = payload.dictionaryPayload["session_id"] as! String
    let uID = payload.dictionaryPayload["caller_id"] as! Int
    let callerName = payload.dictionaryPayload["caller_name"] as! String
    let isVideo = payload.dictionaryPayload["call_type"] as! Int == 1;
    FlutterCallKitPlugin.reportNewIncomingCall(
        uuid,
        handle: String(uID),
        handleType: "generic",
        hasVideo: isVideo,
        localizedCallerName: callerName,
        fromPushKit: true
    )
    completion()
    
    
    
    

geetakher avatar Jan 27 '22 14:01 geetakher

i am getting callername null from sender side

why don't you send the caller's name from the sender's side?

I recall you that this issue is not related to the current repo, please create a ticket in the right repo and close current

TatankaConCube avatar Jan 27 '22 14:01 TatankaConCube

which is the same in your demo

some time ago we migrated our sample from third-party libs to this one, but in your example, you use FlutterCallKitPlugin which doesn't have any relations to this plugin

TatankaConCube avatar Jan 27 '22 14:01 TatankaConCube