Skip to content

Commit 8831e81

Browse files
Release 8.10.0
## 8.10.0 ### 🎉 Features **Introduced platform-specific API URL configuration.** This allows developers to define different API endpoints for Android and iOS in `branch-config.json`. - Added key `apiUrlAndroid` in `branch-config.json` to configure the API URL for the Android platform. - Added key `apiUrlIOS` in `branch-config.json` to configure the API URL for the iOS platform. ### 🗑️ Removals - ⚠️ The generic `apiUrl` key has been removed from `branch-config.json`. Please update your configuration to use the new platform-specific keys (`apiUrlAndroid` and `apiUrlIOS`).
2 parents d6f3122 + d0ccd42 commit 8831e81

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+528
-481
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 8.10.0
2+
### 🎉 Features
3+
**Introduced platform-specific API URL configuration.** This allows developers to define different API endpoints for Android and iOS in `branch-config.json`.
4+
- Added key `apiUrlAndroid` in `branch-config.json` to configure the API URL for the Android platform.
5+
- Added key `apiUrlIOS` in `branch-config.json` to configure the API URL for the iOS platform.
6+
7+
### 🗑️ Removals
8+
- ⚠️ The generic `apiUrl` key has been removed from `branch-config.json`. Please update your configuration to use the new platform-specific keys (`apiUrlAndroid` and `apiUrlIOS`).
9+
110
## 8.9.0+1
211
### 🎉 Fixes
312
* Updated `README.MD` with correct configuration for `branch-config.json`.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ Copy and paste the following structure into your `assets/branch-config.json` fil
224224

