Skip to content

Issue: callBack not triggering for External Browser Launch #40

@firdosjamal

Description

@firdosjamal

Description:
Currently, when the Link SDK opens a URL in the external browser, the callback is occasionally invoked with a SUCCESS status. This behavior is inconsistent, occurring unpredictably. This creates challenges for developers who need to perform additional actions (e.g., pop the current screen, log analytics, or update UI state) once the external browser is opened.

Proposed Enhancement:
Introduce or modify the existing callback mechanism to be triggered after the external browser (launchUrl) is successfully launched.

Proposed Solution:

class: LeanWebClient

    // Open all URLs in default web browser
    if (await canLaunchUrl(uri)) {
      LeanLogger.info(msg: 'Opening URL in browser: ${request.url}');

   
   //  Invoke the existing callBack here

      callback?.call(LeanResponse(
        status: 'BROWSER_LAUNCHED',
        message: 'URL opened in external browser',
        bankId: null,
        exitPoint: null,
        lastApiResponse: null,
        secondaryStatus: null,
        bankIsSupported: null,
        exitIntentPoint: null,
        exitSurveyReason: null,
        leanCorrelationId: null,
      ));

      await launchUrl(uri, mode: LaunchMode.externalApplication);
    } else {
      LeanLogger.info(msg: 'Could not launch ${request.url}');
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions