-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make actions without open app #2506
Comments
What platform are you on? Have you tried setting |
this is my code import 'dart:developer'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; class LocalNotification { static Future init() async {
} static void onDidReceiveNotificationResponse( static Future showDownloadNotification(String filePath) async {
} @pragma('vm:entry-point') final String? payload = notificationResponse.payload; } Future openFile(String payload) async { |
In the future, please surround your code with three backticks (the key on top of the Tab key, so `, not '), like this: ```dart Also, you didn't really answer the question. Your code includes details for iOS and Android -- which platform is showing the issue? I assume Android? Then you only really want to focus on this code, right? static Future showDownloadNotification(String filePath) async {
const androidNotificationDetails = AndroidNotificationDetails(
'download_channel',
'File Download',
channelDescription: 'Notification for downloaded files',
importance: Importance.max,
priority: Priority.high,
playSound: true,
actions: [
AndroidNotificationAction('OPEN_FILE_ACTION', 'View', showsUserInterface: false,),
],
);
const platformChannelSpecifics = NotificationDetails(android: androidNotificationDetails);
await flutterLocalNotificationsPlugin.show(
0,
Translate.s.download_finished,
'',
platformChannelSpecifics,
payload: filePath,
);
} In the future, please only include the portions of code that are relevant to the issue, instead of dumping everything for us to sort through. Anyway, this code looks correct... what device did you run it on? Can you push your code to a GitHub repo and share the link here so we can try to reproduce it? |
yes i used android and i add showsUserInterface to false it just close notification without any action i add all code to see the cycle i just send file path to payload and need to open file without open the app i try to add
but it not working
|
can i make action with payload without open the app
The text was updated successfully, but these errors were encountered: