How to open Amazon app using affiliate link in flutter app?

714 Views Asked by At

I want to add Amazon Affiliate link in my flutter app. I want to open Amazon App when someone click on Button. I am using url launcher package. I have created the button which is opening amazon.com in browser.

ElevatedButton(
          onPressed: () {
            launch("https://www.amazon.com/");
          },
          child: Text("amazon"),
        ),
1

There are 1 best solutions below

1
Karim On

You can use external_app_launcher plugin

https://pub.dev/packages/external_app_launcher

await LaunchApp.isAppInstalled(
  androidPackageName: 'com.amazon.mShop.android.shopping'
  iosUrlScheme: 'amzn://'
);

Not sure about the amzn:// and com.amazon.mShop.android.shopping

But better, you can use the official amazon docs in case the user does not have the app installed

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