android-branch-deep-linking-attribution icon indicating copy to clipboard operation
android-branch-deep-linking-attribution copied to clipboard

BranchLinkCreateListener callback never executed when generateShortUrl is called without network connection

Open NicolasEymael opened this issue 3 years ago • 0 comments

Describe the bug

Our customer complained that the app keeps loading forever when generating a deep link when the device has no network connection.

We use the generateShortUrl() method to generate the link asynchronously and display a loading animation during link generation. The problem is that the BranchLinkCreateListener callback never executes if the device is offline.

Is this the expected behavior of the method? I thought the callback would execute with a BranchError in that case.

buo.generateShortUrl(this, linkProperties, new Branch.BranchLinkCreateListener() {
            @Override
            public void onLinkCreate(String s, BranchError branchError) {
                // do something...
                // this callback is never executed when offline
            }
        });

Steps to reproduce

  1. Turn off network connection
  2. Call generateShortUrl()
  3. The callback is never executed

Expected behavior

The callback should be executed with a BranchError

SDK Version

5.1.4

Make and Model

Google Pixel 2 Emulator

OS

Android 9 (API 28)

Additional Information/Context

No response

NicolasEymael avatar Sep 29 '22 19:09 NicolasEymael