【发布时间】:2015-09-01 18:20:22
【问题描述】:
我正在尝试实施一种解决方法,以从其 Apple Watch 应用程序打开我的 iPhone 应用程序。
这是我通过通知执行此操作的用例:
Watch displays an available deal with a CTA button to see details on Phone
--------------------------
New rates options published!
check details on phone
<Button>
---------------------------
当用户选择手表上的按钮时,用户会收到本地通知 在配对手机上“查看您的新房价选项”
选择本地通知后,应用会启动并显示详细信息。
我的做法是:
**On watch:**
call *openParentApplication:reply:* ...this will open the iOS app in the background
**On app:**
In *application:handleWatchKitExtensionRequest:reply:*
...which is called on the iOS app when opened in background, trigger a local notification
**User:**
User picks the local notification to bring app to the foreground
这行得通吗?如果是这样,如何从后台运行的应用程序触发即时本地通知?
最后一个问题:有没有一种(合法的)方法可以做到这一点而不需要本地通知(不会被应用商店拒绝的通知)?
【问题讨论】:
标签: ios notifications uilocalnotification watchkit apple-watch