Can you launch the Apple Watch WK app from iPhone-side code? - ios

WatchKit apps are extensions of iPhone code, however there is Watch-specific logic you can create for behavior of the app extension.
You can open Android Wear apps by passing an Intent from the phone to open a Wear-side Android app, but is there a similar way for the Apple Watch?
When you press a button on the iPhone app, for example, can you open its counterpart app extension on the Watch?

You can't open your apple watch app from your iphone. You can only execute background tasks from your apple watch to your iphone using openParentApplication

Related

Does it possibale to Develop an Apple Watch App to and IOS app to Support iOS Watches and other OS Watches

I have an iOS Application and am developing an Apple Watch Application for it.
The user should log in first to the iOS app and then we send the "Authentication log-in" to the iOS Watch App and the user can do some calls from its watch.
I'm Working on it as an extension of the main Application. and the Question is...
What is going to happen if the user has an iPhone and smartwatch which is not Apple?
Is there a way to send data from the iOS Application to the smartwatch (Android, Galaxy, and Huawei)?
Can the Application on the (Android, Galaxy, and Huawei) works like the one on the Apple Watch? or does it need a different development?.

Is it possible to use WatchConnectivity in background

I have an watchOS app that used WatchConnectivity framework to open an URL in Safari. When my app is running on the iPhone and running on the Apple Watch at the same time, pressing the open URL button on the Apple Watch app does launch Safari on the iPhone as what I've implemented using WCSessionDelegate. But this won't work if the iPhone app is not running. Is there a way to launch the URL on iPhone when pressing the button on the Apple Watch even if the iPhone app is not active? Thanks.
Using the WatchConnectivity's sendMessage API the watch app is able to get the phone to launch your iOS app in the background, but a background running iOS app won't be able to open the URL resulting in Safari being launched.
No, Apple does not allow you to start an iPhone app from the watch (although a lot of developers seem to want this functionality.) You can always enter an enhancement bug request.

Open Safari iOS App from Watch App

Is it possible to open the safari in iPhone when I click on some link in Apple watch Application?
This is only possible if the iOS app happens to be running in the foreground. If you use the WatchConnectivity sendMessage API to wake the iOS app up in the background then you won't be able to open URLs and therefore not launch Safari.

Why is my Apple Watch Simulator black?

I have a requirement to create a watchkit app.
Please let me know if it is possible to create a separate app with watch kit or do we have to do this with extensions.
I am testing my application in a simulator. The iPhone simulator and the Apple watch simulator both are coming up. The Apple watch simulator is black, no screen is coming up.
My System harddisk : 320 GB , RAM : 5 GB.
If you haven't read this already, have a look at it. In short it looks like you can only achieve this using extensions at the moment.
This article explains what they expect from you as a 3rd party watch app developer.
Apple Watch requires the presence of an iPhone to run third-party apps. To create a third-party app, you need two separate bundles: a WatchKit app (that runs on Apple Watch) and a WatchKit extension (that runs on the user’s iPhone). The WatchKit app contains only the storyboards and resource files associated with your app’s user interface. The WatchKit extension contains the code for managing the WatchKit app’s user interface and for responding to user interactions.
Also
Because a WatchKit app extends the behavior of your existing iOS app, the WatchKit app and WatchKit extension are bundled together and packaged inside your iOS app bundle. During installation of your iOS app, the system prompts the user to install the WatchKit app when a paired Apple Watch is present.
It's not possible to develop standalone WatchKit app. As you said - it has to be an extension. Also your iPhone app has to do something - it can not be just a container for your extension.
Watch Apps have to be set up as App extensions and cannot be created as stand-alone apps. This is just not what Apple has designed the Watch for, rather view it as an additional screen of your iOS device. Apple also recommends to have as much of your ressource-intensive code as possible in the main iOS-App - e.g. background tasks.
As to why your screen is black:
Make sure you are building the Watch App-Scheme. Then even if your Watch app does not have any UI elements yet, you should see the time in the upper right corner of the watch simulator.

How can I make my Apple Watch app work without an iPhone?

When my iPhone is not available, my WatchKit app on the Apple Watch does not work (a red crossed-out iPhone symbol appears). How can I make my app work without the iPhone? How do I tell it to use data that is cached on my Apple Watch?
You don't, because this is not how Apple Watch apps work at the moment. Your watch app does not run on the watch, it runs on the iPhone but displays its UI on the watch. When the phone isn't nearby, there's no place to run the code.
Apple has said that stand-alone watch apps will be possible this summer. Probably they'll announce it at WWDC in June.

Resources