How I integrate SiriExtension to my Xcode 8 app - ios10

I'm trying to add SiriExtension to my app like below steps.
I've integrated Siri capabilities in my app like this:
Adding capability:
1- In the project settings, select your iOS app target and go to Capabilities tab
2- Enable the Siri capability
Adding the extension:
1- Go to File -> New -> Target...
2- Select iOS -> Application Extension from the left pane
3- Double-click Intents Extension from right
I added Siri Usage Description key in info.plist
I added INPreferences.requestSiriAuthorization in viewDidload
But still my app name is not showing in iPhone settings->Siri->Appsupport
What's going wrong? Please help me.

I faced similar kind of problem due to deployment target setting for Intent Extension. You have to set Deployment Target according to test device's OS version. You can see my answer here

Related

How to enable Healthkit in watch only app

Does anyone know how to enable Healthkit for an independent watchos only app ?
When i go to the projects target i can't find capabilities to add to the app.
Am i missing something ?
I tried looking for it in the project but could not find anything.
From the documentation i found following information:
In the Project navigator, select the project and in the project editor, select the target.
Choose the target from the Project/Targets pop-up menu or in the Targets section of the outline view if it appears.
In the project editor, click Signing & Capabilities.
Click All or select a specific build configuration.
For example, select Debug if you want to test a capability without adding it to a release build.
Click the + Capability button (Editor > Add Capability) to open the Capability library, .
The Capability library shows only the capabilities available to the target type and your program membership. If you are not a member of the Apple Developer Program, the capabilities you can add are limited.
I think it has to do something with the last line. I have no paid membership, and in a later project got the message that not more then 10 app'id's are allowed and i have to wait 7 days. So annoying.
Go to your project and under targets select project-name WatchKit Extension. Then under Signing and Capabilities you can tap the + icon on the top left and add HealthKit.
I recommend this series. One of the projects covers getting workouts setup for Apple Watch:
https://www.udemy.com/share/101CJkAkIbcldWQw

What is the difference between Apple's iMessage template or adding an extension to an existing app?

I have noticed this different regarding the creation of messages apps for iOS 10.
If you create a new project using iMessage Application choice on the new project's template, Xcode will create two targets, an app and an extension.
but the project is not able to run.
(see by this second picture that there is only one choice on the target selector at the bottom and that target is the extension).
When you create a normal app, like a single view app and then add a target that is an app extension of the type iMessage, you will have two targets there, the app and the extension.
My questions are:
Xcode iMessage's template is in fact creating just an extension, right? Not an app plus an an extension, correct?
If this is true, why in heavens name is Xcode creating the app target? What is the purpose of having an app target that compiles and appears on the products section with the extension .app if that is not in fact an app and will never run?
Or is in fact the extension just like a "remote control" running the code that is on the app? This is confuse, because by mistake I dragged a lot of content to the project and marked both targets to have them and the final thing doubled size, because the assets were copied to both targets.
The final question is: what will be submitted to Apple, just the extension or both?
Just to clarify -- iMessage extensions created using the template do not appear on the home screen. They only appear in the Messages app. If you add an iMessage extension to an existing app using the "Add Target" menu in Xcode, you are embedding your extension in a host app which appears on the home screen.
From what I can tell the job of the "app target" is literally to just sit there and hold your product name. In Beta 1, I believe the target didn't even have build settings. As of now, it has build settings but no build phases, and I'm guessing it will stay that way.
It does, however, appear in the Products folder after building, which makes me think it will somehow get submitted to the app store with the extension. Regardless, if you make sure your files' "Target Membership" is only set to the extension you should avoid any unnecessary size increase.
My guess is to make the whole thing consistent. I mean when you do an other extension (keyboard, widget etc) this has to come with an app. Here the situation is a bit more complex, we can do an iMessage app that will run by itself, or as an extension of an existing app... So when they developed the SDK they had to keep both way, but that's just a guess :)
Also I'm pretty sure that when submitting the iMessage app to the store, the main target will go with it, as it is the case with all other actual extensions.

How do I change xcode code sign identity and application name?

I have an ios application that runs on xcode 3.2.6. I want to change application name and application icon. I also want to use another developer identity. In xcode 3 I did not find how to change this and now I am moving to xcode 4.
To change the application icon go to Application Targets -> info - > and in the Icon file column write the name of the image with its extension example: abc.png and put the image in the project.
And for the development identity select project and select Build Setting and choose Code Signing column and set the appropriate profile.

