使用库react-native-push-notification
中的PushNotification
.当我们在后台收到新的通知和APP时,需要将APP带回前台,而不需要任何交互.我们使用的是Linking.openURL('my-awesome-app://')
,但这在应用程序前台工作,而不是在后台工作.
PushNotification.localNotification({
channelId: 'reminders',
title: '',
userInteraction: true, // BOOLEAN: If the notification was opened by the user from the notification area or not
message: info.message,
// userInfo: info.data,
});
const orderDetails = JSON.stringify(info);
const link = `my-awesome-app://Private/OrderSummeryScreen/${orderDetails}`;
Linking.openURL (link)
}