PayPalLauncher

constructor(caller: ActivityResultCaller? = null)

Used to launch the PayPal flow in a web browser and deliver results to your Activity

Parameters

caller

Optional ActivityResultCaller parameter. If provided, it will be passed to BrowserSwitchClient


constructor(registry: ActivityResultRegistry)

Used to launch the PayPal flow in a web browser and deliver results. Use it in Compose flows or where ActivityResultCaller is not available.

Parameters

registry

ActivityResultRegistry parameter. It will be passed to BrowserSwitchClient.


constructor(registry: ActivityResultRegistry, resultKey: String)

Used to launch the PayPal flow in a web browser and deliver results, using a custom result key. Use it in Compose flows where the Activity can be recreated while the browser is open, so the result can still be delivered to the new launcher. After the Activity is recreated, call restorePendingRequest before handleReturnToApp.

Parameters

registry

ActivityResultRegistry parameter. It will be passed to BrowserSwitchClient.

resultKey

a unique key identifying this launcher's Activity result. Must be unique per live launcher instance in the same Activity, and stable across process death.