mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-08-11 05:30:22 +02:00
fix deeplinks
This commit is contained in:
@@ -30,6 +30,19 @@
|
||||
android:name="io.flutter.embedding.android.NormalTheme"
|
||||
android:resource="@style/NormalTheme" />
|
||||
|
||||
<!-- Disable Flutter's implicit deep-link routing so that
|
||||
app_links/DeepLinkService is the sole handler of incoming
|
||||
deflockapp:// URIs. Without this, Flutter's engine also
|
||||
tries to auto-convert the URI into a Navigator route
|
||||
(e.g. "/add?p=...") which conflicts with the navigation
|
||||
DeepLinkService performs, causing screens pushed by
|
||||
DeepLinkService to be immediately buried by a duplicate
|
||||
HomeScreen route. -->
|
||||
<meta-data
|
||||
android:name="flutter_deeplinking_enabled"
|
||||
android:value="false" />
|
||||
|
||||
|
||||
<!-- Launcher intent -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
||||
@@ -2,8 +2,19 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<!-- Disable Flutter's implicit deep-link routing so that
|
||||
app_links/DeepLinkService is the sole handler of incoming
|
||||
deflockapp:// URIs. Without this, Flutter's engine also tries
|
||||
to auto-convert the URI into a Navigator route (e.g.
|
||||
"/add?p=...") which conflicts with the navigation
|
||||
DeepLinkService performs, causing screens pushed by
|
||||
DeepLinkService to be immediately buried by a duplicate
|
||||
HomeScreen route. -->
|
||||
<key>FlutterDeepLinkingEnabled</key>
|
||||
<false/>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
|
||||
+9
-4
@@ -125,16 +125,21 @@ class DeFlockApp extends StatelessWidget {
|
||||
},
|
||||
initialRoute: '/',
|
||||
onUnknownRoute: (settings) {
|
||||
// Handle deep link routes that Flutter tries to process before app_links
|
||||
// This catches routes like "/?id=13939398601" from "deflockapp://node?id=13939398601"
|
||||
debugPrint('[Navigation] Unknown route intercepted: ${settings.name} (likely deep link, will be handled by DeepLinkService)');
|
||||
// Fallback for any genuinely unknown named route (e.g. a stale/bad
|
||||
// link). Deep links (deflockapp://...) are handled exclusively by
|
||||
// DeepLinkService via the app_links package - Flutter's own
|
||||
// implicit deep-link routing is disabled at the platform level
|
||||
// (see AndroidManifest.xml's flutter_deeplinking_enabled and
|
||||
// Info.plist's FlutterDeepLinkingEnabled) to avoid this handler
|
||||
// double-navigating and burying screens pushed by DeepLinkService.
|
||||
debugPrint('[Navigation] Unknown route intercepted: ${settings.name}');
|
||||
return MaterialPageRoute(
|
||||
settings: settings,
|
||||
builder: (_) => const HomeScreen(),
|
||||
);
|
||||
},
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user