简体   繁体   English

收到Pushover通知后启动应用程序

[英]Start Application when Pushover notification has received

i create an application on my android device and i want run it when i receive a pushover notification. 我在Android设备上创建了一个应用程序,当我收到推送通知时,我想运行它。 After i want passing the notification's text to my app. 在我想将通知文本传递到我的应用程序之后。 Is it possible? 可能吗? thanks a lot 非常感谢

You make an application which subscribes to the notifications using 您制作一个使用以下方式订阅通知的应用程序

NotificationListenerService in Android 4.3 or Accessiblity Events in older versions of Android. Android 4.3中的NotificationListenerService或旧版本Android中的Accessiblity事件。 See the following SO Answer for more information. 有关更多信息,请参见以下SO解答

Also see the following example . 另请参见以下示例

Then in either onNotificationPosted or onAccessibilityEvent your application should triggger your other application to launch using the method described in this SO answer. 然后,在onNotificationPosted或onAccessibilityEvent中,您的应用程序应触发此其他应用程序以使用此SO回答中所述的方法启动

This would allow you to start an application when any status bar notification was received from PushOver, and by filtering it to only notifications related to a new pushover notification, you would start an application when a new pushover notification was received. 这样,您可以在从PushOver收到任何状态栏通知时启动应用程序,并且通过将其过滤为仅与新的Pushover通知相关的通知,可以在收到新的Pushover通知时启动应用程序。

In order to have the notifications text passed to your application or to filter based on the specific contents of the notification, you would need to subscribe to C2DM pushover messages which is protected by signature level protection, so without consulting the creators of pushover I don't believe that is possible. 为了将通知文本传递到您的应用程序或基于通知的特定内容进行过滤,您需要订阅受签名级别保护保护的C2DM推送消息,因此无需咨询推送创建者,我不会相信这是可能的。

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

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