本文整理汇总了Python中helpers.firebase.firebase_pusher.FirebasePusher.push_notification方法的典型用法代码示例。如果您正苦于以下问题:Python FirebasePusher.push_notification方法的具体用法?Python FirebasePusher.push_notification怎么用?Python FirebasePusher.push_notification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helpers.firebase.firebase_pusher.FirebasePusher
的用法示例。
在下文中一共展示了FirebasePusher.push_notification方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send
# 需要导入模块: from helpers.firebase.firebase_pusher import FirebasePusher [as 别名]
# 或者: from helpers.firebase.firebase_pusher.FirebasePusher import push_notification [as 别名]
def send(self, keys, push_firebase=True, track_call=True):
self.keys = keys # dict like {ClientType : [ key ] } ... The list for webhooks is a tuple of (key, secret)
deferred.defer(self.render, self._supported_clients, _queue="push-notifications")
if self._push_firebase and push_firebase:
FirebasePusher.push_notification(self)
if self._track_call and track_call:
num_keys = 0
for v in keys.values():
# Count the number of clients receiving the notification
num_keys += len(v)
deferred.defer(self.track_notification, self._type, num_keys, _queue="api-track-call")