-
public final class LinkActivityHelperHelper with functions to request the distributor's link activity for result and process the result
In your activity, define a new LinkActivityHelper, override onActivityResult to use onLinkActivityResult then use startLinkActivityForResult to start activity on the distributor.
class MyActivity: Activity() { /* ... */ private val helper = LinkActivityHelper(this) override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) if (!helper.startLinkActivityForResult()) { // No distributor found } } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { if (helper.onLinkActivityResult(requestCode, resultCode, data)) { // The distributor is saved, you can request registrations with UnifiedPush.register now } else { // An error occurred, consider no distributor found for the moment } } /* ... */ }
-
-
Constructor Summary
Constructors Constructor Description LinkActivityHelper(Activity activity)
-
Method Summary
Modifier and Type Method Description final BooleanstartLinkActivityForResult()Start distributor's link activity for result. final BooleanonLinkActivityResult(Integer requestCode, Integer resultCode, Intent data)Process result from the distributor's activityYou have to call UnifiedPush.register for all your registrations if this returns true.-
-
Constructor Detail
-
LinkActivityHelper
LinkActivityHelper(Activity activity)
-
-
Method Detail
-
startLinkActivityForResult
final Boolean startLinkActivityForResult()
Start distributor's link activity for result.
-
onLinkActivityResult
final Boolean onLinkActivityResult(Integer requestCode, Integer resultCode, Intent data)
Process result from the distributor's activity
You have to call UnifiedPush.register for all your registrations if this returns
true.
-
-
-
-