225225
```json
226226
{
227-
"apiUrl": "https://api.myapp.com",
227+
"apiUrlAndroid": "https://api.myapp.com",
228+
"apiUrlIOS": "https://api.myapp.com",
228229
"branchKey": "key_live_test_xxxx_yyyy",
229230
"liveKey": "key_live_xxxx",
230231
"testKey": "key_test_yyyy",
@@ -235,8 +236,8 @@ Copy and paste the following structure into your `assets/branch-config.json` fil
235236

236237
#### Key Descriptions:
237238

238-
* **`apiUrl`**: (Optional) Sets a custom base URL for all calls to the Branch API.
239-
Requires HTTPS.
239+
* **`apiUrlAndroid`**: (Optional) Sets a custom base URL for all calls to the Branch API for Android apps. Requires HTTPS.
240+
* **`apiUrlIOS`**: (Optional) Sets a custom base URL for all calls to the Branch API for iOS apps. Requires HTTPS.
240241
* **`branchKey`**: (Optional) The Branch key that the SDK will use for initialization. It's recommended to set this to your `liveKey` or `testKey` depending on your current build environment.
241242
* **`liveKey`**: (Optional) Your Branch live key from the Branch Dashboard.
242243
* **`testKey`**: (Optional) Your Branch test key from the Branch Dashboard.

android/src/main/java/br/com/rsmarques/flutter_branch_sdk/BranchJsonConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ public class BranchJsonConfig {
1919
public final Boolean enableLogging;
2020
public final Boolean useTestInstance;
2121

22+
public final String apiUrlAndroid;
23+
public final String apiUrlIOS;
2224

2325
private BranchJsonConfig(JSONObject jsonObject) {
2426
this.apiUrl = jsonObject.optString("apiUrl", "");
27+
this.apiUrlAndroid = jsonObject.optString("apiUrlAndroid", "");
28+
this.apiUrlIOS = jsonObject.optString("apiUrlIOS", "");
2529
this.branchKey = jsonObject.optString("branchKey", "");
2630
this.liveKey = jsonObject.optString("liveKey", "");
2731
this.testKey = jsonObject.optString("testKey", "");

android/src/main/java/br/com/rsmarques/flutter_branch_sdk/FlutterBranchSdkPlugin.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,18 @@ private void setupBranch(MethodCall call, final Result result) {
406406

407407
if (branchJsonConfig != null) {
408408
if (!branchJsonConfig.apiUrl.isEmpty()) {
409-
Branch.setAPIUrl(branchJsonConfig.apiUrl);
410-
LogUtils.debug(DEBUG_NAME, "Set API URL from branch-config.json: " + branchJsonConfig.apiUrl);
409+
LogUtils.debug(DEBUG_NAME, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
410+
LogUtils.debug(DEBUG_NAME, "The apiUrl parameter has been deprecated. Please use apiUrlAndroid instead. Check the documentation.");
411+
LogUtils.debug(DEBUG_NAME, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
412+
throw new IllegalArgumentException("The apiUrl parameter has been deprecated. Please use apiUrlAndroid instead. Check the documentation.");
411413
}
412414

415+
if (!branchJsonConfig.apiUrlAndroid.isEmpty()) {
416+
Branch.setAPIUrl(branchJsonConfig.apiUrlAndroid);
417+
LogUtils.debug(DEBUG_NAME, "Set API URL from branch-config.json: " + branchJsonConfig.apiUrlAndroid);
418+
}
419+
420+
413421
if (branchJsonConfig.enableLogging) {
414422
Branch.enableLogging();
415423
LogUtils.debug(DEBUG_NAME, "Set EnableLogging from branch-config.json");

example/.metadata

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819"
7+
revision: "d693b4b9dbac2acd4477aea4555ca6dcbea44ba2"
88
channel: "stable"
99

1010
project_type: app
@@ -13,11 +13,11 @@ project_type: app
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
17-
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
18-
- platform: web
19-
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
20-
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819
16+
create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
17+
base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
18+
- platform: ios
19+
create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
20+
base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
2121

2222
# User provided section
2323

example/assets/branch-config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"apiUrl_test": "https://branch-api-proxy.onrender.com",
2+
"apiUrl_old": "https://branch-api-proxy.onrender.com",
3+
"apiUrlAndroid": "https://branch-api-proxy.onrender.com",
4+
"apiUrlIOS": "https://branch-api-proxy.onrender.com",
35
"branchKey": "key_test_ipQTteg11ENANDeCzSXgqdgfuycWoXYH",
46
"liveKey": "key_live_bkJRqpb15wLqUAgsDVNUIobjyviWi6Wx",
57
"testKey": "key_test_ipQTteg11ENANDeCzSXgqdgfuycWoXYH",

example/ios/.gitignore

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
**/dgph
2-
*.mode1v3
3-
*.mode2v3
4-
*.moved-aside
5-
*.pbxuser
6-
*.perspectivev3
7-
**/*sync/
8-
.sconsign.dblite
9-
.tags*
10-
**/.vagrant/
11-
**/DerivedData/
12-
Icon?
13-
**/Pods/
14-
**/.symlinks/
15-
profile
16-
xcuserdata
17-
**/.generated/
18-
Flutter/App.framework
19-
Flutter/Flutter.framework
20-
Flutter/Flutter.podspec
21-
Flutter/Generated.xcconfig
22-
Flutter/ephemeral/
23-
Flutter/app.flx
24-
Flutter/app.zip
25-
Flutter/flutter_assets/
26-
Flutter/flutter_export_environment.sh
27-
ServiceDefinitions.json
28-
Runner/GeneratedPluginRegistrant.*
29-
30-
# Exceptions to above rules.
31-
!default.mode1v3
32-
!default.mode2v3
33-
!default.pbxuser
34-
!default.perspectivev3
1+
**/dgph
2+
*.mode1v3
3+
*.mode2v3
4+
*.moved-aside
5+
*.pbxuser
6+
*.perspectivev3
7+
**/*sync/
8+
.sconsign.dblite
9+
.tags*
10+
**/.vagrant/
11+
**/DerivedData/
12+
Icon?
13+
**/Pods/
14+
**/.symlinks/
15+
profile
16+
xcuserdata
17+
**/.generated/
18+
Flutter/App.framework
19+
Flutter/Flutter.framework
20+
Flutter/Flutter.podspec
21+
Flutter/Generated.xcconfig
22+
Flutter/ephemeral/
23+
Flutter/app.flx
24+
Flutter/app.zip
25+
Flutter/flutter_assets/
26+
Flutter/flutter_export_environment.sh
27+
ServiceDefinitions.json
28+
Runner/GeneratedPluginRegistrant.*
29+
30+
# Exceptions to above rules.
31+
!default.mode1v3
32+
!default.mode2v3
33+
!default.pbxuser
34+
!default.perspectivev3

example/ios/Flutter/Debug.xcconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2-
#include "Generated.xcconfig"
1+
#include "Generated.xcconfig"
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2-
#include "Generated.xcconfig"
1+
#include "Generated.xcconfig"

example/ios/Podfile

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)