我有一个应用程序,我想通过深度链接进行付款。我有一些在应用程序启动时调用的 api,所以在从付款回来后我想再次启动应用程序这是我的链接抛出 url
const goToFeedback = () => {
setLoading(true);
sendTransactionPay({
walletUrl,
walletId,
callback: id => {
Linking.canOpenURL(`${paymentUrl}\/${id}`).then(supported => {
if (supported) {
Linking.openURL(`${paymentUrl}\/${id}`);
} else {
changeEvent({
showModal: false,
modalMessage: 'error',
info: false,
});
}
});
},
});
};
不幸的是,从付款网址返回后,当前组件已显示。这是我的清单
<activity
android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:label="@string/app_name"
android:excludeFromRecents="true"
android:alwaysRetainTaskState="true"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="app" android:host="avachain" />
</intent-filter>
</activity>