LinkActivityHelper

class LinkActivityHelper(activity: Activity)

Helper with functions to request the distributor's link activity for result and process the result

Usage

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.registerApp now
} else {
// An error occurred, consider no distributor found for the moment
}
}
/* ... */
}

Constructors

Link copied to clipboard
constructor(activity: Activity)

Functions

Link copied to clipboard
fun onLinkActivityResult(requestCode: Int, resultCode: Int, data: Intent?): Boolean

Process result from the distributor's activity

Link copied to clipboard

Start distributor's link activity for result.