简体   繁体   English

什么是后台推送通知? Android,城市飞艇

[英]What is a background push notification? Android, Urban Airship

When extending the Urban Airship class BaseIntentReceiver there is a method which is called onBackgroundPushReceived , when is it triggered? 扩展Urban Airship类BaseIntentReceiver时,有一种称为onBackgroundPushReceived的方法,何时触发?

When the app is in the background and a push arrives the method onPushReceived is called.. so in which state needs the app to be in in order to trigger onBackgroundPushReceived ? 当应用程序在后台且推送到达时,将调用onPushReceived方法。.那么,应用程序处于哪种状态才能触发onBackgroundPushReceived Or is a background push something different from a normal push? 还是背景推送与正常推送有所不同?

From their documentation : onBackgroundPushReceived is called when a push is received that did not result in a notification being posted. 从他们的文档中 :当收到没有导致发布通知的推送时,将调用onBackgroundPushReceived。

protected abstract void onBackgroundPushReceived (Context context, PushMessage message) 受保护的抽象void onBackgroundPushReceived(上下文上下文,PushMessage消息)

Called when a push is received that did not result in a notification being posted. 在收到未导致发布通知的推送时调用。

In the same application we can use different notification services. 在同一应用程序中,我们可以使用不同的通知服务。 whenever a push is received from a notification service other than the UrbanAirship notification service, onBackgroundPushReceived() will be called.In my application I used UrbanAirship as well as Gimbal Notification Service.So whenever push is received from Gimbal , this method is called.Inside this method I fired the local broadcast to notify the application about the arrival of new notification. 每当从除UrbanAirship通知服务之外的通知服务收到推送时,都会调用onBackgroundPushReceived()在我的应用程序中,我同时使用UrbanAirship和Gimbal Notification Service。因此,无论何时从Gimbal收到推送,都将调用此方法。通过这种方法,我触发了本地广播,以通知应用程序新通知的到来。

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

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