Open Safari iOS App from Watch App - ios

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.

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.

Interact with app launched from browser

I have an iOS app that must be launched from the safari via URL scheme. And I want to test it with Appium.
I managed to launch the safari and then click on the link that launches the app. The problem is, I am having trouble interacting with said app afterwards. Is it possible with Appium and iOS to send commands to an app that was launched from the browser?
You should be able to interact with safari using something like this
driver.FindElementByXPath("//UIATextField[#value='Enter URL']")
.SendKeys("www.google.com");

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

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

Bring iOS App to Foreground in WatchKit

I am developing a WatchKit extension for one of my Apps where I really want to have the iPhone App running in the foreground, since it is doing the heavy lifting and is designed to use location services only when active. I know openParentApplication:reply only opens the App in the background (unless it is already active). What I am currently trying out is using a custom URL scheme for my App, and having the App initially open itself from within the handleWatchKitExtension code in the App Delegate. This works perfectly in the Simulator. Unfortunately I did not have this approach ready when I tested my App on real Apple Watches. Does anyone see a problem with this approach to bring the iPhone App to the foreground from the Apple Watch?
On iOS, apps can't bring themselves to the foreground. The best thing you can do is to post a local notification (UILocalNotification, see https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html) and invite the user to bring your app to the foreground.
But for your use case, why not just have your phone app use location services in the background?
This is not possible. The Apple Watch Programming Guide states that the app on the iPhone will run in the background if it was not active before.

Resources