Flutter_Stripe: Apple Pay and Android Pay true does nothing - flutter

So I have configure the plugin to be able to pay with stripe with a credit card. When I turn on Apple Pay and Android Pay to true, nothing changes. What extra configuration do I have to apply? From documentation I am not able to do by myself
Using the following payment sheet without extra configuration:
// 2. initialize the payment sheet
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
// Main params
paymentIntentClientSecret: data['paymentIntent'],
merchantDisplayName: 'Flutter Stripe Store Demo',
// Customer params
customerId: data['customer'],
customerEphemeralKeySecret: data['ephemeralKey'],
// Extra params
applePay: true,
googlePay: true,
style: ThemeMode.dark,
primaryButtonColor: Colors.redAccent,
billingDetails: billingDetails,
testEnv: true,
merchantCountryCode: 'DE',
),
);
and when PaymenSheet appears, I expect a button to select android pay or apple pay based on the platform.
Probably missing basic configuration, but I am not able to find any tutorial o configuration for flutter_stripe

Related

flutter inappwebview : "window.flutter_inappwebview.callHandler" dosn't work in ios

javascript call “ window.flutter_inappwebview.callHandler('handlerFoo') ”
version: ^5.7.2+2
android is ok,but can't use in ios;
In addition, it is found that consoleMessage is invalid under ios.
my options:
options = InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
useShouldOverrideUrlLoading: true,
useShouldInterceptFetchRequest: true,
),
android: AndroidInAppWebViewOptions(
useHybridComposition: true,
),
ios: IOSInAppWebViewOptions(
allowsInlineMediaPlayback: true,
),
);
enter image description here
enter image description here
by the way ,There is a very old project in which he uses webview interaction within ios:
"window.webkit.messageHandlers.openScan.postMessage({})"
How to intercept the request "window.webkit.messageHandlers.openScan.postMessage ({})" without modifying the original web page project?
Thank you very much for your help
Can you run it for me?

How do I show a notification when app is closed?

I saw different question regarding this topic like this one:
Flutter send local notification when app is closed (alarm)
Some of them with accepted answers but nothing seems to work with latest version. Notification package has changed and all of these examples are deprecated.
I tried actual version (flutter_local_notifications: ^12.0.0) and as soon as I close the app I don't receive any notification at all.
const AndroidNotificationChannel channel = AndroidNotificationChannel(
'high_importance_channel', // id
'High Importance Notifications', // title
importance: Importance.high,
);
var detroit = tz.getLocation('America/Detroit');
var now = tz.TZDateTime.now(detroit);
await _flutterLocalNotificationsPlugin.zonedSchedule(
0,
'scheduled title',
'scheduled body',
tz.TZDateTime.now(now.location).add(const Duration(seconds: 5)),
NotificationDetails(
android: AndroidNotificationDetails(
channel.id,
channel.name,
),
),
androidAllowWhileIdle: true,
uiLocalNotificationDateInterpretation:
UILocalNotificationDateInterpretation.absoluteTime,
);
The only notifications that I implemented in the background are the ones coming from firebase cloud functions, but I don't want to rely on this for simple notifications (specially because of the plan).
Is there anything working out there?
This was already working. The trick was to not test on debug:
flutter run --release

Stripe does not show payment sheet

