Closed dinoleonetti closed 10 months ago
Hi @dinoleonetti If you create a PR and update REAME.MD with the usage explanation, I see no problem with merging it into the plugin code.
I've been checking some methods in the Branch SDK code, and I found the methods below that can help direct all requests directly to the gateway, without having to handle fallback.
/**
* <p>Sets a custom base URL for all calls to the Branch API. Requires https.</p>
* @param url The {@link String} URL base URL that the Branch API uses.
*/
public static void setAPIUrl(String url) {
PrefHelper.setAPIUrl(url);
}
/**
* <p>Sets a custom CDN base URL.</p>
* @param url The {@link String} base URL for CDN endpoints.
*/
public static void setCDNBaseUrl(String url) {
PrefHelper.setCDNBaseUrl(url);
}
I can also expose these two methods in the plugin if it works.
Branch.setAPIUrl("https://mygateway.com/api/");
Branch.registerPlugin(PLUGIN_NAME, (String) argsMap.get("version"));
Branch.getAutoInstance(this.context);
Closed. No activity in the last 15 days. If necessary open again.
Which problem is this feature request solving?
Alternate solution for poor network connectivity error due to AdBlock
Describe the solution you'd like
This could be fixed by the plugin returning to the app the link that was received, so the app could access Branch.io through a gateway
Describe alternatives you've considered
Couldn't think of any alternative solution.
Can you submit a pull request?
Yes we could. https://github.com/facily-tech/flutter_branch_sdk/pull/3/files
More detailed explanation below:
About 5% of our user base has AdBlock active on their smartphones and our app that relies on Branch.io for deeplinks does not function properly.
We discussed this with Branch.io support looking for alternate solutions, but there is no support regarding service unavailability due to AdBlock restrictions.
We tried an alternate solution:
So what we needed from the plugin was access to the link that was received. We did this in the repository below (version 7.0.1), and we are already running successfully in production (20% of our userbase of 1.2M phones) for a few weeks. We also did this in version 6.7.1 and was running in beta test (30k users) a few weeks ago, but for production, we updated the solution to version 7.0.1.
We are hoping that this is interest enough so that you will consider including it in future versions so it could help other people (and also reduce our burden to replicate this every time we update the plugin version). We have seen many people complaining about AdBlock restrictions in the past, but unfortunately, no solution has been provided. This is a very restricted solution where the plugin just provides the app with the last link it received.
I even hope that with your broad understanding of the plugin you could come up with a better solution than the one we presented, and it would be much appreciated.