BranchMetrics / android-branch-deep-linking-attribution

The Branch Android SDK for deep linking and attribution. Branch helps mobile apps grow with deep links / deeplinks that power paid acquisition and re-engagement campaigns, referral programs, content sharing, deep linked emails, smart banners, custom user onboarding, and more.
https://docs.branch.io/pages/apps/android/
MIT License
395 stars 155 forks source link

[SDK-2329] Added apiUrl check in BranchJSONConfig #1183

Closed nsingh-branch closed 3 months ago

nsingh-branch commented 3 months ago

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]

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

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

codecov[bot] commented 3 months ago

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 ```diff @@ 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.