How to get a Nativescript app on Apple Watch and use Health Data? - ios

I'm trying to set up a basic nativescript app on Apple Watch 3 which reads Heart Rate data. I realize that I would need WatchKit, but how do I set up the app, Sidekick only gives the option of iPhone or iPad.
Also, what's the Nativescript way of writing companion code for the iPhone which will receive this data from the phone?

Apple Watch Integration will be available in next {NS} release.
https://www.nativescript.org/roadmap-and-releases#releases

Related

creating iOS app for Apple TV using titanium appcelerator

I have created iOS app using appcelerator titanium I want to know if this created app will run on Apple TV or will need to create separate app for Apple TV ?
The idea is to have single ipa that supports iPhone, iPad and Apple TV.
I googled but couldn't find any document where app can be created using Appcelerator for Apple TV.
There is an open request ticket at https://jira.appcelerator.org/browse/TIMOB-19570
So currently it is not supported
You could try to add it just like using the watchOS target in your app. It may require a bit more tooling when talking about resources, but in general they could be merged together.

Universal iOS app with HealthKit not showing up in iPad App Store

We have an iOS application that uses healthkit but we handle all cases of it gracefully for our iPad Application. After a successful submission we are not able to download it from the App Store directly on an iPad, but we can download it through iTunes. Is there something we need to do to make it appear on the iPad's App Store as well?
Does you plist contain healthkit under the required device capabilities? If it does, I'm guessing it won't show up on the iPad on the store, since the device doesn't fulfill the requirements. Downloading through iTunes won't filter out apps based on the requirements.
The fix would be to remove healthkit from the required capabilities and resubmit. The app should show up in the store for iPad then.
https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW3
Found that we needed to weak link HeathKit in the Link Binary With Libraries section by making the Framework "Optional".

Open iWatch Application from iPhone Click event [duplicate]

I would like to open WatchKit application to the foreground (or Glance if it is possible) directly from my iPhone.
I've been playing with it, but have no success. Maybe someone have found some workarounds?
So answer is No, you can't open Watchkit App from iPhone.
The WatchKit extension can only request the system to launch the parent iPhone app, which it will run in the background.
There is currently no support for this to work the other way around.
Nope, Its not possible as of now.
Let's hope Apple add that support & release it in coming WWDC.
The iPhone app can't launch the Apple Watch app in the current WatchKit version. The only possible way is to launching the iPhone app from the WatchKit app in the background, or using Handoff to move between the two companion apps in a jiffy.
NOTE: The best way is always waiting for the new versions. WWDC 2015 takes place in San Francisco in June 8-12, and they will introduce WatchKit 2 alongside with new versions of OS X and iOS. WatchKit 2 will support the missing APIs and Apple Watch native apps (which run on the Apple Watch without having iPhone nearby).
There is no way to launch the Watchkit app from the iPhone, only the opposite way is possible (Apple Watch launches the iPhone app in background mode).
During the WWDC 2015 session "Introducing WatchKit for watchOS 2", an Apple developer mentioned this is not possible even with the new version of WatchKit.

Open WatchKit application from iOS

I would like to open WatchKit application to the foreground (or Glance if it is possible) directly from my iPhone.
I've been playing with it, but have no success. Maybe someone have found some workarounds?
So answer is No, you can't open Watchkit App from iPhone.
The WatchKit extension can only request the system to launch the parent iPhone app, which it will run in the background.
There is currently no support for this to work the other way around.
Nope, Its not possible as of now.
Let's hope Apple add that support & release it in coming WWDC.
The iPhone app can't launch the Apple Watch app in the current WatchKit version. The only possible way is to launching the iPhone app from the WatchKit app in the background, or using Handoff to move between the two companion apps in a jiffy.
NOTE: The best way is always waiting for the new versions. WWDC 2015 takes place in San Francisco in June 8-12, and they will introduce WatchKit 2 alongside with new versions of OS X and iOS. WatchKit 2 will support the missing APIs and Apple Watch native apps (which run on the Apple Watch without having iPhone nearby).
There is no way to launch the Watchkit app from the iPhone, only the opposite way is possible (Apple Watch launches the iPhone app in background mode).
During the WWDC 2015 session "Introducing WatchKit for watchOS 2", an Apple developer mentioned this is not possible even with the new version of WatchKit.

iOS universal app with healthkit won't run on iPad

I have an universal app and I´ve implemented it to use the healthkit API. It runs great on iPhone but when I try to install it on an actual iPad device (works perfectly in iPad simulator) it wont install.
I am getting the error message: "The Info.plist for application at ... specifies device capability requirements, which are not met by "my ipad"".
I there any way I can distribute an universal app where the healthkit API (framework) only runs on the iPhone?
Heres two screenshots of my project:
Do I really need to make a standalone iPad app?
you can remove healthkit from "Required device capabilities" in your project's info.plist
Only by removing healthkit from Required device capabilities from info.plist doesn't work.
If you do only above step then apple reject the app with below message.
Your app uses the HealthKit API but does not indicate integration with the Health app in your app description.
You need to do below steps to run your app in both iPhone & iPad.
1. Remove healthkit from Required device capabilities from info.plist
2. You need to set HealthKit.framework as Optional from Linked Frameworks and Libraries
Seems like you can't use HealthKit on the iPad:
From the HealthKit Framework Reference:
Both HealthKit and the Health app are unavailable on iPad. The HealthKit framework cannot be used in an app extension.
From Apple documentation:
https://developer.apple.com/reference/healthkit
HealthKit and the Health app are unavailable on iPad.
When you enable the HealthKit capabilities on an iOS app, Xcode adds HealthKit to the list of required device capabilities. This prevents users from purchasing or installing the app on devices that do not support HealthKit.
The two statements together imply that if you add HealthKit capabilities to your app, user will not be able to install your app on iPad.
It can be found in the Device Compatibility Matrix as well:
https://developer.apple.com/library/content/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/DeviceCompatibilityMatrix/DeviceCompatibilityMatrix.html

Resources