No description
  • Kotlin 84.1%
  • Shell 10.4%
  • CSS 5.5%
Find a file
sim 1f44b1d5ee
All checks were successful
ci/woodpecker/push/main Pipeline was successful
Deprecate in favor of OS picker
2026-01-05 14:42:05 +01:00
.woodpecker Use CI for 1.0 branch 2024-08-29 11:52:28 +02:00
connector_ui Deprecate in favor of OS picker 2026-01-05 14:42:05 +01:00
dokka Finish Dokka doc 2024-09-26 17:17:48 +02:00
gradle/wrapper Add gradle-wrapper.jar for jitpack 2024-08-29 11:45:11 +02:00
scripts Fix hash of artifacts 2024-08-29 14:24:53 +02:00
.gitignore Init 2024-08-12 18:06:38 +00:00
.jitpack.yml Init 2024-08-12 18:06:38 +00:00
build.gradle Add dokka plugin 2024-10-21 15:23:12 +02:00
gradle.properties Init 2024-08-12 18:06:38 +00:00
gradlew Init 2024-08-12 18:06:38 +00:00
gradlew.bat Init 2024-08-12 18:06:38 +00:00
LICENSE Init 2024-08-12 18:06:38 +00:00
README.md Deprecate in favor of OS picker 2026-01-05 14:42:05 +01:00
settings.gradle Change name in settings 2024-08-22 10:48:11 +00:00

Deprecated: This library is deprecated. You should use OS picker instead, available with tryUseCurrentOrDefaultDistributor and tryPickDistributor. You can also implement your own dialog/UI to pick a distributor, it will have a better integration in your application than this library.

UnifiedPush android-connector-ui

This library provides a dialog to let the user pick a distributor and register to it.

Documentation

Documentation available at https://unifiedpush.org/kdoc/connector_ui/

v1.0.x requires minSdk > 16

v1.1.x requires minSdk > 21 and uses a more recent version of appcompat

Usage

SelectDistributorDialogsBuilder(
    context,
    object : UnifiedPushFunctions {
        override fun getAckDistributor(): String? =
            UnifiedPush.getAckDistributor(context)

        override fun getDistributors(): List<String> =
            UnifiedPush.getDistributors(context)

        override fun register(instance: String) =
            UnifiedPush.register(context, instance)

        override fun saveDistributor(distributor: String) =
            UnifiedPush.saveDistributor(context, distributor)
        
        override fun tryUseDefaultDistributor(callback: (Boolean) -> Unit) =
            UnifiedPush.tryUseDefaultDistributor(activity, callback)
    }
).run()

It is possible to customize your dialog. For instance, to change the content of the dialog and to do nothing if there isn't any distributor:

object: SelectDistributorDialogBuilder(
    this,
    object : UnifiedPushFunctions {
        override fun getAckDistributor(): String? =
            UnifiedPush.getAckDistributor(context)

        override fun getDistributors(): List<String> =
            UnifiedPush.getDistributors(context)

        override fun register(instance: String) =
            UnifiedPush.register(context, instance)

        override fun saveDistributor(distributor: String) =
            UnifiedPush.saveDistributor(context, distributor)
    }
){
    override var registrationDialogContent: MyRegistrationDialogContent

    override fun onNoDistributorFound() {
        // do nothing
    }
}.run()

Funding

This project is funded through NGI Zero Core, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.

NLnet foundation logo NGI Zero Logo