Object ClickUrlHandler
-
- All Implemented Interfaces:
public class ClickUrlHandlerClass to handle any URL related operations.
swagato.mondal
-
-
Field Summary
Fields Modifier and Type Field Description public final static ClickUrlHandlerINSTANCE
-
Method Summary
Modifier and Type Method Description final UnitsetSkipRedirectValidation(Boolean skipRedirectValidation)final BooleancanIntentResolveUrl(Context context, String url)Method to check whether the given URL can be handled by any application. final IntegeropenInExternalApplication(Context context, String url, ResolveInfo resolveInfo, RedirectionValidator redirectionValidator, String api)final IntegeropenInExternalApplication(Context context, String url, RedirectionValidator redirectionValidator, String api)Method to open the given URL in an external application final StringtryOpenInExternalApplication(Context context, String url, String fallbackUrl, RedirectionValidator redirectionValidator, String api)Method to be used to open external application. final BooleanisHttpUrl(Uri uri)Method to check whether the scheme of the given Uri is http or https final BooleancanOpenInEmbeddedBrowser(String url)Method to check whether the given URL can be opened in-app final List<ResolveInfo>getResolveInfo(Context context, String url)Method to get information of applications/activities that can handle a given url. final IntegeropenPlayStoreInlineInstaller(LandingPageHandler.InlineInstallerValidationResult.Valid validationResult)Attempts to launch the Play Store inline installer for the given package id ONLY. -
-
Method Detail
-
setSkipRedirectValidation
final Unit setSkipRedirectValidation(Boolean skipRedirectValidation)
-
canIntentResolveUrl
final Boolean canIntentResolveUrl(Context context, String url)
Method to check whether the given URL can be handled by any application.
- Parameters:
context- Context to be used to check.url- Represents the URL for which the check is done.- Returns:
trueif at least one app can handle the URL, otherwisefalse
-
openInExternalApplication
final Integer openInExternalApplication(Context context, String url, ResolveInfo resolveInfo, RedirectionValidator redirectionValidator, String api)
-
openInExternalApplication
final Integer openInExternalApplication(Context context, String url, RedirectionValidator redirectionValidator, String api)
Method to open the given URL in an external application
- Parameters:
context- Context to be used to open external application.url- The URL to be opened.
-
tryOpenInExternalApplication
final String tryOpenInExternalApplication(Context context, String url, String fallbackUrl, RedirectionValidator redirectionValidator, String api)
Method to be used to open external application.
- Parameters:
context- Context to be used to open external application.url- The URL to be opened.fallbackUrl- If no app can handleurl, then try this.- Returns:
the url the framework could handle. If none then
nullis returned.
-
isHttpUrl
final Boolean isHttpUrl(Uri uri)
Method to check whether the scheme of the given Uri is http or https
-
canOpenInEmbeddedBrowser
final Boolean canOpenInEmbeddedBrowser(String url)
Method to check whether the given URL can be opened in-app
- Parameters:
url- Represents the URL that the method checks upon- Returns:
trueif can be opened in app, otherwisefalse
-
getResolveInfo
final List<ResolveInfo> getResolveInfo(Context context, String url)
Method to get information of applications/activities that can handle a given url.
- Parameters:
context- Context to be used for querying Activities that can handle given url.url- url that is to be handled by applications on device.
-
openPlayStoreInlineInstaller
final Integer openPlayStoreInlineInstaller(LandingPageHandler.InlineInstallerValidationResult.Valid validationResult)
Attempts to launch the Play Store inline installer for the given package id ONLY. Does NOT perform fallback inside this method. Returns NO_ERROR on success, ACTIVITY_NOT_FOUND if Play Store is not resolvable, or mapped error codes on failure.
-
-
-
-