简体   繁体   English

从iOS应用启动watchOS2应用

[英]Launch watchOS2 app from iOS app

I have a simple interface with 3 buttons in iOS part (these should be shown on an iPhone, not on watches) and upon clicking on a button I want to set up a specific version of watch app (depending on button clicked, watch OS should use different data for its execution). 我有一个简单的界面,在iOS部分中有3个按钮(这些按钮应显示在iPhone上,而不是在手表上显示),单击按钮后,我想设置特定版本的手表应用(取决于所单击的按钮,手表操作系统应使用不同的数据执行)。

First I am not sure how to trigger watch app execution from iOS app part of the code. 首先,我不确定如何从iOS应用程序的代码部分触发watch app的执行。 Second, I need to know how to pass the data about the button clicked. 其次,我需要知道如何传递有关单击按钮的数据。 I read several tutorials on watchOS2, but they are talking mostly about how to make watch app, that is already running on apple watches, respond to events - that's not what I need. 我在watchOS2上阅读了几本教程,但他们主要是在谈论如何制作已经在Apple Watch上运行的watch app,如何响应事件-这不是我所需要的。 Are there any tutorials? 有教程吗?

Could anyone, please, share some links/suggestion? 任何人都可以分享一些链接/建议吗?

You're dangling on the edge of Apple-acceptability, but here's how I'd do it: Make your three apps. 您正徘徊在Apple可接受性的边缘,但是我要这样做:制作三个应用程序。 With your iOS button, send a notification to the app which you want to open. 使用iOS按钮,向您要打开的应用发送通知。 Within that notification have a button that allows the user to open the app. 在该通知中,有一个允许用户打开应用程序的按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM