添加自定义属性我有一个小问题,我需要为我目前使用MobileFirst 7.1.0自定义参数/属性添加到通知WL.Server.notifyAllDevices需要在通知
function submitNotification(userId, notificationText){
var userSubscription = WL.Server.getUserNotificationSubscription('PushAdapter.PushEventSource', userId);
if (userSubscription==null){
return { result: "No subscription found for user :: " + userId };
}
var badgeDigit = 1;
var notification = WL.Server.createDefaultNotification(notificationText, badgeDigit, {custom:"data"});
WL.Logger.debug("submitNotification >> userId :: " + userId + ", text :: " + notificationText);
WL.Server.notifyAllDevices(userSubscription, notification);
return {
result: "Notification sent to user :: " + userId
};
}
// need to pass custom property content-available:1 but not in payload
。此增强功能的目的是我需要在App未处于启动阶段时更新iPhone App中的通知徽章。通过添加可用内容:1级通知可以帮助完成它。运气好的话 ?
其实事情是,这个badgeDigit适用于iPhone。但我的情况是不同的。这是一个详细的范围。我会是伟大的Idan如果我可以得到如何定制notifyAllDevice参数发送'content-available:1'作为参数。现在notifyAlllDevices或createdefaultnotification函数不允许任何其他参数。如何添加或将此自定义参数添加到该功能...需要帮助人 –
那么,为什么你不提到你的场景是什么? –
好的,让我告诉你 –