1
我正在使用IBM Worklight 6.0.0並在iOS 7設備上進行測試。IBM Worklight - 無法使用現有別名註冊到事件源回調。別名已用於事件源
我有以下的JS錯誤:
Cannot register to event source callback with an existing alias: 'myPush'. The alias is already in use for event source 'PushEventSource'.
在設備上,當我登錄,註銷,然後重新登錄。 (錯誤出現在第二次)
在客戶端,我的代碼是:
if (WL.Client.Push){
WL.Client.Push.onReadyToSubscribe = function(){
WL.Logger.debug("onReadyToSubscribe");
WL.Client.Push.registerEventSourceCallback(
"myPush",
"PushAdapter",
"PushEventSource",
pushNotificationReceived);
if (isPushSubscribed() == false) {
doSubscribe();
}
};
}
有什麼錯我的代碼?
是因爲我應該只調用一次「WL.Client.Push.registerEventSourceCallback」嗎?
任何其他解決方案?