Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

feat(deprecate): use app_links instead of uri_links

Prateek Sunal2283f4a25d4f
diff --git a/mobile/lib/ui/account/passkey_page.dart b/mobile/lib/ui/account/passkey_page.dart
index 8db4c3a130..402ec5c83f 100644
--- a/mobile/lib/ui/account/passkey_page.dart
+++ b/mobile/lib/ui/account/passkey_page.dart
@@ -1,6 +1,7 @@
import "dart:async";
import 'dart:convert';
+import "package:app_links/app_links.dart";
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'package:photos/core/configuration.dart';
@@ -15,7 +16,6 @@ import "package:photos/ui/components/models/button_type.dart";
import "package:photos/ui/notification/toast.dart";
import "package:photos/utils/dialog_util.dart";
import "package:photos/utils/navigation_util.dart";
-import "package:uni_links/uni_links.dart";
import 'package:url_launcher/url_launcher_string.dart';
class PasskeyPage extends StatefulWidget {
@@ -126,8 +126,9 @@ class _PasskeyPageState extends State<PasskeyPage> {
}
Future<bool> _initDeepLinks() async {
+ final appLinks = AppLinks();
// Attach a listener to the stream
- linkStreamSubscription = linkStream.listen(
+ linkStreamSubscription = appLinks.stringLinkStream.listen(
_handleDeeplink,
onError: (err) {
_logger.severe(err);
diff --git a/mobile/lib/ui/tabs/home_widget.dart b/mobile/lib/ui/tabs/home_widget.dart
index 25cd5b0cbd..2f92333cdf 100644
--- a/mobile/lib/ui/tabs/home_widget.dart
+++ b/mobile/lib/ui/tabs/home_widget.dart
@@ -2,6 +2,7 @@ import 'dart:async';
import "dart:convert";
import "dart:io";
+import "package:app_links/app_links.dart";
import "package:ente_crypto/ente_crypto.dart";
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
@@ -72,7 +73,6 @@ import "package:photos/utils/collection_util.dart";
import 'package:photos/utils/dialog_util.dart';
import "package:photos/utils/navigation_util.dart";
import 'package:receive_sharing_intent/receive_sharing_intent.dart';
-import 'package:uni_links/uni_links.dart';
class HomeWidget extends StatefulWidget {
const HomeWidget({
@@ -540,8 +540,9 @@ class _HomeWidgetState extends State<HomeWidget> {
}
Future<void> _initDeepLinkSubscriptionForPublicAlbums() async {
+ final appLinks = AppLinks();
try {
- final initialUri = await getInitialUri();
+ final initialUri = await appLinks.getInitialLink();
if (initialUri != null) {
if (initialUri.toString().contains("albums.ente.io")) {
await _handlePublicAlbumLink(initialUri);
@@ -559,7 +560,7 @@ class _HomeWidgetState extends State<HomeWidget> {
_logger.severe("Error while getting initial public album deep link: $e");
}
- _publicAlbumLinkSubscription = uriLinkStream.listen(
+ _publicAlbumLinkSubscription = appLinks.uriLinkStream.listen(
(Uri? uri) {
if (uri != null) {
if (uri.toString().contains("albums.ente.io")) {
@@ -776,8 +777,9 @@ class _HomeWidgetState extends State<HomeWidget> {
Future<bool> _initDeepLinks() async {
// Platform messages may fail, so we use a try/catch PlatformException.
+ final appLinks = AppLinks();
try {
- final String? initialLink = await getInitialLink();
+ final String? initialLink = await appLinks.getInitialLinkString();
// Parse the link and warn the user, if it is not correct,
// but keep in mind it could be `null`.
if (initialLink != null) {
@@ -794,7 +796,7 @@ class _HomeWidgetState extends State<HomeWidget> {
}
// Attach a listener to the stream
- linkStream.listen(
+ appLinks.stringLinkStream.listen(
(String? link) {
_logger.info("Link received: " + link!);
_getCredentials(context, link);
diff --git a/mobile/pubspec.lock b/mobile/pubspec.lock
index 369abf7895..02268417ab 100644
--- a/mobile/pubspec.lock
+++ b/mobile/pubspec.lock
@@ -78,6 +78,38 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.3"
+ app_links:
+ dependency: "direct main"
+ description:
+ name: app_links
+ sha256: "85ed8fc1d25a76475914fff28cc994653bd900bc2c26e4b57a49e097febb54ba"
+ url: "https://pub.dev"
+ source: hosted
+ version: "6.4.0"
+ app_links_linux:
+ dependency: transitive
+ description:
+ name: app_links_linux
+ sha256: f5f7173a78609f3dfd4c2ff2c95bd559ab43c80a87dc6a095921d96c05688c81
+ url: "https://pub.dev"
+ source: hosted
+ version: "1.0.3"
+ app_links_platform_interface:
+ dependency: transitive
+ description:
+ name: app_links_platform_interface
+ sha256: "05f5379577c513b534a29ddea68176a4d4802c46180ee8e2e966257158772a3f"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.0.2"
+ app_links_web:
+ dependency: transitive
+ description:
+ name: app_links_web
+ sha256: af060ed76183f9e2b87510a9480e56a5352b6c249778d07bd2c95fc35632a555
+ url: "https://pub.dev"
+ source: hosted
+ version: "1.0.4"
archive:
dependency: "direct main"
description:
@@ -1189,6 +1221,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.2"
+ gtk:
+ dependency: transitive
+ description:
+ name: gtk
+ sha256: e8ce9ca4b1df106e4d72dad201d345ea1a036cc12c360f1a7d5a758f78ffa42c
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.1.0"
hex:
dependency: transitive
description:
@@ -2684,31 +2724,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.4.1"
- uni_links:
- dependency: "direct main"
- description:
- path: uni_links
- ref: HEAD
- resolved-ref: b9168d982885bf64625154d6e6f8d68b92b98b49
- url: "https://github.com/ente-io/uni_links.git"
- source: git
- version: "0.5.1"
- uni_links_platform_interface:
- dependency: transitive
- description:
- name: uni_links_platform_interface
- sha256: "929cf1a71b59e3b7c2d8a2605a9cf7e0b125b13bc858e55083d88c62722d4507"
- url: "https://pub.dev"
- source: hosted
- version: "1.0.0"
- uni_links_web:
- dependency: transitive
- description:
- name: uni_links_web
- sha256: "7539db908e25f67de2438e33cc1020b30ab94e66720b5677ba6763b25f6394df"
- url: "https://pub.dev"
- source: hosted
- version: "0.1.0"
unicode:
dependency: transitive
description:
diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml
index 187b40b8e2..56fccbc641 100644
--- a/mobile/pubspec.yaml
+++ b/mobile/pubspec.yaml
@@ -23,6 +23,7 @@ dependencies:
android_intent_plus: ^5.2.0
animate_do: ^2.0.0
animated_list_plus: ^0.5.2
+ app_links: ^6.4.0
archive: ^3.6.1
background_fetch: ^1.2.1
battery_info: # update source if there is any update
@@ -190,10 +191,6 @@ dependencies:
system_info_plus: ^0.0.6
tuple: ^2.0.0
ua_client_hints: ^1.4.0
- uni_links: # update to app_links
- git:
- url: https://github.com/ente-io/uni_links.git
- path: uni_links
url_launcher: ^6.3.0
uuid: ^4.5.0
video_editor: