|
@@ -414,9 +414,11 @@ class NotificationView(View):
|
|
|
# return
|
|
|
|
|
|
def do_fcm(self, uid, channel, appBundleId, token_val, event_type, n_time, msg_title, msg_text):
|
|
|
+ logger = logging.getLogger('info')
|
|
|
try:
|
|
|
serverKey = FCM_CONFIG[appBundleId]
|
|
|
except Exception as e:
|
|
|
+ logger.info('------fcm_error:{}'.format(repr(e)))
|
|
|
return 'serverKey abnormal'
|
|
|
push_service = FCMNotification(api_key=serverKey)
|
|
|
data = {"alert": "Motion ", "event_time": n_time, "event_type": event_type, "msg": "",
|
|
@@ -428,6 +430,8 @@ class NotificationView(View):
|
|
|
'default_sound': True,
|
|
|
'default_light_settings': True
|
|
|
})
|
|
|
+ logger.info('------fcm_status:')
|
|
|
+ logger.info(result)
|
|
|
print('fcm push ing')
|
|
|
print(result)
|
|
|
return result
|