Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass long URL when try creating Short URL in Offline #237

Closed
vishnunew opened this issue Aug 29, 2023 · 6 comments
Closed

Pass long URL when try creating Short URL in Offline #237

vishnunew opened this issue Aug 29, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@vishnunew
Copy link

vishnunew commented Aug 29, 2023

Describe the bug
Currently Long URL is not passed when creating short URL in offline. Branch.Io does support that. As per documentation it returns the Long URL if it fails to generate short URL. I have already checked that by debugging on Android it does return long URL in offline or failed to create URL.

To Reproduce
Steps to reproduce the behavior:

  1. Create short URL in Offline
  2. Check it returns null error

Expected behavior
It should pass the long URL if the URL is not null

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (Please complete the following information. remove session if not platform):

  • Flutter: version: 3.10.5

  • Package version: 6.6.0

  • OS: Both iOS and Android

  • Device: All device

  • Additional context

https://help.branch.io/developers-hub/docs/ios-full-reference#shortened-links
Screenshot 2023-08-29 at 10 46 01 AM

@vishnunew vishnunew added the bug Something isn't working label Aug 29, 2023
@RodrigoSMarques
Copy link
Owner

This package calls Branch Native SDK functions on each platform.

The problem reported is not in the Flutter package, but in the Native SDK.

Please open an issue in the platform repository:

@vishnunew
Copy link
Author

@RodrigoSMarques I have debug this package on Android and did return Long URL when generating short URL in offline at this file.


It also returns error but in the code it was not considering the URL but it did return URL from Branch SDK.

@RodrigoSMarques
Copy link
Owner

Strange. If the Branch SDK returns an error, the link will not be returned.

    buo.generateShortUrl(activity, linkProperties, new Branch.BranchLinkCreateListener() {
      @Override
      public void onLinkCreate(String url, BranchError error) {

        if (error == null) {
          LogUtils.debug(DEBUG_NAME, "Branch link to share: " + url);
          response.put("success", true);
          response.put("url", url);
        } else {
          response.put("success", false);
          response.put("errorCode", String.valueOf(error.getErrorCode()));
          response.put("errorMessage", error.getMessage());
        }
        result.success(response);
      }
    });

I need to debug, I'll do that later.

@RodrigoSMarques
Copy link
Owner

If the SDK returns an error, but also returns the URL, I can return the same in the function.
I will do a debug

@RodrigoSMarques
Copy link
Owner

@vishnunew

Debugging the code on iOS and Android, I found that even with the connectivity error, the url is generated.
I will release a new version with this fix.

RodrigoSMarques added a commit that referenced this issue Sep 2, 2023
* Fix issue #237: `Pass long URL when try creating Short URL in Offline`
This was referenced Sep 2, 2023
@RodrigoSMarques
Copy link
Owner

Closed. Version 6.7.1 with fix released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants