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

[SDK-2329] Added apiUrl check in BranchJSONConfig

Open nsingh-branch opened this issue 5 months ago • 1 comments

Reference

SDK-2329 -- Support setting Branch API URL in Branch.json

Description

Added a new field to branch.json for setting the Branch API URL. The config check and setAPIUrl call are done in the getAutoInstance in the same place as the deferInitForPluginRuntime() check. One quirk is that all of the base URL's are stored with a "/" at the end, so we need to add that to the provided URL when making the setAPIUrl call. We don't want to have a URL ending with a "/" in the branch.json itself though since on iOS, the base URLs are stored without the "/".

Testing Instructions

Add "apiUrl": "https://api.branch.io" to a branch.json file and observe the API URL properly change for each request.

Risk Assessment [LOW]

  • [x] I, the PR creator, have tested — integration, unit, or otherwise — this code.

Reviewer Checklist (To be checked off by the reviewer only)

  • [ ] JIRA Ticket is referenced in PR title.
  • Correctness & Style
    • [ ] Conforms to AOSP Style Guides
    • [ ] Mission critical pieces are documented in code and out of code as needed.
  • [ ] Unit Tests reviewed and test issue sufficiently.
  • [ ] Functionality was reviewed in QA independently by another engineer on the team.

cc @BranchMetrics/saas-sdk-devs for visibility.

nsingh-branch avatar Mar 28 '24 18:03 nsingh-branch

Codecov Report

Attention: Patch coverage is 40.90909% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 38.28%. Comparing base (83cf93a) to head (c56248f). Report is 2 commits behind head on master.

Files Patch % Lines
...main/java/io/branch/referral/BranchJsonConfig.java 20.00% 7 Missing and 1 partial :warning:
...h-SDK/src/main/java/io/branch/referral/Branch.java 37.50% 4 Missing and 1 partial :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1183      +/-   ##
============================================
+ Coverage     38.24%   38.28%   +0.03%     
- Complexity      687      690       +3     
============================================
  Files            59       59              
  Lines          6309     6327      +18     
  Branches        944      946       +2     
============================================
+ Hits           2413     2422       +9     
- Misses         3448     3455       +7     
- Partials        448      450       +2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 28 '24 18:03 codecov[bot]