I do receive the client secret and all my test payments are shown on stripe dashboard. However when calling present payment it gives me the error 'No payment sheet has been initialized yet'.
// calling func on cloud functions
// create payment intent
final url = Uri.parse(
'https://us-central1-wpbakery-52166.cloudfunctions.net/stripePayment');
final response =
await http.get(url, headers: {'Content-Type': 'application/json'});
_paymentIntent = json.decode(response.body);
print(_paymentIntent);
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
paymentIntentClientSecret: _paymentIntent['paymentIntent'],
applePay: true,
style: ThemeMode.dark,
));
await Stripe.instance.presentPaymentSheet();
}```
I assume you're using the flutter_stripe library?
If so, then you need to also be passing in merchantCountryCode in SetupPaymentSheetParameters since the docs mention that it's required when Apple Pay is enabled [1].
You should also make sure you set Stripe.merchantIdentifier before calling initPaymentSheet.

Issue in Displaying Notification with awesome_notifications in Flutter

I am new to flutter.I have started to create a reminder app.I am trying to call a push notification on android alarm call back.I am using awesome_notifications. On call back I am calling _ringAlarm().I have pasted it below.
It says D/NotificationSender( 5192): Notification created, but nothing shows on screen.
This exception was thrown while running:
W/System.err( 5192): java.lang.IllegalArgumentException: Invalid
notification (no valid small icon): Notification(channel=basic_channel
shortcut=null contentView=null vibrate=null sound=null tick
defaults=0x0 flags=0x11 color=0xff9d50dd vis=UNKNOWN(2))
Future _ringAlarm() async {
AwesomeNotifications().initialize(
'resource://drawable/logo.png',
[
NotificationChannel(
channelKey: 'basic_channel',
channelName: 'Basic notifications',
channelDescription: 'Notification channel for basic tests',
defaultColor: Color(0xFF9D50DD),
ledColor: Colors.white
)
]
);
AwesomeNotifications().isNotificationAllowed().then((isAllowed) {
if (!isAllowed) {
AwesomeNotifications().requestPermissionToSendNotifications();
}
});
AwesomeNotifications().createNotification(
content: NotificationContent(
id: 10,
channelKey: 'basic_channel',
title: 'Simple Notification',
body: 'Simple body'
)
);
}
That means that you had some problems with your icon to solve this problem you have to add an icon under "[project]/android/app/src/main/res/drawable/" named "logo.png". drawable position image
When initializing you must insert only the name without the extension like this
AwesomeNotifications().initialize(
'resource://drawable/logo',
[
NotificationChannel(
channelKey: 'basic_channel',
channelName: 'Basic notifications',
channelDescription: 'Notification channel for basic tests',
defaultColor: Color(0xFF9D50DD),
ledColor: Colors.white
)
]
);
Right now the only method available is via resource
On top of Workflop's answer, I also had to uninstall the app from my phone, then run the installation again on Android Studio.
I had the same issue when adding an image to my app. It seems to be related to the debug cache.
I also found out that the source image is extremely restricted, but somehow this is not explained in the Awesome Notifications repo. Apparently, images must be 120x120 resolution at max and contain only simple graphics, not including pasted images. It only worked for me with text and vectorial graphics.

How to change **Touch the fingerprint sensor** test local_auth Flutter

I'm using the local_auth package in my flutter app. I want to make the pop-up multi-lingual, so I changed the text using AndroidAuthMessages. but I'm not able to change Touch the fingerprint sensor and Not recognized text.
Code:
AndroidAuthMessages androidAuthStrings = AndroidAuthMessages(
cancelButton: I18n.of(context).cancel,
signInTitle: I18n.of(context).signInTitle,
fingerprintRequiredTitle: I18n.of(context).fingerprintRequiredTitle,
fingerprintHint: '',
fingerprintNotRecognized:I18n.of(context).fingerprintNotRecognized,
fingerprintSuccess: I18n.of(context).fingerprintSuccess,
goToSettingsButton: I18n.of(context).goToSettingsButton,
goToSettingsDescription: I18n.of(context).goToSettingsDescription,
);
bool didAuthenticate = await localAuth.authenticateWithBiometrics(
localizedReason: I18n.of(context).localizedReason,
useErrorDialogs: true,
stickyAuth: true,
sensitiveTransaction: true,
androidAuthStrings: androidAuthStrings,
);
Image:
https://i.stack.imgur.com/Xdko6.png
Set localizedReason: '' value when you call local_auth authenticate method.
await localAuthentication.authenticate(
androidAuthStrings: androidAuthStrings,
localizedReason: "Your text", // Set value here
useErrorDialogs: true,
stickyAuth: false,
biometricOnly: true
);
Set the value of fingerprintHint: '', to whatever you want.
Example fingerprintHint: 'Touch to Login',