当android应用程序已经登录时,我的Firebase推送通知正在工作,但是我想知道在注销该应用程序时如何创建服务,因此当您按下该推送通知时,该应用程序导航至登录名页面,并且在您登录后,它会定向到通知的特定页面。
我有EventBridge.js文件,该文件需要接收调用并将对象传递给我创建的服务。
EventBridge.js
angular.module('app').factory('EventBridge',['toaster', 'TransitionManager', function(toaster, TransitionManager) {
'use strict';
//convert
var bridgeFunctions = {
myMessages: 'myMessages',
myChartLabResults: 'myChartLabResults',
myAppointments: 'myAppointments',
rxrefill:'rxrefill'
};
function init(){
document.addEventListener('BridgeJS', bridgeJS, false);
}
function bridgeJS(e){
//convert methodName into a parameter in order to test equality vs bridgeFunctions
toaster.pop('success', 'title', 'message');
window.alert('A request has been received to go to page: ' + e.detail);
for (var x in bridgeFunctions){
if(e.detail === bridgeFunctions[x]){
window.alert('Found a matching route: ' + bridgeFunctions[x]);
TransitionManager.transition({appRoute: bridgeFunctions[x]});
}
}
}
return {
//makes init public
init: init,
};
}]);