How to establish a communication channel between Apple Watch Extension/App and iOS App

后端 未结 5 798
Happy的楠姐
Happy的楠姐 2021-02-09 05:26

I\'m exploring the WatchKit SDK.

When I have a WatchKit app, is it possible to set values (e.g. Text, settings) from the iPhone app on the WatchKit app? Can I call funct

5条回答
  •  广开言路
    2021-02-09 05:57

    With watchOS2 now Apple supports Watch Connectivity Framework to pass information from watch extension to app and vice versa.

    Taken from Apple's docs

    Communicating with Your Companion iOS App

    The Watch Connectivity framework lets you create a bidirectional communications channel between your WatchKit extension and your companion iOS app. Use this channel to coordinate activities between the two processes. For example, you might use this framework to push updated information from your iOS app to your WatchKit extension. The framework provides options for transferring data in the background or while both apps are active and replaces the existing openParentApplication:reply: method of the WKInterfaceController class.

    For more information the classes of the Watch Connectivity framework, see Watch Connectivity Framework Reference.

    Taken from Apple's Developers Library

提交回复
热议问题