+ <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-dependent-content" data-active="" data-togglable=":browser-switch:dokkaHtmlPartial/release"><div class="symbol monospace"><span class="token keyword">constructor</span><span class="token punctuation">(</span><span class="token punctuation">)</span></div><p class="paragraph">Construct a client that manages browser switching with Chrome Custom Tabs fallback only. This constructor does not initialize Auth Tab support. For Auth Tab functionality, use <a href="-browser-switch-client.html">BrowserSwitchClient</a> instead.</p><hr><div class="symbol monospace"><span class="token keyword">constructor</span><span class="token punctuation">(</span><span class="parameters "><span class="parameter "><span><span class="token annotation builtin">@</span><a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html"><span class="token annotation builtin">NonNull</span></a> </span>caller<span class="token operator">: </span><a href="https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller.html">ActivityResultCaller</a></span></span><span class="token punctuation">)</span></div><p class="paragraph">Construct a client that manages the logic for browser switching and automatically initializes the Auth Tab launcher. </p><p class="paragraph">IMPORTANT: This constructor enables the AuthTab functionality, which has several caveats: </p><ul><li>This constructor must be called in the activity/fragment's <code class="lang-kotlin">onCreate()</code> method to properly register the activity result launcher before the activity/fragment is started. </li><li>The caller must be an <a href="https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResultCaller.html">ActivityResultCaller</a> to register for activity results. </li><li><a href="../-launch-type/-a-c-t-i-v-i-t-y_-n-e-w_-t-a-s-k/index.html">ACTIVITY_NEW_TASK</a> is not supported when using AuthTab and will be ignored. Only <a href="../-launch-type/-a-c-t-i-v-i-t-y_-c-l-e-a-r_-t-o-p/index.html">ACTIVITY_CLEAR_TOP</a> is supported with AuthTab. </li><li>When using SingleTop activities, you must check for launcher results in <code class="lang-kotlin">onResume()</code> as well as in <code class="lang-kotlin">onNewIntent()</code>, since the AuthTab activity result might be delivered during the resuming phase. </li><li>Care must be taken to avoid calling <a href="complete-request.html">completeRequest</a> multiple times for the same result. Merchants should properly track their pending request state to ensure the completeRequest method is only called once per browser switch session. </li><li>AuthTab support is browser version dependent. It requires Chrome version 137 or higher on the user's device. On devices with older browser versions, the library will automatically fall back to Custom Tabs. This means that enabling AuthTab is not guaranteed to use the AuthTab flow if the user's browser version is too old. </li></ul><p class="paragraph">Consider using the default constructor <a href="-browser-switch-client.html">BrowserSwitchClient</a> if these limitations are incompatible with your implementation.</p><h4 class="">Parameters</h4><div class="table"><div class="table-row" data-filterable-current=":browser-switch:dokkaHtmlPartial/release" data-filterable-set=":browser-switch:dokkaHtmlPartial/release"><div class="main-subrow keyValue "><div class=""><span class="inline-flex"><div><u><span><span>caller</span></span></u></div></span></div><div><div class="title"><p class="paragraph">The ActivityResultCaller used to initialize the Auth Tab launcher.</p></div></div></div></div></div></div></div>
0 commit comments