question

brian avatar image
brian asked ·

Linking a user in my Android app to a search query in the Amazon Appstore

Im working on a react-native app and trying to write some native methods on the java side to link the user to a specific search query in either the Google Play store or Amazon Appstore. the method openNetworkSpeedTestApp() works exactly as expected (opening the Google PLay Store to a search for Network Speed Test apps) However the second method openAmazonStoreSearch() just puts my app in the background and takes me back to the fire TV Stick home screen. The Amazon developer docs say this is the way to link a user to their Appstore but im not having any luck. Any help is greatly appreciated.

@ReactMethod
    public void openNetworkSpeedTestApp() {
        Intent networkSpeedIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=speedtestapp"));
        networkSpeedIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mReactContext.startActivity(networkSpeedIntent);
    }
    @ReactMethod
    public void openAmazonStoreSearch() {
        Intent speedTestIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.analiti.fastest.android"));
        speedTestIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mReactContext.startActivity(speedTestIntent);
    }

but if I do this in the openAmazonStoreSearch() method it works just fine for linking me directly to a specific app in the store but not for searches...

@ReactMethod
    public void openAmazonStoreSearch() {
        Intent speedTestIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.analiti.fastest.android"));
        speedTestIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        mReactContext.startActivity(speedTestIntent);
    }
amazon appstoreandroidjava
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Levon@Amazon avatar image
Levon@Amazon answered ·

Hi Brian,

Please see the following article for details on how to implement that:

https://developer.amazon.com/docs/reports-promo/deeplink-to-the-amazon-client.html

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.