How to run Call Directory Extension? - ios

I'm working on Call Directory Extension. This extension was added, however I don't have any idea to execute this. Excuted this extension, and 'Choose an app to run' appeared, selected my main app, but it didn't seem to run. Of course added this app on Settings - Phone - Call Blocking & Identification.
I just added extension, and didn't write any code on both of the main app and extension. Do I need to add some code? Searched for several hours, couldn't find solution. Please help.

Call directory extension is just a new scheme which is about to add with Main application.
You just need to enable your application from settings menu as -
Go to Settings->Phone->Call blocking & identification->Enable your
App.
Hence there is nothing like "Choose with app" like things

Firstly, make sure you have added country code in the numbers you are using in the code.
And then follow these steps :
1) Delete the app from the device.
2) Run the app from Xcode setting the scheme of your main app. This will launch the app on your device.
3) Then change the scheme to your extension’s target and then run again.
Wait for a minute (as extension takes time to load) and then call from the number that you have provided the ID for. The call screen should display the corresponding name.
If the above steps don’t work,
Go to Settings -> General -> Reset -> Reset All Settings. This will clear all the settings on the device. Once this is done, do the above steps again.
This worked for me. If it helps, let me know

Related

iOS - SiriKit Intent Extension - Cannot see prints nor hit breakpoints

I'm trying to incorporate SiriKit intents into my application. I followed all the instructions including
Enable SiriKit
Add the usage string in Info.plist
Add the intent extension target to the project
Add the intent I want to support in the Info.plist of that new target
Add my handler method for the intent
Add the SiriKit authentication request in the AppDelegate
When I open Siri now and I ask the required question for the intent it does ask me if I want to open my app, so I go ahead and click yes and my app is opened. However, no print-statement in my intent handling method nor a breakpoint in there is hit.
I also tried starting the intent extension scheme via the run button in Xcode, I select my app on the popped up drop down, but then nothing on the phone appears and it just says Finished running my app on the device, no print statement or breakpoints hit either.
Does anybody know what I'm doing wrong here?

transfer my own app from device to xcode

I have built an ios app which I have tested successfully on my ios device. Since last build Ive had to rebuild my laptop and as such Ive lost my xcode project. Is there a way I can transfer the app from my device back into xcode?
The way you are getting your thing is totally different. However you can recover some part of your project data like images, what framework you have used etc.
First you need to connect your device with your system, then open iTunes and select your app then download that app. Now you have to click on that app see option for Show In Finder and click it
If you see your .ipa file, then make it a zip of it and then unzipped it, a payload name folder will appear on your screen. you will see appName.app, right click on it and select show package contents. This will show the app package contents. You can recover few data from that. But if you are thinking to recover code level data then it is not possible.
And you need to make a backup of your project whenever you make any updations so that any accident happened does not affect your main project.
No that´s not possible to do... Next time use Source Control such as Git for example to keep track of your code and prevent this happening in the future (that´s one of many benefits of source control).

Debug iOS App Share Extension with Contacts

I am just starting out with iOS App Share Extension and dutifully followed the instructions for Xcode 8.1 to create a new target. Great, it gave me some simple boilerplate code and a scheme. I then put some breakpoints on the code view that was generated and tried to run the extension target.
It asks me for an app. Hm, I didn't see Contacts, so chose my app instead.
My app appears in the simulator.
I close (home) my app and start Contacts.
I go to share a contact and my extension shows!!!
I tap it and a generic dialog appears.
But nothing shows up in my debugger or in my log from print.
What switch am I missing?

Sirikit launching the app fully instead of showing in own scroll

I have just created single view controller app and adding targets with Siri extensions( intents and intent ui extension).
But when I say Siri command to start the intent it just launching the app instead of showing in Siri view itself. Since I have started exploring Siri please let me know the issue and if any tutorial I can go through
I had the same problem. The bug was that the extension's plist contained the wrong entry in NSExtensions->NSExtensionAttributes->IntentsSupported – obviously the default Xcode actions are incorrect.
What you need to state there are the actual class names of the intents you handle, not their names as per the intentdefinition file.
Disabling 'copy only when installing' under Embed App Extensions in main target build phases fix the issue for me.
You should follow these steps:-
Add intents and intentsUI(if you need to customize default UI) as
extension
Override the Intent handers
Mention your intents in info.plist
Allow app to be accible by siri in phone settings
The best way to start is to go thru the SiriKit Programming Guide
Also, you can get some sample code from Apple here

How do I debug my Siri (Intents) extension?

I'm building a Siri aka Intents extension.
I do understand that I can attach the debugger to a running process after start, however, I never see my process. I do have the authorization for my app set to active and the extension must be running at least for some time, Siri is showing clear responses.
By the Apple documentation, you should run the Extension Scheme with Siri as host app. However, if I try that nothing happens on the device, it's waiting to attach for ever. Apple mentions the first connection can take "several minutes", but not hours ...
Any idea where I'm going wrong or how to achieve a connection to the debugger? Or at least some console output?
just select your siri extension scheme and hit run button, then xcode will prompt a list of applications for you to choose, just choose your app, for more details, please checkout the article:http://jamesonquave.com/blog/adding-siri-to-ios-10-apps-in-swift-tutorial/
Run your app in device first.
Select SIRIKIT extension scheme run in your device, select your app from the list prompted.
Wait for SIRI to be active, send your running SIRIKIT extension into background.(Some times you need not to do this step also).
Activate SIRI by pressing home button again, give a command and you will see your breakpoints working inside Intent Handler.
In my case, Xcode 13.X, iOS15
Change target to you intent extension
Run extension and choose your App
After App launch, trigger your shortcut(you can use Siri or just tap shortcut)
You will see your breakpoints working inside Intent Handler
I tried all the ways and it didn't work I think it's because I have a mac too old (2010) and has no ability to process.
This is a very hack solution to debug but it works.
Create a webhook using this site https://webhook.site
Then if you want to check if you code was in some point just add this code:
(Don't forget to change the URL for the same that you received webhook)
let url1 = URL(string: "https://webhook.site/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/your_code_was_here")!
let task1 = URLSession.shared.dataTask(with: url1)
task1.resume()
Then you just need to look again at the webhook site to see if the GET request got there.

Resources