附近的消息:没有收到AudioBytes

时间:2017-04-10 12:38:24

标签: android google-nearby

Google Play Services 10.2包含AudioBytes:https://developers.google.com/android/guides/releases#february_2017_-_v102

据我了解,它是一条消息,可以使用超声波直接从一个设备传输到另一个设备,而不是像附近消息通常那样通过互联网路由有效负载。

文档几乎不存在:https://developers.google.com/android/reference/com/google/android/gms/nearby/messages/audio/AudioBytes

但我很困惑我应该尝试:

AudioBytes audioBytes = new AudioBytes("Hello".getBytes());
Message message = audioBytes.toMessage();
Nearby.Messages.publish(googleApiClient, message);

尽我所知,主要区别在于它改变了消息的type。问题是,我的订阅代码永远不会收到使用AudioBytes创建的消息,虽然它确实收到常规消息就好了。发布和订阅的电话在物理上彼此相邻,它们的扬声器和麦克风功能正常。

我可以在线找到AudioBytes的唯一其他参考是https://www.reddit.com/r/androiddev/comments/5vlt9r/anyone_have_luck_with_nearby_messagings_audiobytes/,这是其他人说他们无法让它工作。

我做错了吗?或者AudioBytes刚破损?

0 个答案:

没有答案
相关问题