1

I want to click on a URL I received in my email (ex. https://example.com) and have that open my app, then launch that URL in a browser within my app. (ChromeCustomTabs would have been nice, but it launches my app in an endless loop, due to SplashActivity's intent.action.VIEW filter on that URL)

  • The URL will be something like https://example.com/somePath?query=example...
  • I do NOT have the ability to customize the URL sent out via email.
  • I want to open the same URL that opens the app in the browser.
  • I want to open the browser within my app.
  • Additional Info : The actual URL has additional path and query parameters, which are parsed out and handled within my SplashActivity to redirect to the correct screens with the necessary data. In some cases, the URL will not be opened in the app's native browser, but the user will be directed to another screen.
        <activity
            android:name="com.mypackage.myapp.splash.SplashActivity"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="example.com"
                    android:scheme="https" />
            </intent-filter>
        </activity>

I have accomplished this with WebView but given some of WebView's limitations and security issues I'd like to do this without using WebView.

Sampson
  • 662
  • 6
  • 17
  • Did you try to use ChromeCustomTabs? – Simon Marquis Oct 24 '19 at 07:59
  • I tried using ChromeCustomTabs and it does not work because it launches my app in an endless loop due to the subscription of SplashActivity's intent.action.VIEW to `https://example.com`, which is the URL I want to open in-app browser. – Sampson Oct 26 '19 at 01:36
  • 1
    I just bumped into this - we need to basically process any link with `clientdomain.tld/`, and some of those links are not desired to open in the app, and you don't seem to be able to exclude certain links from this app linking, so if I try to redirect from the app to the browser for the links I want to 'ignore', I get this infinite loop where the app gets a link, which opens a browser, which forwards the link .. etc etc – Saik Caskey Jan 06 '23 at 16:28

0 Answers0