How to enable Ios Callkit Call Directory extension - ios

I am trying to add the Callkit Call Directory extension to my React Native app so that I can add additional numbers that will show with caller id (populated from my app).
The Callkit documentation states:
"Before a Call Directory extension can operate on incoming calls, the user must explicitly enable the extension in the iOS Settings app."
However, there is no section for "Call blocking and identification" in my phone's settings (see here for similar issue: https://discussions.apple.com/thread/251896172)
I have tried using the openSettingsWithCompletionHandler method, which does open the settings on the phone, but still no option for "Call blocking and identification".
How can I let my app use this functionality if it cannot be seen in the phone settings? Am I doing something completely backward?
Thanks.

Related

Automating Callkit accept call

I am working on automating testing for Callkit interaction.
I managed to call from client A to B.
When B receives the call he is shown the Callkit screen.
Manually, I can click on accept and the call is established.
However when
I try to record the Callkit interaction, XCode is crashing and the application on the phone as well.
Am I breaking any security limitation by trying to automate the "Accept call" interaction?
As I am not able to access the Callkit screen element via interaction recording;
I am wondering if someone as any experience with that kind of automation or if someone could point me to the documentation that would describe the button ids for the Callkit screen.
You should determine the application of this screen. Probably, Springboard. Try inspecting with the Console app.
Then, initialise interaction with this app with let app = XCUIApplication(bundleIdentifier: )
Inspect app hierarchy with breakpoint and po app command to get labels and accessibility identifiers. Or use Accessibility Inspector.
Do required action is code (taps and/or swipes)
Thank you #Smart Monkey for putting me on the good track
I managed to accept the call using the Springboard app.
let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
springboard.buttons["Accept"].tap()
The call is then properly established.

How can we get text while user copying message from whats up , Skype and so on like third party app using iOS Swift?

Step 01: I can run my app (APP NAME : TextDetectAPP)
Step 02: User press Home button
Step 03:User open the Skype or any third party app (APP NAME : TextDetectAPPMove to Background state )
Spep04: User copy text (I need to get copy text from Skype or or any third party app )
Note :
UIpasteboard is working fine only user developed apps in iOS swift
Shall we have access rights to read text messages from Skype , whats up or any thirds parts apps in iOS swift?
Thanks in Advance
If I understand your question right, you want to get texts that were copied in other apps (Skype, FB etc.). You can do this using the UIPasteboard class. Usually texts are copied to the general pasteboard and you can access it without any problems (I've tried with Skype and Message (iOS) applications, it is working). When you open your app back, you can get the copied text from third party apps like this in the applicationDidBecomeActive delegate method:
func applicationDidBecomeActive(_ application: UIApplication) {
if let clipboardString = UIPasteboard.general.string {
print(clipboardString)
}
}
You can also use UIPasteboardChanged notification to listen to changes in pasteboard, however you cannot receive change notifications from other apps. Also your app may not be in background state all the time executing code (unless you enable some specific background modes like Audio, Airplay etc.). So there is no way for you to get the copied texts when you are in background. You either need to use the method above, (or) if your app supports background execution, you can have an NSTimer fire every n seconds that gets the pasteboard content.

WatchKit: direct communication with the containing iOS app

I just get started with WatchKit and I'm trying to do this (if I'm not wrong, it is possible to do): I'd like the WatchKit Extension to ask the containing app for requesting some data to a web service, and then return the service response to the Extension to update the WatchKit App interface accordingly.
As I read in Apple Watch Programming Guide, yo can call the openParentApplication:reply: method in the WatchKit Extension to request something to its containing app, and then the application:handleWatchKitExtensionRequest:reply: method in the AppDelegate of the containing app should be called. Once this method called, I need to perform the service request, wait for its response, and then send it back to the Extension.
However, when I run the WatchKit App scheme in the simulator, the openParentApplication:reply: method is called, but a breakpoint within the application:handleWatchKitExtensionRequest:reply: is not reached. So I'm not even able to test if I can correctly perform the web service request and get its response back.
What could I be missing? Should I configure somehow the schema to reach breakpoints in the containing app as well? Is it needed to declare some kind of background feature for this?
Thanks in advance
I just answered a very similar question here which will allow you to open the iOS app from the Watch Extension and getting a reply back.
In order to debug the iOS app while running the Watch Extension, you should follow the steps explained here.

Ios 8: Determine the destination app when my app goes to the background?

I override my app's openURL-method to know when we're about to leave the app from an ABPersonViewController, the reason being that that class doesn't notify its delegate on all of the actions it presents to the user. If it did everything would be fine.
This worked flawlessly in iOS 7, but when trying this in iOS 8.1 it turns out that the ABPersonViewController doesn't call openURL for all its actions anymore. For instance, tapping a phone number gets me to the phone app without calling openURL. Tapping the SMS bubble on the other hand will call openURL.
When tapping the facebook profile entry (with the URL "fb://profile/1234567890") the log says that "Launch Services" doesn't have a registered handler for the scheme "fb". So I'm assuming that calls to Launch Services have replaced the calls to openURL. I can't find out much more about it other than that it's "a private API".
Is there a way to detect these calls? Or, is it possible to override handlers for known schemes like "tel" and "mailto" internally for my app? I basically just need to know when we're leaving the app and where we're going.

iOS Extension - Detect "extension state changes" (Background/Foreground)

I have a share extension implemented for iOS8. The service uses OAuth to authenticate. The login info I use for the extension is shared with the container app.
The problem is:
When I am in the extension, then app switch to the container app and logout, and then app switch back to the host app containing the extension - How do I detect that the extension has just re-appeared? The extension is relying on certain information to be present in the shared DB between the container app and the extension, however, that data is removed when the app logs out.
I have tried registering for various "app notifications" such as UIApplicationDidBecomeActiveNotification. However, as expected, these aren't called for extensions.
How can I detect when the state of the extension changes such that I can make my extension more robust when it reappears?
The viewDidAppear:animated: method of your main view controller class should be called every time you reenter your extension. When you are about to leave, viewWillDisappear:animated: should be called.
See
NSExtensionContext.h
iOS 8.2 added a number of notifications to use for extensions:
NSExtensionHostDidBecomeActiveNotification
NSExtensionHostDidEnterBackgroundNotification
NSExtensionHostWillEnterForegroundNotification
NSExtensionHostWillResignActiveNotification

Resources