tryPickDistributor

fun tryPickDistributor(activity: Activity, callback: (Boolean) -> Unit)

Try to pick a distributor opening the deeplink "unifiedpush://link", ignoring the default one

It uses the OS dialog to select the applications

This function should be called after a user interaction, e.g. after clicking on a button.

External distributors will be favored over embedded distributors.

Doesn't work with Distributors that don't support AND_3 specs

This function starts a new translucent activity in order to get the result of the distributor activity.

You may prefer to override onActivityResult of your own Activity and use LinkActivityHelper.startPickLinkActivityForResult instead.

Usage

Kotlin:

tryPickDistributor(activityContext) { success ->
if (success) {
//TODO: register, no need to saveDistributor
}
}

Java:

UnifiedPush.tryPickDistributor(activityContext, success -> {
if (success) {
//TODO: register, no need to saveDistributor
}
return null;
});

Parameters

activity

Activity Context

callback

is a function taking a Boolean as parameter. This boolean is true if the registration using the deeplink succeeded.