[英]Google Nearby Connections - Timed Advertising
我正在使用 google Nearby 连接使用 Star 策略创建 P2P 网络,我想知道是否可以将广告设备设置为在 5 分钟后停止广告。
You could set up a thread, with a timer.您可以设置一个带有计时器的线程。 If the timer reaches 0, and you are advertising, then call the corresponding
stopAdvertising()
method.如果计时器达到 0,并且您正在做广告,则调用相应的
stopAdvertising()
方法。
Besides this, keep in mind that the user should be aware when the device is advertising via an icon or a special screen.除此之外,请记住,当设备通过图标或特殊屏幕进行广告时,用户应该知道。 This is stated in this video (they talk about nearby messages, rather than connections, but the best practices still apply).
这在此视频中有所说明(他们谈论的是附近的消息,而不是连接,但最佳实践仍然适用)。
What I mean, is that it would be odd to have the user waiting for 5 minutes in the same screen while advertising.我的意思是,让用户在做广告时在同一屏幕上等待 5 分钟会很奇怪。 Most likely he quits before the 5 minute window has passed, at which point you must also stop advertising.
他很可能在 5 分钟窗口过去之前退出,此时您也必须停止广告。 If you think in your application the user might stay in the advertising screen for over 5 minutes, then use the counter in a thread.
如果您认为在您的应用程序中用户可能会在广告屏幕上停留超过 5 分钟,那么请在线程中使用计数器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.