Uploading App - Where is the Configuration Field in XCode 4?

I'm trying to upload my first app to App Store. I'm following the instructions in the iOS Provision Portal. The problem is that all the instructions and screen shots are still relevant to XCode previous version...
I'm stuck in Distribution tab in the section called Building your Application with XCode for Distribution in instruction #4 (see screen shot attached).
It says "In the Target Info window, select the ‘Build’ tab and set the ‘Configuration’ to ‘Distribution’".
Where do I find this Configuration field in XCode 4?
In left view listing files etc in xcode, go to the top and click the project name. You'll see target etc show up on right.
Xcode 4 is different from Xcode 3 so you'll have to navigate and check it out.
Update: The configuration option has been converted into schemes. You can create schemes for debug, distribution etc and once the scheme is selected you can configure that target as well.
Info on schemes

There is no SDK with the name or path "iphoneos4.0"

I download a sample of UICatalog and run it.When I compile it ,it shows the failed message:There is no SDK with the name or path "iphoneos4.0".I find the "Base SDK" of UICatalog's Targets is iphone Device 4.0(missing).How can I solve this question and run it.
Thank you!
Select the root level of the project, in "Groups & Files". It's blue. Then hit command-I to get its Info.
Pick "Build" from the segmented controller at the top of the info window. In the first section of that panel you'll see Base SDK as one of the first few lines of options. Select the latest version of the SDK you find in there, and close the window to save your options.
Build-and-run the project, and you should be good to go.
EDIT, because I see from the comments that people are finding this answer who have a slightly different question than the OP's, so here's one other thing to try. It could also be you have "iOS Device" selected as your build target. If so, and if what you really want is for it to launch into the simulator, select "Simulator" instead.
After loading the project into XCode..
Under Groups and Files
right click on UICatalog<-(or your demo project name) and select Get Info
in Base SDK select IOS Simulator 4.1
Close and save info pane
expand Targets exposing UICatalog<-(or demo project name)
right click on UICatalog and select Get Info
in Base SDK select IOS Simulator 4.1
Combo box in UICatalog project pane (upper left corner) should switch to "Device - 4.1 | Debug" instead of "No Base SDK"
if you Build and Run at this point you might get another error. If so, open the UICatalog combo and switch from Device to Simulator
The "official link" mentioned above states…
"Note: Targets can override build settings defined at the Project level. "
..but should probably read "will" instead of "can"
Ok, I've solved it.
In Groups & Files go to Targets and select your target.
Press Ctrl+I (or open the info in some other way)
Set the Base SDK of your target
(The Base SDK should also be set at the project)
Steve nailed it. This is an Xcode bug. I loaded the NavBar sample and Xcode didn't even offer the simulator as an option, and it complained about the missing SDK even though it was set correctly in the project and wasn't set at all on the target.
Do what Steve said:
"The only way I could resolve it (in fact, the only way I could get the option of running in the simulator at all) was to change from debug to release and back. The dropdown still shows Base SDK Missing but if you click it, the simulator options are there and it builds."
My problem was that in the sample code another xcodeproj was embedded. So I looked after that file with Finder, opened it with Xcode and than the same as Dan said: Project -> Edit Project Settings -> Under "Architectures" set Base SDK to "iPhone Simulator x.x" (the latest one you have installed)
I had the same issue with another Apple sample app. The only way I could resolve it (in fact, the only way I could get the option of running in the simulator at all) was to change from debug to release and back. The dropdown still shows Base SDK Missing but if you click it, the simulator options are there and it builds.
I think that's a bug.
Many answers here, none seem to be complete enough about this, and it's all a mess. But they are all helpful. Here, I just want to compile all helpful pieces in one answer. Thanks to Larry (who have almost everything compiled into steps already), Steve, Dan Ray, dkk, geowar and lqf.
This picture from apple is a little decieving and outdated (talking about iOS SDK 4.0 and we're currently at 4.1) but it does show where you should change the project settings. Just select iPhone Simulator 4.0 if it was previously on iPhone Device 4.0.
Other than that, they say "Targets can override build settings defined at the Project level". So, yeah, also go ahead, open Targets and set all of their Base SDK back to default by pressing delete on it. If they were bolded, they'll become regular indicating a default value, which should be iPhone Simulator 4.0 if you did the first step right.
Just realize there are many places where Base SDK can be wrong:
Under Project Info
Under Target Info
Under different configurations for both Project and Target
And that under Target it should be set to default, which is value from Project.
There's still something about the overview combo sometimes having and sometimes not having more than 1 option such as "Device" and "Simulator" that I just couldn't understand yet, but this is another potential configuration place for Base SDK being wrong.
You have to make sure that you change to the "iPhone Simulator" under the project settings in the appropriate configuration (i.e. if you are building a debug build you have to change to the simulator under the debug configuration).
For some reason I was getting this error when I did change the simulator but realized that I was doing a debug build but changed to the simulator under the release configuration and not the debug configuration.
dkk's answer is what made things work for me. I had to change the Base SDK on the target and not just the project. Perhaps you have to do both.
I got a similar error after upgrading my iPhone to iOS4.2.1(8C148a). The situation is as following.
I was using Xcode 3.2.4, but it does not support iOS4.2.1. So I downloaded Xcode_3.2.5_and_ios-sdk_4.2_final.dmg which is 3.78GB requiring 9.53GB to install. Then I ran my ap with Xcode 3.2.5. That is where I got the above error message.
Now it is ok. I solve this based on Geowar's answer:
For the official answer:
http://developer.apple.com/library/ios/#qa/qa2010/qa1701.html
Please be noted that if you have done as Geowar said and the message is still there. Try to close Xcode 3.2.5 and restart it. That is how it works for me.
Another thing is that if you have just upgraded to iOS4.2.1 like me. When you try to load the a/p from Xcode 3.2.5 the first time. Xcode 3.2.5 may still give you "No provision iOS device connected". Please try to go to organizer and click on your iPhone under DEVICES on the left bar. Wait for a while to let Xcode in sync with your iPhone with iOS4.2.1. Then it will work. At least it work for me.
Jesse
Ok, so I struggled through this too. Based on some of the answers above and from the apple development forum, I was able to figure out what worked for me.
In XCODE, if you notice that the pull down at the top left of the window says "BASE SDK MISSING", you are going to get this error "There is no SDK with the name or path “iphoneos4.0”". To fix the problem:
double click on Group & Files in the upper part of the left pane of xcode. This will open a window
go to the Build tab of the new window
click on the row that says "BaseSDK" and select "Latest iOS (currently set to iOS 3.2)
The Configurations pull down near the top should now say "All Configurations". If not, set it.
close the window.
Now if you try to build, you will get a different error, something like: Code Sign error: The identity 'iPhone Developer: x Xxxxx' doesn't match any identity in any profile ...
So, now what you need to do in xcode is to click on the pull down in the upper left corner (the pull down that had the original BASE SDK MISSING indication, but probably has something different now), and make sure that both "Simulator" and "Debug" are checked as options in the pull-down.
now you should be good to go.
I just went Project -> Edit Project Settings -> Build -> then change the Base SDK to iPhone 4 simulator or I'm assuming whichever SDK you want to use.
I never had to specify the build for a given target, although my program was created on a mac that was already configured to use the iPhone 4.0 simulator.. so perhaps the targets were set for the simulator SDK and the project itself wasn't? Either way... just glad it works.
I was having the same problem and what I did to solve it was:
Go to Menu Project
Go to Set Active SdK
Select the option SIMULATOR instead of DEVICE
Build and Run and the ERROR has gonne!
I hope it works for you guys... =)
I just had a situation where I changed the Base SDK to 4.2 on my project after updating to Xcode 3.2.5, but I kept on getting the "There is no SDK..." error. I finally opened the project file (MyProject.xcodeproj/project.pbxproj) in a text editor and looked around. There was no mention of 4.0 anywhere, only 4.2. BUT when I then saved that file, it all started working in Xcode. Perhaps some permission on the file or something else. Have no idea really, but it worked.
I got this error when one of my configurations still referenced an old (iOS) SDK. Note that the error shouldn't have come up when I tried to build a totally different configuration (with correct Base SDK setting), so this smells like an XCode bug to me.
People suggesting that you don't set the base SDK in at target-level have probably never created projects which contain targets for different platforms all in one project file (in my case Mac and iOS targets, so setting the base SDK once in the project file is nonsense advice).