Class POBUrlHandler
-
- All Implemented Interfaces:
public class POBUrlHandlerHelper class to provide Url handling Responsible to open url in either internal browser, external browser or opens up specific application through deeplink.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfacePOBUrlHandler.UrlHandlerListenerInterface to provide Url handler events
-
Constructor Summary
Constructors Constructor Description POBUrlHandler(Context appContext, POBUrlHandler.UrlHandlerListener listener)Constructor
-
Method Summary
Modifier and Type Method Description voidopen(@Nullable() String url, @Nullable() String fallbackUrl)Open landing page, If the url is empty or null or "null" we will go to fallback url voidopen(@NonNull() String url)Handles URL opening with below mentioned rule We are following URL structure recommended by Google which is based on RFC 3976 standard Here is the deeplink URL structure: {deeplink url};browser_fallback_url={fallback url};package={app's package name} In {deeplink url} host part should not be encoded as it is used for delimiting purpose, {fallback url} can be encoded or un-encoded and {app's package name} should not be encoded. -
-
Constructor Detail
-
POBUrlHandler
POBUrlHandler(Context appContext, POBUrlHandler.UrlHandlerListener listener)
Constructor- Parameters:
appContext- Application contextlistener- Instance of UrlHandlerListener
-
-
Method Detail
-
open
void open(@Nullable() String url, @Nullable() String fallbackUrl)
Open landing page, If the url is empty or null or "null" we will go to fallback url
- Parameters:
url- the url on which open action to be performedfallbackUrl- the url which will be opened when the url is null, empty or "null"
-
open
void open(@NonNull() String url)
Handles URL opening with below mentioned rule
We are following URL structure recommended by Google which is based on RFC 3976 standard
Here is the deeplink URL structure: {deeplink url};browser_fallback_url={fallback url};package={app's package name}
In {deeplink url} host part should not be encoded as it is used for delimiting purpose, {fallback url} can be encoded or un-encoded and {app's package name} should not be encoded.
Flow: Check if URL is deeplink supported then executes deeplink on the URL and redirects to specific app and notify onLeaveApp event, if not, then check isInternalBrowser flag is true, open URL in internal browser and notify onInternalBrowserOpen event if not, then check open URL in external browser and notify onLeaveApp event In case if URL is invalid or null, do nothing and notify onErrorOpenUrl event
- Parameters:
url- the URL on which open action to be performed
-
-
-
-