|
@@ -15,7 +15,7 @@ import apns2
|
|
|
import firebase_admin
|
|
|
import jpush
|
|
|
import requests
|
|
|
-from firebase_admin import messaging, credentials
|
|
|
+from firebase_admin import messaging
|
|
|
from pyfcm import FCMNotification
|
|
|
|
|
|
from AnsjerPush.config import APP_BUNDLE_DICT, APNS_MODE, BASE_DIR, APNS_CONFIG, FCM_CONFIG, JPUSH_CONFIG, XMPUSH_CONFIG \
|
|
@@ -203,7 +203,7 @@ class PushObject:
|
|
|
try:
|
|
|
event_type = str(event_type)
|
|
|
n_time = str(n_time)
|
|
|
- push_data = {'alert': 'Motion', 'msg': '', 'sound': 'sound.aif', 'zpush': '1', 'image': image,
|
|
|
+ push_data = {'alert': 'Motion', 'msg': '', 'sound': 'sound.aif', 'zpush': '1',
|
|
|
'received_at': n_time, 'event_time': n_time, 'event_type': event_type, 'nickname': nickname,
|
|
|
'uid': uid, 'channel': channel
|
|
|
}
|
|
@@ -211,13 +211,15 @@ class PushObject:
|
|
|
push_data['priority'] = 'high'
|
|
|
push_data['content_available'] = True
|
|
|
push_data['direct_boot_ok'] = True
|
|
|
+ print(f"msg_title:{msg_title}, msg_text:{msg_text}, image:{image}")
|
|
|
message = messaging.Message(
|
|
|
notification=messaging.Notification(
|
|
|
title=msg_title,
|
|
|
body=msg_text,
|
|
|
+ image=image
|
|
|
),
|
|
|
data=push_data,
|
|
|
- token=token_val
|
|
|
+ token=token_val,
|
|
|
)
|
|
|
# Send a message to the device corresponding to the provided
|
|
|
# registration token.
|