Class ZendeskDeepLinkingParser



  • public class ZendeskDeepLinkingParser
    extends java.lang.Object
    Helper class for parsing links and resolving them into an Intent
    • Constructor Summary

      Constructors 
      Constructor and Description
      ZendeskDeepLinkingParser()
      This constructor initialise the following parsers in the shown order: HelpCenterParser MailParser HttpParser DefaultParser The order parsers were added defines the order urls get processed.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      Intent parse(java.lang.String url, Context context)
      Resolve the provided url into an Intent.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ZendeskDeepLinkingParser

        public ZendeskDeepLinkingParser()
        This constructor initialise the following parsers in the shown order:
        1. HelpCenterParser
        2. MailParser
        3. HttpParser
        4. DefaultParser
        The order parsers were added defines the order urls get processed.
    • Method Detail

      • parse

        public Intent parse(java.lang.String url,
                            Context context)
        Resolve the provided url into an Intent.

        At the moment the following urls are supported:

        1. Zendesk HelpCenter link https://mxssl98.zd-master.com/hc/en-us/articles/123123-Test-article
        2. Mailto links mailto:test@example.com
        3. Web Urls http://www.zendesk.com

        The list above also shows the order in that the urls were handled. Urls that are provided by calling #parse(String, Context) will firstly checked if they are a HC Url, secondly if they're a mailto:... link, and so on.

        If this util isn't able to resolve the Url it will return an Intent with the provided url set as data and Intent#ACTION_VIEW set as action.

        This util won't check if the returned Intent is resolvable.

        Parameters:
        url - An url as String
        context - A valid context
        Returns:
        The resolved Intent or null if one of the arguments is null