Skip to content

Commit 0e1bedb

Browse files
Added apiUrl check for Branch.json (#1371)
1 parent 5cfec76 commit 0e1bedb

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

Sources/BranchSDK/Branch.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ - (id)initWithInterface:(BNCServerInterface *)interface
235235
BranchJsonConfig *config = BranchJsonConfig.instance;
236236
self.deferInitForPluginRuntime = config.deferInitForPluginRuntime;
237237

238+
if (config.apiUrl) {
239+
[Branch setAPIUrl:config.apiUrl];
240+
}
241+
238242
if (config.enableLogging) {
239243
[self enableLogging];
240244
}

Sources/BranchSDK/BranchJsonConfig.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
NSString * _Nonnull const BranchJsonConfigDeferInitForPluginRuntimeOption = @"deferInitForPluginRuntime";
1818
NSString * _Nonnull const BranchJsonConfigEnableLogging = @"enableLogging";
1919
NSString * _Nonnull const BranchJsonConfigCheckPasteboardOnInstall = @"checkPasteboardOnInstall";
20+
NSString * _Nonnull const BranchJsonConfigAPIUrl = @"apiUrl";
21+
2022

2123
@interface BranchJsonConfig()
2224
@property (nonatomic, strong) NSDictionary *configuration;
@@ -161,6 +163,11 @@ - (NSString *)testKey
161163
return self[BranchJsonConfigTestKeyOption];
162164
}
163165

166+
- (NSString *)apiUrl
167+
{
168+
return self[BranchJsonConfigAPIUrl];
169+
}
170+
164171
- (id)objectForKey:(NSString *)key
165172
{
166173
return self.configuration[key];

Sources/BranchSDK/Private/BranchJsonConfig.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ extern NSString * _Nonnull const BranchJsonConfigUseTestInstanceOption;
1616
extern NSString * _Nonnull const BranchJsonConfigDeferInitForPluginRuntimeOption;
1717
extern NSString * _Nonnull const BranchJsonConfigEnableLogging;
1818
extern NSString * _Nonnull const BranchJsonConfigCheckPasteboardOnInstall;
19+
extern NSString * _Nonnull const BranchJsonConfigAPIUrl;
1920

2021
@interface BranchJsonConfig : NSObject
2122

@@ -29,6 +30,7 @@ extern NSString * _Nonnull const BranchJsonConfigCheckPasteboardOnInstall;
2930
@property (nonatomic, readonly, assign) BOOL deferInitForPluginRuntime;
3031
@property (nonatomic, readonly, assign) BOOL enableLogging;
3132
@property (nonatomic, readonly, assign) BOOL checkPasteboardOnInstall;
33+
@property (nonatomic, readonly, nullable, copy) NSString *apiUrl;
3234

3335
- (nullable id)objectForKey:(NSString * _Nonnull)key;
3436
- (nullable id)objectForKeyedSubscript:(NSString * _Nonnull)key;

0 commit comments

Comments
 (0)