0
モードからにアプリを届けるようなイベントが発生した場合、アプリケーションを呼び出す方法はありますか? WhatsAppおよびSkype音声コールまたはビデオコールが到着したときにフォアグラウンドに持ち込まれます。Ionic 2の背景からアプリをフォアグラウンドに移動するにはどうすればよいですか?
更新:
public subscribeToPushNotificationEvents(): void {
// Handle token refresh
this.firebase.onTokenRefresh().subscribe(
token => {
//console.log(`The new token is ${token}`);
this.saveToken(token);
},
error => {
console.error('Error refreshing token', error);
});
// Handle incoming notifications
this.firebase.onNotificationOpen().subscribe(
(notification: NotificationModel) => {
this.backgroundMode.moveToForeground();
let notificationAlert = this.alertCtrl.create({
title: notification.title,
message: notification.body,
buttons: ['Ok']
});
notificationAlert.present();
}
私が更新されましたが、アプリがフォアグラウンド、時にはアプリがクラッシュするつもりはありません。クラッシュは 'this.backgroundMode.moveToForeground();'コードとは関係ありません。 – RSA