diff --git a/android/app/src/main/AndroidManifestBase.xml b/android/app/src/main/AndroidManifestBase.xml
index f43b0369b..f4023f532 100644
--- a/android/app/src/main/AndroidManifestBase.xml
+++ b/android/app/src/main/AndroidManifestBase.xml
@@ -38,6 +38,15 @@
android:scheme="cakewallet"
android:host="y.at" />
+
+
+
+
+
+
+
+
+
with SingleTickerProviderStateMixin {
super.initState();
//_handleIncomingLinks();
//_handleInitialUri();
+
+ initUniLinks();
}
@override
@@ -210,6 +212,41 @@ class AppState extends State with SingleTickerProviderStateMixin {
super.dispose();
}
+ /// handle app links while the app is already started - be it in
+ /// the foreground or in the background.
+ Future initUniLinks() async {
+ try {
+ stream = getLinksStream().listen((String link) {
+ handleDeepLinking(link);
+ });
+
+ final String initialLink = await getInitialLink();
+
+ handleDeepLinking(initialLink);
+ } catch (e) {
+ print(e);
+ }
+ }
+
+ void handleDeepLinking(String link) async {
+ if (link == null || !mounted) return;
+
+ final List urlComponents = link.split(":");
+
+ switch (urlComponents.first) {
+ case "bitcoin":
+ print("@@@@@@@@@@@@@@@@@@@@@@@@@@");
+ print("Bitcoin QR Code: \n${link}");
+ break;
+ case "litecoin":
+ case "haven":
+ case "monero":
+ default:
+ print("@@@@@@@@@@@@@@@@@@@@@@@@@@");
+ print(link);
+ }
+ }
+
Future _handleInitialUri() async {
try {
final uri = await getInitialUri();