Skip to content

Conversation

@NidhiDixit09
Copy link
Collaborator

Reference

SDK-1934 -- Expose a public method to change the Branch API base url.

Summary

Added following APIs in BranchPluginSupport class for setting up Server and CDN Urls-

      + (void)setAPIUrl:(NSString *)url;
     + (void)setCDNBaseUrl:(NSString *)url;

Note: If url passed is not valid or it doesn't start with "http" or "https" then default Urls defined BNCConfig are used.

Type Of Change

  • New feature (non-breaking change which adds functionality)

Testing Instructions

==> Run Unit tests. Following Tests are added for above APIs -

- testSetAPIURL_Example
- testSetAPIURL_InvalidHttp 
- testSetAPIURL_InvalidEmpty 
- testSetCDNBaseURL_Example 
- testSetCDNBaseURL_InvalidHttp 
- testSetCDNBaseURL_InvalidEmpty

Note: Tests for Null url are not added. Because of non_null attribute assigned to class BranchPluginSupport, API was giving warning on passing Null param. So I removed tests for null url.

==> In any test app, set URL https://dashboard.stage.branch.io and then check in Server requests logs, if this new url is used.
[BranchPluginSupport setAPIUrl:@"https://dashboard.stage.branch.io"];

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

…points.

* Static methods are added in class BranchPluginSupport for setting urls for server and cdn.
* Custom url will be saved in preferences. If url provided by user is invalid, defaults will be saved.
* Added unit tests.
@echo-branch echo-branch merged commit c641617 into master Jun 14, 2023
@echo-branch echo-branch deleted the SDK-1934-add-public-method-for-BranchAPIBaseURL branch November 28, 2023 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants