0

I am developing an INStartCallIntent ... I want to invoke CallKit from confirm method of IntentHandler. but

func confirm(intent: INStartCallIntent) async -> INStartCallIntentResponse {
    //    CallManager.sharedInstance().delegate = self
    //    CallManager.sharedInstance().startCall(withPhoneNumber: "+923224123443")
        
        let userActivity = NSUserActivity(activityType: String(describing: INStartCallIntent.self))
        return INStartCallIntentResponse(code: .continueInApp, userActivity: userActivity)
    }

shows error Cannot find 'CallManager' in scope

enter image description here

while its in here

enter image description here

I implemented AppDelegate function but could not invoke it from IntentHandler.

- (void)application:(UIApplication *)application handleIntent:(INIntent *)intent completionHandler:(void (^)(INIntentResponse * _Nonnull))completionHandler{

//    if(intent == INStartCallIntent){
//        NSLog(@"Hey ... here it is");
//    }
}

CallManager.h added in project's bridging header file

enter image description here

Seems like its not accessible in IntentExtension.

CallManager Files are in kBeaconDemo_ios while they are not accessible in CallHomeAwayData IntentExtension.

enter image description here

How can I call CallManager after confirm? Please suggest

Azhar
  • 20,500
  • 38
  • 146
  • 211
  • 1
    Did you add `CallManager.h` to the `*Project*-Bridging-Header.h` file? See https://stackoverflow.com/questions/24002369/how-do-i-call-objective-c-code-from-swift?rq=1 – HangarRash Oct 31 '22 at 17:43
  • I edited the question with bridging header info .. CallManager is not accessible in IntentExtension while its accessible in rest of project both objective-c and swift files. – Azhar Nov 01 '22 at 02:33
  • I believe each target gets its own bridging header. Update the other target(s) as needed to use the bridging header. – HangarRash Nov 01 '22 at 03:04

0 Answers0