好的。這是我的場景:
- 不知何故,我
A Payment Gateway從我的Android App. (到目前為止,一切都很好!)
支付網關 > 安卓應用
- 然后根據用戶的支付互動結果(他是否支付或取消)必須有兩個按鈕:
ACCEPT-----------------------------CANCEL
當用戶單擊取消時,我希望他以
message喜歡的方式回傳應用程式(失敗)當用戶點擊接受時,我希望他以
message喜歡的方式回傳應用程式(完成)
所以基于message我會在我的應用程式中向他展示一個頁面,通知他更多資訊。
我知道如何使用打開我的應用程式,<Intent-Filter>但我希望它更具體!我知道這一點 我需要一個推薦鏈接才能將其放入我的<a href=''> </a> tag此鏈接 必須指定我的包名稱和我將要進行的活動。
先感謝您 :)
uj5u.com熱心網友回復:
您可以使用uni_links插件在 flutter 中進行深層鏈接和應用程式鏈接:
將此添加到清單中的活動標簽:
<!-- Deep Links -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with YOUR_SCHEME://YOUR_HOST -->
<data
android:scheme="[YOUR_SCHEME]"
android:host="[YOUR_HOST]" />
</intent-filter>
然后在飛鏢側
Future<void> initUniLinks() async {
// Platform messages may fail, so we use a try/catch PlatformException.
try {
final initialLink = await getInitialLink();
// Parse the link and warn the user, if it is not correct,
// but keep in mind it could be `null`.
// navigate to every page you want
} on PlatformException {
// Handle exception by warning the user their action did not succeed
// return?
}
}
那么你的鏈接可以是這樣的
YOUR_SCHEME://YOUR_HOST/status
狀態可以是 FAILED 或 DONE
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/364094.html
