推送通知打开时打开Goog​​le Play商店

时间:2019-08-13 06:12:12

标签: android firebase react-native push-notification react-native-android

我正在设置Firebase推送通知,以通知用户是否有新更新来响应本机应用程序。问题是我想在推送通知打开时打开游戏商店。

我尝试使用react native链接。当应用程序位于前台时,它可以工作,但是当推送通知打开时,当应用程序位于后台时,它将打开应用程序并定向到商店。

this.notificationOpenedListener = firebase.notifications()
   .onNotificationOpened((notificationOpen) => {
        Linking.openURL("https://play.google.com/store/apps/details?id=com.sample.myapp");
    });

const notificationOpen = await firebase.notifications().getInitialNotification();
if (notificationOpen) {
    const { title, body,path } = notificationOpen.notification;
    Linking.openURL('https://play.google.com/store/apps/details?id=com.sample.myapp');
}

那么,在打开推送通知时是否可以在不在后台打开应用的情况下打开Play商店?

0 个答案:

没有答案