watch framework with healthkit capabilities - frameworks

Is possible to create dynamic watch framework with healthkit capabilities?
I have created a watch framework (File > New Target > Target > [WatchOS] Watch Framework ) that is suppose to do all the healthkit work iincluding starting a workout to get current user heart rate data.
I am aware that framework menu does not have "Capabilities" Tab like the Targets but nonetheless I have enable the main target to HealthKit (with entitlements). The HealthKit framework and entitlements to have the newly created framework as a selected option but i still get the below error, any suggestions?
"Missing com.apple.developer.healthkit entitlement."

Related

CloudKit Entitlement missing

I wanted to implement CloudKit into my application, however I can't add it into my project.
Most tutorials were made in an older Xcode version (I assume) where they had a switch for iCloud - In my project (Xcode 11) this is not the case. The Capabilities Tab looks like this for me:
As you can see there is no iCloud or CloudKit option.
I can import CloudKit in the code, but I get the runtime error 'The application is missing required entitlement com.apple.developer.icloud-services' I assume this is because I didn't add it to capabilities.
Note that I did create the project with CloudKit enabled:
Does anyone know where I can add the entitlement to the project? Or how else I can include CloudKit into my project?
The capabilities available to an iOS app depend on your program membership.
iCloud is only available to paid members of the Apple Developer Program.
The free tier of Apple Developer only has access to following capabilities (which are the one's you have shown as available):
App Groups
Background Modes
Data Protection
HealthKit
HomeKit
Inter-App Audio
Keychain Sharing
Maps
Wireless Accessory Configuration
I've attached a link which shows the full list supported capabilities for each membership level.
Supported Capabilities for Membership levels

Setting up HealthKit on Independent Apple Watch app

I am creating an independent Apple Watch app that is not linked to an iPhone app. How can I request access to HealthKit data directly from the Apple Watch without requesting the HealthKit data via an iPhone app.
Apple recently announced that developers could now create independent Apple Watch apps in WWDC 2019, but I'm not finding documentation on how to use HealthKit on independent apps. I started following the instructions on this page here
https://developer.apple.com/documentation/healthkit/setting_up_healthkit
but the problem that I'm running into is that I can't figure out how to set the necessary custom messages for NSHealthShareUsageDescription and NSHealthUpdateUsageDescription. Apples documentation says to do this through the Info.plist, but I can't find these options anywhere for the just the Apple Watch.
Can anyone show how to use HealthKit for an independent Apple Watch app?
In Xcode's project navigator on the left, your WatchKit extension group contains the Info.plist where you'll add your NSHealthShareUsageDescription and NSHealthUpdateUsageDescription messages. Add the HealthKit setup and authorization code from the article you linked in say, your extension delegate, and you're good to go.

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

Invalid WatchKit Support - The bundle contains an invalid implementation of WatchKit

I am trying to upload my apple watch app to iTunes, every time i am uploading my binary i am getting following mail from apple team.I have done with my following checklist.
Created separate App id and profile for watchapp and extension.
I have the correct set of images for apple watch as well as iOS app.
my app was initially built with Xcode 6.2 SDK and now i am submitting with 6.3 SDK.
Don't know where i am doing wrong. can anyone with experience help me out here.
We have discovered one or more issues with your recent delivery for
"XXXXX". To process your delivery, the following issues must be
corrected:
Invalid WatchKit Support - The bundle contains an invalid
implementation of WatchKit. The app may have been built or signed with
non-compliant or pre-release tools. Visit developer.apple.com for more
information.
Once these issues have been corrected, you can then redeliver the
corrected binary.
The problem for me was that the "IOS Deployment Target" in Build Settings for my WatchKit App and my WatchKit Extension were not both the same. My extension was set to 8.3 and my WatchKit App was set to 8.2. Once I set them both to 8.2 the error went away and the WatchKit App installed just fine.
While uploading apple watch app, it need to have apple watch extension into embedded binary of iOS app. But if you are habbitat to delete derived data then xcode6 will delete that target. and when you submit it to apple it will only get ios app not apple watch app.
Adding Embedded Binaries fails in Xcode
Xcode won't link framework form separate project
App crashes on device because of missing framework, works in simulator
Overview
After deleting the "DerivedData" folder (or performing a "Product > Clean") in xcode6, I cannot add CocoaTouch frameworks from another project to the "Embedded Binary" section (under General tab).
Or, Xcode hits a linker error because it cannot find a framework that if previously could.
Other symptoms
Clicking on the + under "Embedded Binaries" shows the Framework selector but selecting a framework in different project in the workspace does nothing.
I've been tearing my hair out over this one too. Here's what I've tried:
I've generated new provisioning profiles for the app, the watchkit extension, and the watchkit app, using unique bundle identifiers for each (com.example.app, com.example.app.watchkitextension & com.example.app.watchkitapp) and a distribution certificate. Downloaded, installed, and set each target to its own provisioning profile in Build Settings > Provisioning. Tried explicitly setting signing authority AND leaving it on automatic.
I've confirmed that the xcarchive contains a WatchKitSupport directory and WK file when I Show Package Contents of the archive
I've ensured that WatchKit Extension, WatchKit app, and IOS app all have matching build and version numbers
I ran Edit > Convert > To Latest Swift Syntax... on the app, extension, and watchkit targets (no source changes were required in my case..)
I've compiled from scratch, cleaned, built, & archived, rinsed and repeated, restarted system and looped again.
In my case, none of those worked. Hope one of them helps you. And if any other kind soul out there has fixed this without going bald, share the hair, man, share the hair.

App store say "requires iOS 4.0" but deployment target is 3.1.3

I have just have my app approved in the App Store, but only devices running 4.0 can download it.
The project settings in Xcode says "base SDK 4.0" and the "deployment target 3.1.3".
Is there some other setting or value in my plist file or thing I have set in iTunes connect that could yield such a result.
I use no 4.0-only API's and would like people running 3.1.3 and up to be able to use the app.
There is a bug in XCode that I think may be the reason for your problem: You need to do all the project settings BOTH for the current target (select target and hit cmd + i) and in the project settings (project > edit project settings). The two forms are absolutely identical and hold the same information, however they do not correspond to each other - changes made in one form wouldn't reflect in the other. So, make sure to fill in the necessary information in both places and also make sure you're using the same configuration (debug, release,..) for each form.
edit: I'm not quite sure if this is really a bug or rather a feature - it caused me some trouble however because of similar problems with producing builds for ad hoc distribution.