This commit is contained in:
Fmar
2024-12-20 00:13:29 +01:00
parent 19c5772fe8
commit 32ccdb42b8
2 changed files with 22 additions and 6 deletions
+10
View File
@@ -23,6 +23,7 @@
android:name="io.flutter.embedding.android.NormalTheme" android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" android:resource="@style/NormalTheme"
/> />
<meta-data android:name="flutter_deeplinking_enabled" android:value="false" />
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
@@ -38,6 +39,15 @@
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="zapstore" /> <data android:scheme="zapstore" />
</intent-filter> </intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="zapstore.dev" />
<data android:pathPrefix="/download"/>
</intent-filter>
</activity> </activity>
<!-- Don't delete the meta-data below. <!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
+12 -6
View File
@@ -55,18 +55,24 @@ final appInitializer = FutureProvider<void>((ref) async {
// Handle deep links // Handle deep links
final appLinksSub = appLinks.uriLinkStream.listen((uri) async { final appLinksSub = appLinks.uriLinkStream.listen((uri) async {
if (uri.scheme == 'zapstore') { String? appId;
if (uri.scheme == 'https' && uri.hasFragment) {
appId = uri.fragment;
} else if (uri.scheme == 'zapstore') {
appId = uri.host;
}
if (appId != null) {
final adapter = ref.apps.appAdapter; final adapter = ref.apps.appAdapter;
final apps = adapter.findWhereIdentifierInLocal({uri.host}); final apps = adapter.findWhereIdentifierInLocal({appId});
// Filter by signer npub, if present, otherwise pick first // Filter by signer npub, if present, otherwise pick first
final appSignerNpub = uri.queryParameters['signer']; final appSignerNpub = uri.queryParameters['signer'];
var app = var goToApp =
apps.firstWhereOrNull((a) => a.signer.value?.npub == appSignerNpub); apps.firstWhereOrNull((a) => a.signer.value?.npub == appSignerNpub);
if (appSignerNpub == null) { if (appSignerNpub == null) {
app = apps.first; goToApp = apps.first;
} }
if (app != null) { if (goToApp != null) {
appRouter.go('/details', extra: app); appRouter.go('/details', extra: goToApp);
} else { } else {
appRouter.go('/'); appRouter.go('/');
} }