當收到通知時,我需要在Ionic 2應用程序上推送特定頁面時出現這種情況。該應用程序的行爲是正確的,但該頁面被推送兩次(即使在Twitter iOS應用程序中我也注意到了一個錯誤)。有人可以指出下面粘貼的代碼中的任何錯誤嗎?謝謝!Ionic 2頁面在通知上被推送兩次
push.on('notification', function(data) {
let offer = JSON.parse(data.additionalData.offer);
this.app.getActiveNav().push(OfferDetailsPage, {
currentOffer: offer,
displayArrow: true
});
// Propagate new event to load the new offer
events.publish('offer:new', offer, Date.now());
});
編輯:同樣的頁面的容器是一個選項卡頁面。
'function(data {'你可能在這裏有一個錯字 –
感謝你的觀點,但這只是我在寫問題時犯的一個錯誤,問題仍然存在 –