diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
index 12375cbae..bd06a98f7 100644
--- a/android/app/build.gradle.kts
+++ b/android/app/build.gradle.kts
@@ -16,6 +16,22 @@ dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4") // For flutter_local_notifications // Workaround for: https://github.com/MaikuB/flutter_local_notifications/issues/2286
}
+
+// Workaround for https://pub.dev/packages/unifiedpush#the-build-fails-because-of-duplicate-classes
+configurations.all {
+ // Use the latest version published: https://central.sonatype.com/artifact/com.google.crypto.tink/tink-android
+ val tink = "com.google.crypto.tink:tink-android:1.17.0"
+ // You can also use the library declaration catalog
+ // val tink = libs.google.tink
+ resolutionStrategy {
+ force(tink)
+ dependencySubstitution {
+ substitute(module("com.google.crypto.tink:tink")).using(module(tink))
+ }
+ }
+}
+
+
android {
namespace = "chat.fluffy.fluffychat"
compileSdk = flutter.compileSdkVersion
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 179341983..167602f73 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -135,20 +135,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
_upUnregistered(i),
onUnregistered: _upUnregistered,
onMessage: _onUpMessage,
);
@@ -352,7 +352,8 @@ class BackgroundPush {
.registerAppWithDialog();
}
- Future _newUpEndpoint(String newEndpoint, String i) async {
+ Future _newUpEndpoint(PushEndpoint newPushEndpoint, String i) async {
+ final newEndpoint = newPushEndpoint.url;
upAction = true;
if (newEndpoint.isEmpty) {
await _upUnregistered(i);
@@ -412,7 +413,8 @@ class BackgroundPush {
}
}
- Future _onUpMessage(Uint8List message, String i) async {
+ Future _onUpMessage(PushMessage pushMessage, String i) async {
+ final message = pushMessage.content;
upAction = true;
final data = Map.from(
json.decode(utf8.decode(message))['notification'],
@@ -446,7 +448,7 @@ class UPFunctions extends UnifiedPushFunctions {
@override
Future registerApp(String instance) async {
- await UnifiedPush.registerApp(instance, features);
+ await UnifiedPush.register(instance: instance, features: features);
}
@override
diff --git a/pubspec.lock b/pubspec.lock
index 161ae9c88..df6893e54 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -2005,26 +2005,26 @@ packages:
dependency: "direct main"
description:
name: unifiedpush
- sha256: "6dbed5a6305ca33f1865c7a3d814ae39476b79a2d23ca76a5708f023f405730f"
+ sha256: "1418375efb580af9640de4eaf4209cb6481f9a48792648ced3051f30e67d9568"
url: "https://pub.dev"
source: hosted
- version: "5.0.2"
+ version: "6.0.2"
unifiedpush_android:
dependency: transitive
description:
name: unifiedpush_android
- sha256: "7443dece0a850ae956514f809983eb2b39fc518c2c7d24dbfe817198bec89134"
+ sha256: "2f25db8eb2fc3183bf2e43db89fff20b2587adc1c361e1d1e06b223a0d45b50a"
url: "https://pub.dev"
source: hosted
- version: "2.3.0"
+ version: "3.1.1"
unifiedpush_platform_interface:
dependency: transitive
description:
name: unifiedpush_platform_interface
- sha256: dd588d78a8b2bfc10430e30035526e98caa543d0b7364a6344b5eb4815721c6d
+ sha256: bb49d2748211520e35e0374ab816faa8a2c635267e71909d334ad868d532eba5
url: "https://pub.dev"
source: hosted
- version: "2.0.2"
+ version: "3.0.1"
unifiedpush_ui:
dependency: "direct main"
description:
diff --git a/pubspec.yaml b/pubspec.yaml
index 25dc46a5f..7761490b8 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -80,7 +80,7 @@ dependencies:
sqlcipher_flutter_libs: ^0.6.7
swipe_to_action: ^0.3.0
tor_detector_web: ^1.1.0
- unifiedpush: ^5.0.1
+ unifiedpush: ^6.0.2
unifiedpush_ui: ^0.1.0
universal_html: ^2.2.4
url_launcher: ^6.3.2