Let's say we have running widget on iPhone and app on Apple Watch at the same time. How to inform Apple Watch that we have made any changes to the model with widget?
App Groups are not longer supported by Apple Watch so we can't use MMWormhole nor Realm to share database...
Widget does not support Watch Connectivity and I end up with outdated model
How to handle this situation when the main app is closed?
iOS10, watchOS3, Swift 3
MMWormhole apparently also supports the WatchConnectivity framework of watchOS 2, so you should still be able to use it to send data.
Unfortunately, according to this Apple Developer Forum thread (and this SO question), it is simply not possible to use WatchConnectivity from a Today extension. It will always be necessary to pass any data added by the Today Widget back up to the host app, and then have the host app pass the data to the watch.
Related
On the new watchOS 6 I am building a watch app that is independent and I want it to auto-launch when the watch turns on. Are there specific developer permissions I need to allow this OR can I make the app a designated type (e.g. workout app, health app) OR any other way anyone knows to do this.
Right now I have the app running but the user has to tap a complication to turn the app on which they only remember to do sometimes.
Thanks
This is not possible, the user has to launch the app themselves.
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.
Standard set up for Watch OS > 2.
WCSessionDelegate used to coordinte data between main application and Watch.
An App Group "group.***********.TodayExtensionWidget" used to coordinate data between main application and its Today Extension widget via UserDefaults(suiteName: "group.***********.TodayExtensionWidget")
When I make a change from the watch it communicates that change with the main application. Then the main application (once launched) communicates this on to the Today Extension.
What I would like to do is communicate the change in the watch app to the Today extension without needing to launch the main app first.
Is there a best practice to communicate between a watch app and a Today Extension widget?
At the moment there is no way to achieve this using any built-in frameworks. Since the introduction of watchOS2, WatchKit apps are considered to be independent apps and not just an extension of the iOS app, hence you cannot use AppGroups to share data between the two and especially cannot use it to share data between the WatchKit app and an iOS extension.
As you already experienced, WatchConnectivity cannot be used in a Today extension, so that is out of the picture as well.
Your only option is a suboptimal one, since you will need to upload your data to a server from your watchOS app and download it in your iOS Today extension. This of course generates unnecessary data usage, but with the current frameworks provided by Apple you cannot share the data offline.
However, if you wait until watchOS4 is released (or give the beta version a try), you might be able to leverage the CoreBluetooth framework, which is becoming available for WatchKit in watchOS4 to communicate between a WatchKit app and an iOS extension offline, using BLE. I am not 100% sure if CoreBluetooth can be used in iOS Extensions, but you should give this a try if you can use watchOS4 beta.
I have been attempting to make an Apple Watch extension and WatchKit app with my firebase application, but every time I make a connection in the extension code, the watch crashes. By connection I mean adding an observer to my Firebase reference. Is firebase not compatible on Apple Watch extensions? Or is there something in firebase that Apple prevents on watches (something like web sockets) that firebase won't be able to work around?
There are some question which are related to this,. but getting the exact answer:
Lock-down iPhone/iPod/iPad so it can only run one app
Recently iOS 6 is introduced with some business oriented features, two of theme are:
Guide Access
Supervised Access
These both deals with Accessibility Control features, Like allow user to restrict access to there device, only if they have full access to the device. In that way this is only useful to people, who owned the device like, a school use there device for exam, a restaurant for menus, for product display etc. All of them have access to the device to configure settings etc.
Now my question begins here, I am thinking of an App, which look down user to single app mode when user run the app and after signing out of the app the device start working as before in normal mode.
Through the time when app is active, user should not able to access any other function or button, this applies on all three device iPad, iPhone, iPod.
Also I found that this could be done by installing some Profiles etc, which looks wired and we can't ask user to do so.
So the simple idea is user will only install the App, as normally he does and we could lock him down to single app mode when he log into the app.
The SureLock iOS app does nothing but inform the user how to do it in your system preferences.
Doing it from the app itself is only possible, if you break the rules about private frameworks. And break it hard.
I am sorry to tell you that the way you present your idea, would never be approved for the AppStore.
The accepted answer to this question is no longer correct:
Starting with iOS 7, UIKit exposes the function UIAccessibilityRequestGuidedAccessSession as public API.
I don’t know, but can very well imagine that this function existed as private API dating back to iOS 6, where the guided access feature was introduced.
Note that for this method to have any effect, the device in question must be supervised using MDM, and the ID of the app you want to use this API must be included in the device management profile deployed to it.
Hi may be I am late but I have a good news for you.
Apple provide a new feature in IOS 7 and we can lock the user to single mode without user permission(Lock and unlock mode) here is the apple documentation link
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIAccessibilityRequestGuidedAccessSession
the other way is to install the profile config profile like is
http://ipadhire.co.nz/lockdown.mobileconfig
it lock the home button of IPhone and enable single mode
For this you have to do following..
access apple's private api's
access apple's private framework
Apple don't encourage accessing there private api's specially when it comes for App Store, if you accessed the private api's at the time of application review on App Store they will reject the app giving you a message of "accessing a private api".