简体   繁体   English

索尼SmartWatch 2控制和通知可能适用于同一个应用程序?

[英]Sony SmartWatch 2 Control & Notification for the same app possible?

I was trying to port my existing app from SW 1 to SW 2 and stumbled upon the limitation that it is not allowed to have notifications and a control for the same app (even when setting LAUNCH_MODE to CONTROL). 我试图将我现有的应用程序从SW 1移植到SW 2,并偶然发现了不允许对同一个应用程序发送通知和控件的限制(即使将LAUNCH_MODE设置为CONTROL)。

As a workaround I tried to register 2 services, one for the notification and one for the control. 作为一种解决方法,我尝试注册2个服务,一个用于通知,另一个用于控制。 As they share the same app package name, this didn't work and only the first that registered was available. 因为它们共享相同的应用程序包名称,所以这不起作用,只有第一个注册的可用。

Is there a better workaround? 有更好的解决方法吗? Or will this limitation be addressed in a future update? 或者在未来的更新中是否会解决此限制? My app really depends on both, the notifications and the control. 我的应用程序真的取决于通知和控件。

A distant workaround may be to use only the Control, and build some sort of a notification mechanism as part of the Control. 一个遥远的解决方法可能是仅使用Control,并构建某种通知机制作为Control的一部分。 I did exactly that in my Log app: https://play.google.com/store/apps/details?id=eir.log 我在我的日志应用中做到了这一点: https//play.google.com/store/apps/details?id = ee.log

The notification mechanism is triggered by a different event, in the same BroadcastReceiver. 通知机制由同一BroadcastReceiver中的不同事件触发。 Works wonderfully for me. 对我来说非常有效。

I believe this is indeed not possible today. 我相信今天确实不可能。 One option for you would be to start up your control extension from a notification list item. 您可以选择从通知列表项启动控件扩展。 So from where you read your notification you can enable a menu and then in that option start up your control. 因此,从您阅读通知的位置,您可以启用菜单,然后在该选项中启动您的控件。 Have a look at the SMS app to get an idea. 看看短信应用程序,以获得一个想法。

Not possible and no workaround available. 不可能,没有可用的解决方法。 We have to wait for Sony to fix this issue though they haven't mentioned when they will address it. 我们必须等待索尼解决这个问题,尽管他们没有提到何时会解决这个问题。

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

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