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',
Related
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?
anybody knows how to set local notification to show everyday another notification but with the same title cause with my code i get only the same notification body over and over again. I'm struggling for some days working on it. Anybody knows how to make it work?
Here's my notification code:
Future<void> showNotification(int id, String title, String body) async {
await flutterLocalNotificationsPlugin.periodicallyShow(
id,
title,
body,
RepeatInterval.everyMinute,
const NotificationDetails(
// Android details
android: AndroidNotificationDetails('main_channel', 'Main Channel',
channelDescription: "ashwin",
importance: Importance.max,
priority: Priority.max),
// iOS details
iOS: DarwinNotificationDetails(
sound: 'default.wav',
presentAlert: true,
presentBadge: true,
presentSound: true,
),
),
androidAllowWhileIdle:
true, // To show notification even when the app is closed
);
}
I want to schedule different notification when notification it s called.
Hello Guys I am working on my flutter project Where I am using awesome notification. I want to do two things.
The device notification sound will be the sound source.
The custom sound provided by me will be the sound source.
I don't know How to do point 1. However for point 2 I added notification.mp3 file in my asset folder and give soundSource: 'assets/notification.mp3'
My Notification initialize Code:
AwesomeNotifications().initialize(
null,
[
NotificationChannel(
channelKey: 'key1',
channelName: 'Recipedia',
channelDescription: 'Testing Notification',
defaultColor: const Color(0XFFff735c),
ledColor: const Color(0XFFff735c),
soundSource: 'assets/notification.mp3',
enableLights: true,
enableVibration: true,
playSound: true,
)
],
);
My createNotification code:
void OTPNotification() async {
AwesomeNotifications().createNotification(
content: NotificationContent(
id: 1,
channelKey: 'key1',
title: 'Recipedia',
body: 'We have sent you a OTP code. Please check your email.',
bigPicture: 'assets/OTP1.png',
notificationLayout: NotificationLayout.BigPicture,
)
);
}
I am using awesome_notifications: ^0.0.6+12 as a local notification that shows notification/information on the status bar of the device. So far the function to show a notification runs very well, but I got a problem with the counter of notification.
As we know.. when one notification pops up there will be a flag counter in our icon apps 1 and when the second notification pops up.. it will turn into 2
But, the problem is... when I click the notification from the status bar and then the app is opening, the counter is still 1 while.. it should be removed after I click it... Is there a way to solve this? here is the part of the code
notifRequirement() {
AwesomeNotifications().actionStream.listen((notification) {
if (notification.channelKey == 'basic_channel' && Platform.isIOS) {
AwesomeNotifications().getGlobalBadgeCounter().then(
(value) =>
AwesomeNotifications().setGlobalBadgeCounter(value - 1),
);
}
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (_) => MainScreen(),
),
(route) => route.isFirst,
);
});
}
I call notifRequirement inside initState and in main.dart:
AwesomeNotifications().initialize(
'resource://drawable/darisdmmodified',
[
NotificationChannel(
channelKey: 'scheduled',
channelName: 'Scheduled Notifications',
defaultColor: Colors.red,
locked: false,
importance: NotificationImportance.High,
channelShowBadge: true,
channelDescription: "description 1"),
],
);
I am using Realm for an already quite elaborate application and I want to finish it by adding push notifications. I have already installed react-native-push-notification and make it works with FCM (Firebase Cloud Messaging).
On the client side, I do receive test notifications from Firebase.
I then configured the push notifications in the Realm console by adding the Sender Id and the API Key.
The problem is that when I send a notification from Realm it ends up in "sent", but absolutely nothing happens, no logs in the Realm console, nothing on the Firebase side and nothing on the client side.
The documentation on push notifications for Realm is really limited and I can't quite figure out what to do. The documentation is mainly directed for IOS and Android.
That's my code in index.js:
import PushNotificationIOS from '#react-native-community/push-notification-ios';
import PushNotification from 'react-native-push-notification';
PushNotification.configure({
onRegister: function (token) {
console.log('TOKEN:', token);
},
onNotification: function (notification) {
console.log('NOTIFICATION:', notification);
notification.finish(PushNotificationIOS.FetchResult.NoData);
},
onAction: function (notification) {
console.log('ACTION:', notification.action);
console.log('NOTIFICATION:', notification);
},
onRegistrationError: function (err) {
console.error(err.message, err);
},
permissions: {
alert: true,
badge: true,
sound: true,
},
popInitialNotification: true,
requestPermissions: true,
});
PushNotification.createChannel(
{
channelId: 'fcm_fallback_notification_channel',
channelName: 'FCM CHANNEL',
channelDescription: 'Description test',
},
created => console.log(`CreateChannel returned '${created}'`),
);
PushNotification.localNotification({
channelId: 'fcm_fallback_notification_channel',
vibrate: true,
vibration: 300,
playSound: true,
soundName: 'default',
});
Does anyone know of a tutorial or something that could give me some additional information?
So to make it work, you'll have to add this line in index.js:
PushNotification.subscribeToTopic('topic-id-in-realm-console');
And use the same topic id in Realm console:
It ends up with something like this (index.js):
import PushNotificationIOS from '#react-native-community/push-notification-ios';
import PushNotification from 'react-native-push-notification';
PushNotification.configure({
onRegister: function (token) {
console.log('TOKEN:', token);
},
onNotification: function (notification) {
console.log('NOTIFICATION:', notification);
notification.finish(PushNotificationIOS.FetchResult.NoData);
},
onAction: function (notification) {
console.log('ACTION:', notification.action);
console.log('NOTIFICATION:', notification);
},
onRegistrationError: function (err) {
console.error(err.message, err);
},
permissions: {
alert: true,
badge: true,
sound: true,
},
popInitialNotification: true,
requestPermissions: true,
});
PushNotification.subscribeToTopic('topic-id-in-realm-console');// <== HERE
On client: