Neernay
Neernay

Reputation: 389

Facing issue while publishing Instant App on Google Play Console


I am facing the below issue while publishing the Instant app from Google Play Console.

The default URL "null"

The same app is published before without any error. Please check the manifest content of the Instant app. Domain masked for privacy.
The default URL is set in Instant and main app as well. FYI, the source code for Instant and main is different.

<activity
      android:name=".InstantPaymentHome"
      android:windowSoftInputMode="adjustResize"
      android:configChanges="locale"
      android:exported="true">

      <meta-data
          android:name="default-url"
          android:value="https://www.mydomain.com.sa" />

          <intent-filter>
             <action android:name="android.intent.action.MAIN" />
             <category android:name="android.intent.category.LAUNCHER" />
          </intent-filter>

          <intent-filter android:autoVerify="true">
             <action android:name="android.intent.action.VIEW" />

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

             <data
                 android:scheme="https"
                 android:host="mydomain.com.sa"
                 android:pathPattern="/pay" />
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

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

                <data
                    android:scheme="https"
                    android:host="www.mydomain.com.sa"
                    android:pathPattern="/pay" />
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

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

                <data
                    android:scheme="http"
                    android:host="mydomain.com.sa"
                    android:pathPattern="/pay" />
            </intent-filter>
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

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

                <data
                    android:scheme="http"
                    android:host="www.mydomain.com.sa"
                    android:pathPattern="/pay" />
            </intent-filter>
</activity>

Upvotes: 2

Views: 736

Answers (2)

Neernay
Neernay

Reputation: 389


I have found a much cleaner solution. Just add the /.* to the pathPattern as below. The rest of the default-url and other remains remain the same.

<data
    android:scheme="https"
    android:host="www.example.com.sa"
    android:pathPattern="/pay/.*" />

This has solved the problem I was facing. Adding the wild character /.* will match any URL with a pattern like below

http://www.example.com/pay/en?amount=67&number=06737364646
http://www.example.com/pay/ar?amount=67
http://www.example.com/pay?amount=67

Upvotes: 1

ProjectDelta
ProjectDelta

Reputation: 878

So I faced the same issue and after some trial and error I have managed to get passed it

My setup was quite similar to the OP

The problem, I believe, is that the URL defined in <meta-data android:name="default-url" android:value="https://www.mydomain.com.sa" /> does not exactly match the one defined in the <intent-filter> because the <intent-filter> has android:pathPattern="/pay" so the URL defined by the intent-filter is "https://www.mydomain.com.sa/pay" but default-url is "https://www.mydomain.com.sa" without the /pay

So the solution that worked for me is to change the default-url to this

<activity ...>
    <meta-data
      android:name="default-url"
      android:value="https://www.mydomain.com.sa/pay" />
    ....
</activity>

Upvotes: 3

Related Questions