You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,12 @@
1
+
## 8.8.0
2
+
### 🎉 Features
3
+
* Configuration through `branch-config.json` file.
4
+
- Some settings can be configured by adding an `assets/branch-config.json` file to your project.
5
+
- This eliminates the need for manual modifications to native files (`AndroidManifest.xml` and `Info.plist`).
6
+
- Toggle between your test and live keys within the `branch-config.json` file, streamlining the development and release process.
7
+
- The `branch-config.json` file and its keys are optional. The plugin will gracefully handle its absence, allowing for programmatic setup or backward compatibility with the manual native setup. If the file is present but a key is missing, the plugin will use default values where applicable.
8
+
- Read the **README.md** for full instructions for JSON-based configuration.
9
+
1
10
## 8.7.1
2
11
### 🐛 Bug Fixes
3
12
* Fix issue #461 : iOS Build Failure using Cocoapods
**Note**: It is not necessary to perform the Branch Android SDK installation steps. The plugin performs these steps.
80
+
**Note**:
81
+
82
+
1. You can configure your Branch keys (`liveKey`, `testKey`) and test mode (`useTestInstance`) centrally in the `assets/branch-config.json` file. Please see the [**(Optional) Configuration via `branch-config.json` file**](#optional-configuration-via-branch-configjson).
83
+
84
+
2. The native Branch Android SDK dependency is included automatically by this plugin. No need to add it manually in your project.
**Note**: It is not necessary to perform the Branch iOS SDK installation steps. The plugin performs these steps.
93
+
**Note**:
94
+
95
+
1. You can configure your Branch keys (`live`, `test`) and test mode (`useTestInstance`) centrally in the `assets/branch-config.json` file. Please see the [**(Optional) Configuration via `branch-config.json` file**](#optional-configuration-via-branch-configjson).
96
+
2. The native Branch iOS SDK dependency is included automatically by this plugin. No need to add it manually in your project.
97
+
90
98
91
99
#### NativeLink™ Deferred Deep Linking
92
100
Use iOS pasteboard to enable deferred deep linking via Branch NativeLink™, which enables 100% matching on iOS through Installs.
@@ -184,6 +192,75 @@ Full example `index.html`:
184
192
185
193
```
186
194
195
+
## (Optional) Configuration via `branch-config.json`
196
+
197
+
One way to configure keys and other settings is through a JSON configuration file.
198
+
199
+
This method allows you to easily manage your test and active keys without modifying native code.
200
+
201
+
The plugin will automatically read this file on startup (only Android/iOs).
202
+
203
+
If you have configured `branch-config.json`, you do not need to manually add your Branch keys to `AndroidManifest.xml` or `Info.plist`.
204
+
205
+
206
+
### Step 1: Create the Configuration File
207
+
208
+
1. In the root of your Flutter project, create a folder named `assets` if it doesn't already exist.
209
+
2. Inside the `assets` folder, create a new file named `branch-config.json`.
210
+
211
+
Your project structure should look like this:
212
+
```
213
+
my_flutter_app/
214
+
├── assets/
215
+
│ └── branch-config.json
216
+
├── lib/
217
+
├── pubspec.yaml
218
+
...
219
+
```
220
+
221
+
### Step 2: Add Your Keys and Settings
222
+
223
+
Copy and paste the following structure into your `assets/branch-config.json` file and replace the placeholder values with your actual Branch keys.
224
+
225
+
```json
226
+
{
227
+
"apiUrl": "https://api.myapi.com/"
228
+
"branchKey": "key_live_test_xxxx_yyyy",
229
+
"liveKey": "key_live_xxxx",
230
+
"testKey": "key_test_yyyy",
231
+
"enableLogging": true,
232
+
"useTestInstance": true,
233
+
}
234
+
```
235
+
236
+
#### Key Descriptions:
237
+
238
+
***`apiUrl`**: (Optional) Sets a custom base URL for all calls to the Branch API.
239
+
Requires HTTPS.
240
+
***`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.
241
+
***`liveKey`**: (Optional) Your Branch live key from the Branch Dashboard.
242
+
***`testKey`**: (Optional) Your Branch test key from the Branch Dashboard.
243
+
***`useTestInstance`**: (Optional, default: `false`) Set to `true` to use the test key for debugging and testing. Set to `false` for production releases. This allows you to easily switch between environments.
244
+
***`enableLogging`**: (Optional, default: `false`) Set to `true` to see detailed logs from the native Branch SDK in your device's log output (Logcat for Android, Console for iOS).
245
+
246
+
**Note:**
247
+
248
+
- if `branchKey`**is present**, it will override the `useTestInstance`/`testKey`/`liveKey` config
249
+
- if `branchKey`**is missing**, `testKey`/`liveKey`, must be present.
250
+
251
+
252
+
### Step 3: Declare the Asset in `pubspec.yaml`
253
+
254
+
Finally, you need to inform your Flutter app about this new asset file. Open your `pubspec.yaml` and add the file path under the `flutter:` section:
255
+
256
+
```yaml
257
+
flutter:
258
+
assets:
259
+
- assets/branch-config.json
260
+
```
261
+
262
+
Done! plugin will now automatically configure itself using the values in this file when your app starts, overriding the values set in `AndroidManifest.xml` and `Info.plist`.
263
+
187
264
## Installation
188
265
To use the plugin, add `flutter_branch_sdk` as a [dependency in your pubspec.yaml file](https://pub.dev/packages/flutter_branch_sdk/install).
***Note***: Remember to set the value to `false` before releasing to production.
699
-
700
-
### iOS
701
-
702
-
1) Create an empty file called `branch.json`.
703
-
704
-
2) Paste the content below into the file or make download [here](https://github.com/RodrigoSMarques/flutter_branch_sdk/blob/master/assets/branch.json):
705
-
706
-
```json
707
-
{
708
-
"useTestInstance":true
709
-
}
710
-
711
-
```
712
-
713
-
3) Add the file `branch.json` to your project using Xcode. Within your project, navigate to File → Add Files.
714
765
715
-
4) Select the `branch.json` file and make sure every target in your project that uses Branch is selected.
0 commit comments