redirectToAppstore static method
Redirects the user to the App Store to download the UPI payment app.
This method takes the name of the UPI payment app (paymentApp
) as input
and constructs the App Store URL for the corresponding app. It then uses
the FlutterNativeUpi plugin to navigate to the App Store.
Supported UPI payment apps and their App Store URLs:
- "Amazon Pay" : https://apps.apple.com/app/id1478350915
- "BhimUpi" : https://apps.apple.com/app/id1200315258
- "Google Pay" : https://apps.apple.com/app/id1193357041
- "Paytm" : https://apps.apple.com/app/id473941634
- "PhonePe" : https://apps.apple.com/app/id1170055821
Parameters:
paymentApp
: The name of the UPI payment app.
Implementation
static void redirectToAppstore(String? paymentApp) async {
String url = "";
switch (paymentApp) {
case "Amazon Pay":
url = "https://apps.apple.com/app/id1478350915";
break;
case "BhimUpi":
url = "https://apps.apple.com/app/id1200315258";
break;
case "Google Pay":
url = "https://apps.apple.com/app/id1193357041";
break;
case "Paytm":
url = "https://apps.apple.com/app/id473941634";
break;
case "PhonePe":
url = "https://apps.apple.com/app/id1170055821";
break;
}
await FlutterNativeUpi(const MethodChannel('flutter_pay_upi'))
.navigateToAppstore(url);
}