0
firebase를 사용하여 내 이차 앱에서 데이터를 수신하려면 다음 코드를 사용합니다. 앱이 백그라운드에있을 때 data.wastapped = true가 표시됩니다. 이제 데이터를 전달해야합니다. 내 메인 컨트롤러는이Cordova FCM 플러그인 백그라운드 알림 데이터 처리
FCMPlugin.onNotification(
function(data){
if(data.wasTapped){
alert(JSON.stringify(data);
// need to pass this data to my app controller
tapped by the user.
alert(JSON.stringify(data));
}else{
alert(JSON.stringify(data));
}
},
function(msg){
alert('onNotification callback successfully registered: ' + msg);
},
function(err){
alert('Error registering onNotification callback: ' + err);
}