|
@ -99,10 +99,12 @@ class AppClient extends RedisModel {
|
|
|
ModelUtil.logError("Get user app status failed", err);
|
|
|
return;
|
|
|
}
|
|
|
if(!userStatus){
|
|
|
log.warn("User's app endpoint is not online, user id: " + targetId);
|
|
|
|
|
|
if (!userStatus) {
|
|
|
log.warn("User's app status is not found, user id: " + targetId + ", MAYBE user never login yet?");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let tipMessage = CONTENT_TYPES.typeToDescription(parseInt(message.content_type), "您有一条新消息") || message.content;
|
|
|
let customData = {
|
|
|
session_id: '' || message.session_id,
|
|
@ -110,11 +112,11 @@ class AppClient extends RedisModel {
|
|
|
topic_id: '' || message.topic_id,
|
|
|
from: '' || message.sender_id,
|
|
|
data: message.content,
|
|
|
business_type:message.business_type||1
|
|
|
business_type: message.business_type || 1
|
|
|
};
|
|
|
|
|
|
if (userStatus.platform == PLATFORMS.iOS) {
|
|
|
pusher.pushToSingleViaAPN(tipMessage, customData,message.contentType, userStatus.token, function (err, res) {
|
|
|
pusher.pushToSingleViaAPN(tipMessage, customData, message.contentType, userStatus.token, function (err, res) {
|
|
|
if (err) {
|
|
|
ModelUtil.logError("Send notification via APN failed", err);
|
|
|
} else {
|