简体   繁体   English

如何从iPhone将数据发送到Apple TV应用

[英]How to send data to apple tv app from my iphone

I'd like to know if there is a way to send some data from my iphone to my apple tv.I'll explain:I want to make an app for my apple tv and extend this app to my iphone.Using the extension in running on the iphone you should send some data to my app in running on my apple tv.Sending data it should not be through wi-fi but using for example the bluethoot.How should I do to build this comunication?Can you explain to me how to do or link me some resources?Thanks to all! 我想知道是否有一种方法可以将一些数据从我的iPhone发送到我的苹果电视。我会解释:我想为我的苹果电视制作一个应用程序并将该应用程序扩展到我的iPhone。在iPhone上运行时,应该在苹果电视上运行时向我的应用程序发送一些数据。发送数据不应该通过Wi-Fi,而应使用例如bluethoot。我应该怎么做来建立这种通信?怎么做或链接我一些资源?谢谢大家!

Ps. 附言 sorry for my english! 对不起我的英语不好!

The MultipeerConnectivity framework should allow you to do this. MultipeerConnectivity框架应允许您执行此操作。 It's available in the SDK and supported by both tvOS and iOS. 它在SDK中可用,并且同时受tvOS和iOS支持。

The advantage is that you don't have to chose what type of connection the devices use. 优点是您不必选择设备使用哪种类型的连接。 It supports both WiFi and BT. 它同时支持WiFi和BT。 But if you don't want to use WiFi because wifi is not available, it can by default create a peer to peer wifi network between devices. 但是,如果由于无线网络不可用而不想使用WiFi,则默认情况下它可以在设备之间创建对等无线网络。

https://developer.apple.com/reference/multipeerconnectivity https://developer.apple.com/reference/multipeerconnectivity

And also, here https://www.hackingwithswift.com/example-code/system/how-to-create-a-peer-to-peer-network-using-the-multipeer-connectivity-framework is a good tutorial. 另外,这里https://www.hackingwithswift.com/example-code/system/how-to-create-a-peer-to-peer-network-using-the-multipeer-connectivity-framework是一个很好的教程。

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

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