Search code examples
androidsmsdeep-linkinggoogle-app-invites

Google app invites SMS deep link not opening app


My app is using googles app invites framework (the pre firebase version), links within email invitations work fine, user clicks link, app opens and deep link retrieved however when user sends via SMS embedded link opens play store instead? User clicks open app but no link?

Its as if the SMS link cannot see the app on users device where the email does, any ideas?

It sort of looks like Im missing a permission for SMS to open app?

Manifest excerpt for link retrieval:

<!-- deep link retrieval for appInvites -->
        <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="uid"
                android:scheme="AppName" />
        </intent-filter>

and my invite builder code:

Intent intent = new AppInviteInvitation.IntentBuilder("Invite Friends")
                    .setMessage("Come join us")
                    .setCallToActionText("Join me!")
                    .setDeepLink(Uri.parse("AppName://uid/" + uid))
                    .build();
            startActivityForResult(intent, 1);

Update: I seem to be getting the following message when trying to open SMS invite URL:

XMLHttpRequest cannot load https://play.google.com/log?format=json. The 'Access-Control-Allow-Origin' header has a value 'http://play.google.com' that is not equal to the supplied origin.

This seems to dump the referral and simply open play store?

Thanks.


Solution

  • OK,

    Sort of solved this, turns out its a device/messaging app issue. Samsungs newer messaging app (default SMS application on andoird L & M) handles URL's internally (using Samsungs own browswer?) and not via i.e. Chrome. The result is this internal browser seems to lose the deep link (some sort of a CORS issue between the internal browser and the play store domain as can be seen from the logcat error: XMLHttpRequest cannot load https://play.google.com/log?format=json. The 'Access-Control-Allow-Origin' header has a value 'http://play.google.com' that is not equal to the supplied origin).

    I tested app-invites on a new nexus and invites send no issue with deep link, tested on the same Samsung device (the device I based this post on) only using Hangouts as the default SMS engine and presto, invite deep link processed no problem.

    So now to understand what the hell Samsung are doing with deeplinks in their messaging app.

    Hopefully save you some time in coming to this conclusion, took me a while!