diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 1a98e546a9..2d3389cd59 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -537,6 +537,7 @@ dependencies {
implementation(libs.gosimple.nbvcxz)
"fossImplementation"("org.osmdroid:osmdroid-android:6.1.16")
implementation(libs.unifiedpush.connector)
+ implementation(libs.unifiedpush.connector.ui)
"gmsImplementation"(project(":billing"))
diff --git a/app/src/main/res/values/strings2.xml b/app/src/main/res/values/strings2.xml
index dc21d43769..3578eeacf3 100644
--- a/app/src/main/res/values/strings2.xml
+++ b/app/src/main/res/values/strings2.xml
@@ -167,9 +167,4 @@
UnifiedPush
Google Services
WebSocket
- No notification method found
- You have configure Molly to use UnifiedPush, but you haven\'t installed any distributor. For more information, visit https://unifiedpush.org/
- OK
- Ignore
- Choose your notification method
diff --git a/app/src/unifiedpush/java/im/molly/unifiedpush/util/UnifiedPushHelper.kt b/app/src/unifiedpush/java/im/molly/unifiedpush/util/UnifiedPushHelper.kt
index a0a65c8047..d18a338a94 100644
--- a/app/src/unifiedpush/java/im/molly/unifiedpush/util/UnifiedPushHelper.kt
+++ b/app/src/unifiedpush/java/im/molly/unifiedpush/util/UnifiedPushHelper.kt
@@ -4,12 +4,11 @@ import android.content.Context
import im.molly.unifiedpush.device.MollySocketLinkedDevice
import im.molly.unifiedpush.model.UnifiedPushStatus
import org.signal.core.util.logging.Log
-import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.keyvalue.SignalStore
-import org.unifiedpush.android.connector.ChooseDialog
-import org.unifiedpush.android.connector.NoDistributorDialog
-import org.unifiedpush.android.connector.RegistrationDialogContent
+import org.unifiedpush.android.connector.INSTANCE_DEFAULT
import org.unifiedpush.android.connector.UnifiedPush
+import org.unifiedpush.android.connector.ui.SelectDistributorDialogBuilder
+import org.unifiedpush.android.connector.ui.UnifiedPushFunctions
object UnifiedPushHelper {
private val TAG = Log.tag(UnifiedPushHelper::class.java)
@@ -33,16 +32,16 @@ object UnifiedPushHelper {
fun registerAppWithDialogIfNeeded(context: Context) {
checkDistributorPresence(context)
if (SignalStore.unifiedpush.status == UnifiedPushStatus.MISSING_ENDPOINT) {
- val dialogContent = RegistrationDialogContent(
- noDistributorDialog = NoDistributorDialog(
- title = context.getString(R.string.UnifiedPush_RegistrationDialog_NoDistrib_title),
- message = context.getString(R.string.UnifiedPush_RegistrationDialog_NoDistrib_message),
- okButton = context.getString(R.string.UnifiedPush_RegistrationDialog_NoDistrib_ok),
- ignoreButton = context.getString(R.string.UnifiedPush_RegistrationDialog_NoDistrib_ignore)
- ),
- chooseDialog = ChooseDialog(context.getString(R.string.UnifiedPush_RegistrationDialog_Choose_title))
- )
- UnifiedPush.registerAppWithDialog(context, registrationDialogContent = dialogContent)
+ object : SelectDistributorDialogBuilder(
+ context,
+ listOf(INSTANCE_DEFAULT),
+ object : UnifiedPushFunctions {
+ override fun getAckDistributor(): String? = UnifiedPush.getAckDistributor(context)
+ override fun getDistributors(): List = UnifiedPush.getDistributors(context)
+ override fun registerApp(instance: String) = UnifiedPush.registerApp(context, instance)
+ override fun saveDistributor(distributor: String) = UnifiedPush.saveDistributor(context, distributor)
+ },
+ ){}.show()
}
}
diff --git a/dependencies.gradle.kts b/dependencies.gradle.kts
index 428193daa1..0334e79a38 100644
--- a/dependencies.gradle.kts
+++ b/dependencies.gradle.kts
@@ -137,7 +137,8 @@ dependencyResolutionManagement {
library("molly-glide-webp-decoder", "im.molly:glide-webp-decoder:1.3.2-2")
// UnifiedPush
- library("unifiedpush-connector", "com.github.UnifiedPush:android-connector:2.4.0")
+ library("unifiedpush-connector", "org.unifiedpush.android:connector:2.5.0")
+ library("unifiedpush-connector-ui", "org.unifiedpush.android:connector-ui:1.1.0-rc2")
// Third Party
library("greenrobot-eventbus", "org.greenrobot:eventbus:3.0.0")
diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml
index 21fd597e17..e74df12c4f 100644
--- a/gradle/verification-metadata.xml
+++ b/gradle/verification-metadata.xml
@@ -8448,6 +8448,14 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
+
+
+
+
+
+
+
+
@@ -8528,6 +8536,11 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
+
+
+
+
+
@@ -9605,6 +9618,22 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+