├── .github ├── ISSUE_TEMPLATE │ └── bug_report.md ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── format.yml │ ├── scripts │ └── install-tools.sh │ └── validate.yml ├── .gitignore ├── CONTRIBUTING.md ├── README.md ├── analysis_options.yaml ├── flutter_local_notifications ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android │ ├── .gitignore │ ├── build.gradle │ ├── gradle.properties │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── dexterous │ │ │ └── flutterlocalnotifications │ │ │ ├── ActionBroadcastReceiver.java │ │ │ ├── FlutterLocalNotificationsPlugin.java │ │ │ ├── ForegroundService.java │ │ │ ├── ForegroundServiceStartParameter.java │ │ │ ├── RuntimeTypeAdapterFactory.java │ │ │ ├── ScheduledNotificationBootReceiver.java │ │ │ ├── ScheduledNotificationReceiver.java │ │ │ ├── isolate │ │ │ └── IsolatePreferences.java │ │ │ ├── models │ │ │ ├── BitmapSource.java │ │ │ ├── DateTimeComponents.java │ │ │ ├── IconSource.java │ │ │ ├── MessageDetails.java │ │ │ ├── NotificationAction.java │ │ │ ├── NotificationChannelAction.java │ │ │ ├── NotificationChannelDetails.java │ │ │ ├── NotificationChannelGroupDetails.java │ │ │ ├── NotificationDetails.java │ │ │ ├── NotificationStyle.java │ │ │ ├── PersonDetails.java │ │ │ ├── RepeatInterval.java │ │ │ ├── ScheduleMode.java │ │ │ ├── ScheduledNotificationRepeatFrequency.java │ │ │ ├── SoundSource.java │ │ │ ├── Time.java │ │ │ └── styles │ │ │ │ ├── BigPictureStyleInformation.java │ │ │ │ ├── BigTextStyleInformation.java │ │ │ │ ├── DefaultStyleInformation.java │ │ │ │ ├── InboxStyleInformation.java │ │ │ │ ├── MessagingStyleInformation.java │ │ │ │ └── StyleInformation.java │ │ │ └── utils │ │ │ ├── BooleanUtils.java │ │ │ ├── LongUtils.java │ │ │ └── StringUtils.java │ │ └── test │ │ └── java │ │ └── com │ │ └── dexterous │ │ └── flutterlocalnotifications │ │ ├── IsolatePreferencesTest.java │ │ └── models │ │ └── NotificationActionTest.java ├── example │ ├── .gitignore │ ├── .metadata │ ├── README.md │ ├── analysis_options.yaml │ ├── android │ │ ├── .gitignore │ │ ├── app │ │ │ ├── build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ ├── androidTest │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── dexterous │ │ │ │ │ └── flutter_local_notifications_example │ │ │ │ │ └── MainActivityTest.java │ │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ │ ├── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── dexterous │ │ │ │ │ │ └── flutter_local_notifications_example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── res │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── drawable │ │ │ │ │ ├── app_icon.png │ │ │ │ │ ├── food.png │ │ │ │ │ ├── launch_background.xml │ │ │ │ │ ├── me.png │ │ │ │ │ ├── sample_large_icon.png │ │ │ │ │ └── secondary_icon.png │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── raw │ │ │ │ │ ├── keep.xml │ │ │ │ │ └── slow_spring_board.mp3 │ │ │ │ │ ├── values-night │ │ │ │ │ └── styles.xml │ │ │ │ │ └── values │ │ │ │ │ └── styles.xml │ │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ └── gradle-wrapper.properties │ │ └── settings.gradle │ ├── icons │ │ ├── 1.5x │ │ │ └── app_icon_density.png │ │ ├── 2.0x │ │ │ └── app_icon_density.png │ │ ├── 3.0x │ │ │ └── app_icon_density.png │ │ ├── 4.0x │ │ │ └── app_icon_density.png │ │ ├── app_icon.png │ │ ├── app_icon_density.png │ │ └── coworker.png │ ├── integration_test │ │ └── flutter_local_notifications_test.dart │ ├── ios │ │ ├── .gitignore │ │ ├── Flutter │ │ │ ├── AppFrameworkInfo.plist │ │ │ ├── Debug.xcconfig │ │ │ └── Release.xcconfig │ │ ├── Podfile │ │ ├── Runner.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ │ └── WorkspaceSettings.xcsettings │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ ├── Runner.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ ├── Runner │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ │ │ └── LaunchImage.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── LaunchImage.png │ │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ │ └── README.md │ │ │ ├── Base.lproj │ │ │ │ ├── LaunchScreen.storyboard │ │ │ │ └── Main.storyboard │ │ │ ├── Info.plist │ │ │ ├── Runner-Bridging-Header.h │ │ │ ├── Runner.entitlements │ │ │ └── RunnerDebug.entitlements │ │ ├── RunnerTests │ │ │ └── RunnerTests.swift │ │ └── slow_spring_board.aiff │ ├── lib │ │ ├── main.dart │ │ ├── padded_button.dart │ │ ├── plugin.dart │ │ ├── repeating.dart │ │ └── windows.dart │ ├── linux │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── flutter │ │ │ ├── CMakeLists.txt │ │ │ ├── generated_plugin_registrant.cc │ │ │ ├── generated_plugin_registrant.h │ │ │ └── generated_plugins.cmake │ │ ├── main.cc │ │ ├── my_application.cc │ │ └── my_application.h │ ├── macos │ │ ├── .gitignore │ │ ├── Flutter │ │ │ ├── Flutter-Debug.xcconfig │ │ │ ├── Flutter-Release.xcconfig │ │ │ └── GeneratedPluginRegistrant.swift │ │ ├── Podfile │ │ ├── Runner.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ ├── Runner.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── Runner │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── app_icon_1024.png │ │ │ │ │ ├── app_icon_128.png │ │ │ │ │ ├── app_icon_16.png │ │ │ │ │ ├── app_icon_256.png │ │ │ │ │ ├── app_icon_32.png │ │ │ │ │ ├── app_icon_512.png │ │ │ │ │ └── app_icon_64.png │ │ │ ├── Base.lproj │ │ │ │ └── MainMenu.xib │ │ │ ├── Configs │ │ │ │ ├── AppInfo.xcconfig │ │ │ │ ├── Debug.xcconfig │ │ │ │ ├── Release.xcconfig │ │ │ │ └── Warnings.xcconfig │ │ │ ├── DebugProfile.entitlements │ │ │ ├── Info.plist │ │ │ ├── MainFlutterWindow.swift │ │ │ └── Release.entitlements │ │ ├── RunnerTests │ │ │ └── RunnerTests.swift │ │ └── slow_spring_board.aiff │ ├── pubspec.yaml │ ├── sound │ │ └── slow_spring_board.mp3 │ ├── test_driver │ │ └── integration_test.dart │ └── windows │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── flutter │ │ ├── CMakeLists.txt │ │ ├── generated_plugin_registrant.cc │ │ ├── generated_plugin_registrant.h │ │ └── generated_plugins.cmake │ │ └── runner │ │ ├── CMakeLists.txt │ │ ├── RCa04060 │ │ ├── RCb04060 │ │ ├── Runner.rc │ │ ├── flutter_window.cpp │ │ ├── flutter_window.h │ │ ├── main.cpp │ │ ├── resource.h │ │ ├── resources │ │ └── app_icon.ico │ │ ├── runner.exe.manifest │ │ ├── utils.cpp │ │ ├── utils.h │ │ ├── win32_window.cpp │ │ └── win32_window.h ├── ios │ ├── .gitignore │ ├── flutter_local_notifications.podspec │ └── flutter_local_notifications │ │ ├── Package.swift │ │ └── Sources │ │ └── flutter_local_notifications │ │ ├── ActionEventSink.m │ │ ├── FlutterEngineManager.m │ │ ├── FlutterLocalNotificationsConverters.m │ │ ├── FlutterLocalNotificationsPlugin.m │ │ ├── PrivacyInfo.xcprivacy │ │ └── include │ │ └── flutter_local_notifications │ │ ├── ActionEventSink.h │ │ ├── FlutterEngineManager.h │ │ ├── FlutterLocalNotificationsConverters.h │ │ └── FlutterLocalNotificationsPlugin.h ├── lib │ ├── flutter_local_notifications.dart │ └── src │ │ ├── callback_dispatcher.dart │ │ ├── flutter_local_notifications_plugin.dart │ │ ├── helpers.dart │ │ ├── initialization_settings.dart │ │ ├── notification_details.dart │ │ ├── platform_flutter_local_notifications.dart │ │ ├── platform_specifics │ │ ├── android │ │ │ ├── bitmap.dart │ │ │ ├── enums.dart │ │ │ ├── icon.dart │ │ │ ├── initialization_settings.dart │ │ │ ├── message.dart │ │ │ ├── method_channel_mappers.dart │ │ │ ├── notification_channel.dart │ │ │ ├── notification_channel_group.dart │ │ │ ├── notification_details.dart │ │ │ ├── notification_sound.dart │ │ │ ├── person.dart │ │ │ ├── schedule_mode.dart │ │ │ └── styles │ │ │ │ ├── big_picture_style_information.dart │ │ │ │ ├── big_text_style_information.dart │ │ │ │ ├── default_style_information.dart │ │ │ │ ├── inbox_style_information.dart │ │ │ │ ├── media_style_information.dart │ │ │ │ ├── messaging_style_information.dart │ │ │ │ └── style_information.dart │ │ └── darwin │ │ │ ├── initialization_settings.dart │ │ │ ├── interruption_level.dart │ │ │ ├── mappers.dart │ │ │ ├── notification_action.dart │ │ │ ├── notification_action_option.dart │ │ │ ├── notification_attachment.dart │ │ │ ├── notification_category.dart │ │ │ ├── notification_category_option.dart │ │ │ ├── notification_details.dart │ │ │ └── notification_enabled_options.dart │ │ ├── typedefs.dart │ │ ├── types.dart │ │ └── tz_datetime_mapper.dart ├── macos │ ├── flutter_local_notifications.podspec │ └── flutter_local_notifications │ │ ├── Package.swift │ │ └── Sources │ │ └── flutter_local_notifications │ │ ├── FlutterLocalNotificationsConverters.swift │ │ ├── FlutterLocalNotificationsPlugin.swift │ │ └── PrivacyInfo.xcprivacy ├── pubspec.yaml └── test │ ├── android_flutter_local_notifications_test.dart │ ├── flutter_local_notifications_test.dart │ ├── ios_flutter_local_notifications_test.dart │ ├── macos_flutter_local_notifications_test.dart │ ├── platform_specifics │ └── darwin │ │ └── mappers_test.dart │ └── utils │ └── date_formatter.dart ├── flutter_local_notifications_linux ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── lib │ ├── flutter_local_notifications_linux.dart │ └── src │ │ ├── dbus_wrapper.dart │ │ ├── file_system.dart │ │ ├── flutter_local_notifications.dart │ │ ├── flutter_local_notifications_platform_linux.dart │ │ ├── flutter_local_notifications_stub.dart │ │ ├── helpers.dart │ │ ├── model │ │ ├── capabilities.dart │ │ ├── enums.dart │ │ ├── hint.dart │ │ ├── icon.dart │ │ ├── initialization_settings.dart │ │ ├── location.dart │ │ ├── notification_details.dart │ │ ├── sound.dart │ │ └── timeout.dart │ │ ├── notification_info.dart │ │ ├── notifications_manager.dart │ │ ├── platform_info.dart │ │ ├── posix.dart │ │ └── storage.dart ├── pubspec.yaml └── test │ ├── notifications_manager_test.dart │ ├── notifications_manager_test.mocks.dart │ ├── posix_test.dart │ ├── storage_test.dart │ └── storage_test.mocks.dart ├── flutter_local_notifications_platform_interface ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── lib │ ├── flutter_local_notifications_platform_interface.dart │ └── src │ │ ├── helpers.dart │ │ ├── typedefs.dart │ │ └── types.dart ├── pubspec.yaml └── test │ └── flutter_local_notifications_platform_interface_test.dart ├── flutter_local_notifications_windows ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── build.bat ├── dart_test.yaml ├── ffigen.yaml ├── lib │ ├── flutter_local_notifications_windows.dart │ └── src │ │ ├── details.dart │ │ ├── details │ │ ├── initialization_settings.dart │ │ ├── notification_action.dart │ │ ├── notification_audio.dart │ │ ├── notification_details.dart │ │ ├── notification_header.dart │ │ ├── notification_input.dart │ │ ├── notification_parts.dart │ │ ├── notification_progress.dart │ │ ├── notification_row.dart │ │ ├── notification_to_xml.dart │ │ └── xml │ │ │ ├── action.dart │ │ │ ├── audio.dart │ │ │ ├── details.dart │ │ │ ├── header.dart │ │ │ ├── image.dart │ │ │ ├── input.dart │ │ │ ├── progress.dart │ │ │ ├── row.dart │ │ │ └── text.dart │ │ ├── ffi │ │ ├── bindings.dart │ │ └── utils.dart │ │ ├── msix │ │ ├── ffi.dart │ │ └── stub.dart │ │ └── plugin │ │ ├── base.dart │ │ ├── ffi.dart │ │ └── stub.dart ├── pubspec.yaml ├── src │ ├── .clang-format │ ├── CMakeLists.txt │ ├── ffi_api.cpp │ ├── ffi_api.h │ ├── plugin.cpp │ ├── plugin.hpp │ ├── utils.cpp │ └── utils.hpp ├── test │ ├── bindings_test.dart │ ├── details_test.dart │ ├── icon.png │ ├── plugin_test.dart │ ├── scheduled_test.dart │ ├── sound.mp3 │ └── xml_test.dart └── windows │ ├── .gitignore │ └── CMakeLists.txt ├── images ├── android_notification.png ├── gnome_linux_notification.png ├── ios_notification.png ├── kde_linux_notification.png ├── macos_notification.png └── windows_notification.png ├── melos.yaml └── pubspec.yaml /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report about bug that you've come across 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | 12 | **Describe the bug** 13 | 14 | 15 | **To Reproduce** 16 | 17 | 1. Go to '...' 18 | 2. Click on '....' 19 | 3. Scroll down to '....' 20 | 4. See error 21 | 22 | **Expected behavior** 23 | 24 | 25 | **Sample code to reproduce the problem** 26 | 27 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "pub" 4 | directory: "/flutter_local_notifications_platform_interface" 5 | schedule: 6 | interval: "daily" 7 | - package-ecosystem: "pub" 8 | directory: "/flutter_local_notifications_linux" 9 | schedule: 10 | interval: "daily" 11 | - package-ecosystem: "pub" 12 | directory: "/flutter_local_notifications_windows" 13 | schedule: 14 | interval: "daily" 15 | - package-ecosystem: "pub" 16 | directory: "/flutter_local_notifications" 17 | schedule: 18 | interval: "daily" 19 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | As this repository hosts multiple packages, please ensure the PR title starts with the name of the package that it relates to using square brackets (e.g. [flutter_local_notifications]). Should the PR more than one package than please prefix the title of the PR with [various] The contribution guidelines can be found at https://github.com/MaikuB/flutter_local_notifications/blob/master/CONTRIBUTING.md. Please review this as it contains details on what to follow when submitting a PR. 2 | -------------------------------------------------------------------------------- /.github/workflows/format.yml: -------------------------------------------------------------------------------- 1 | name: format 2 | 3 | on: 4 | - push 5 | - workflow_dispatch 6 | 7 | jobs: 8 | java_format: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v4 12 | - uses: actions/setup-java@v4 13 | with: 14 | distribution: 'zulu' 15 | java-version: '17' 16 | - uses: axel-op/googlejavaformat-action@v3 17 | with: 18 | args: '--skip-sorting-imports --replace' 19 | 20 | objc_format: 21 | runs-on: macos-latest 22 | steps: 23 | - uses: actions/checkout@v4 24 | - name: Test 25 | run: | 26 | which clang-format || brew install clang-format 27 | find . -name '*.m' -exec clang-format -i {} \; 28 | find . -path '*/ios/**/*.h' -exec clang-format -i {} \; 29 | find . -path '*/macos/**/*.h' -exec clang-format -i {} \; 30 | git diff --exit-code || (git commit --all -m "Clang Format" && git push) 31 | 32 | swift_format: 33 | runs-on: macos-latest 34 | steps: 35 | - uses: actions/checkout@v4 36 | - name: Test 37 | run: | 38 | which swiftlint || brew install swiftlint 39 | swiftlint --fix 40 | git diff --exit-code || (git commit --all -m "Swift Format" && git push) 41 | 42 | windows_cpp_format: 43 | runs-on: ubuntu-latest 44 | permissions: 45 | contents: write 46 | steps: 47 | - uses: actions/checkout@v4 48 | 49 | - name: Install latest clang-format 50 | run: | 51 | sudo apt install python3-pip -y 52 | python3 -m pip install clang-format 53 | 54 | - name: Format C++ code 55 | run: | 56 | cd flutter_local_notifications_windows/src 57 | ~/.local/bin/clang-format --version 58 | ~/.local/bin/clang-format *.cpp *.hpp *.h -i 59 | # git diff --exit-code || (git commit --all -m "Clang Format" && git push) 60 | 61 | - uses: stefanzweifel/git-auto-commit-action@v5 62 | with: 63 | commit_message: Clang format 64 | -------------------------------------------------------------------------------- /.github/workflows/scripts/install-tools.sh: -------------------------------------------------------------------------------- 1 | dart pub global activate melos 2 | melos bootstrap -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | pubspec.lock 2 | .vscode 3 | *.idea 4 | *.DS_Store 5 | .dart_tool 6 | *.dll 7 | 8 | # Melos 9 | pubspec_overrides.yaml -------------------------------------------------------------------------------- /flutter_local_notifications/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Android related 35 | **/android/**/gradle-wrapper.jar 36 | **/android/.gradle 37 | **/android/captures/ 38 | **/android/gradlew 39 | **/android/gradlew.bat 40 | **/android/local.properties 41 | **/android/**/GeneratedPluginRegistrant.java 42 | 43 | # iOS/XCode related 44 | **/ios/**/*.mode1v3 45 | **/ios/**/*.mode2v3 46 | **/ios/**/*.moved-aside 47 | **/ios/**/*.pbxuser 48 | **/ios/**/*.perspectivev3 49 | **/ios/**/*sync/ 50 | **/ios/**/.sconsign.dblite 51 | **/ios/**/.tags* 52 | **/ios/**/.vagrant/ 53 | **/ios/**/DerivedData/ 54 | **/ios/**/Icon? 55 | **/ios/**/Pods/ 56 | **/ios/**/.symlinks/ 57 | **/ios/**/profile 58 | **/ios/**/xcuserdata 59 | **/ios/.generated/ 60 | **/ios/Flutter/App.framework 61 | **/ios/Flutter/Flutter.framework 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 76 | -------------------------------------------------------------------------------- /flutter_local_notifications/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2018 Michael Bui. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of the copyright holder nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /flutter_local_notifications/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.dexterous.flutterlocalnotifications' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | mavenCentral() 8 | } 9 | 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:8.6.0' 12 | } 13 | } 14 | 15 | rootProject.allprojects { 16 | repositories { 17 | google() 18 | mavenCentral() 19 | } 20 | } 21 | 22 | apply plugin: 'com.android.library' 23 | 24 | android { 25 | namespace 'com.dexterous.flutterlocalnotifications' 26 | compileSdk 35 27 | compileOptions { 28 | coreLibraryDesugaringEnabled true 29 | sourceCompatibility JavaVersion.VERSION_11 30 | targetCompatibility JavaVersion.VERSION_11 31 | } 32 | 33 | defaultConfig { 34 | multiDexEnabled true 35 | minSdkVersion 21 36 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 37 | } 38 | 39 | lintOptions { 40 | disable 'InvalidPackage' 41 | } 42 | } 43 | 44 | dependencies { 45 | coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4' 46 | implementation "androidx.core:core:1.3.0" 47 | implementation "androidx.media:media:1.1.0" 48 | implementation "com.google.code.gson:gson:2.12.0" 49 | 50 | testImplementation 'junit:junit:4.12' 51 | testImplementation 'org.mockito:mockito-core:3.10.0' 52 | testImplementation 'androidx.test:core:1.2.0' 53 | testImplementation "org.robolectric:robolectric:4.14.1" 54 | } 55 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true -------------------------------------------------------------------------------- /flutter_local_notifications/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'flutter_local_notifications' 2 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/ForegroundService.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications; 2 | 3 | import android.app.Notification; 4 | import android.app.Service; 5 | import android.content.Intent; 6 | import android.os.Build; 7 | import android.os.IBinder; 8 | 9 | import java.util.ArrayList; 10 | 11 | public class ForegroundService extends Service { 12 | 13 | @Override 14 | @SuppressWarnings("deprecation") 15 | public int onStartCommand(Intent intent, int flags, int startId) { 16 | ForegroundServiceStartParameter parameter; 17 | if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.TIRAMISU) { 18 | parameter = 19 | (ForegroundServiceStartParameter) 20 | intent.getSerializableExtra( 21 | ForegroundServiceStartParameter.EXTRA, ForegroundServiceStartParameter.class); 22 | } else { 23 | parameter = 24 | (ForegroundServiceStartParameter) 25 | intent.getSerializableExtra(ForegroundServiceStartParameter.EXTRA); 26 | } 27 | 28 | Notification notification = 29 | FlutterLocalNotificationsPlugin.createNotification(this, parameter.notificationData); 30 | if (parameter.foregroundServiceTypes != null 31 | && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { 32 | startForeground( 33 | parameter.notificationData.id, 34 | notification, 35 | orCombineFlags(parameter.foregroundServiceTypes)); 36 | } else { 37 | startForeground(parameter.notificationData.id, notification); 38 | } 39 | return parameter.startMode; 40 | } 41 | 42 | private static int orCombineFlags(ArrayList flags) { 43 | int flag = flags.get(0); 44 | for (int i = 1; i < flags.size(); i++) { 45 | flag |= flags.get(i); 46 | } 47 | return flag; 48 | } 49 | 50 | @Override 51 | public IBinder onBind(Intent intent) { 52 | return null; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/ForegroundServiceStartParameter.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications; 2 | 3 | import com.dexterous.flutterlocalnotifications.models.NotificationDetails; 4 | 5 | import java.io.Serializable; 6 | import java.util.ArrayList; 7 | 8 | public class ForegroundServiceStartParameter implements Serializable { 9 | public static final String EXTRA = 10 | "com.dexterous.flutterlocalnotifications.ForegroundServiceStartParameter"; 11 | 12 | public final NotificationDetails notificationData; 13 | public final int startMode; 14 | public final ArrayList foregroundServiceTypes; 15 | 16 | public ForegroundServiceStartParameter( 17 | NotificationDetails notificationData, 18 | int startMode, 19 | ArrayList foregroundServiceTypes) { 20 | this.notificationData = notificationData; 21 | this.startMode = startMode; 22 | this.foregroundServiceTypes = foregroundServiceTypes; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return "ForegroundServiceStartParameter{" 28 | + "notificationData=" 29 | + notificationData 30 | + ", startMode=" 31 | + startMode 32 | + ", foregroundServiceTypes=" 33 | + foregroundServiceTypes 34 | + '}'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/ScheduledNotificationBootReceiver.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | import androidx.annotation.Keep; 8 | 9 | @Keep 10 | public class ScheduledNotificationBootReceiver extends BroadcastReceiver { 11 | @Override 12 | @SuppressWarnings("deprecation") 13 | public void onReceive(final Context context, Intent intent) { 14 | String action = intent.getAction(); 15 | if (action != null) { 16 | if (action.equals(android.content.Intent.ACTION_BOOT_COMPLETED) 17 | || action.equals(Intent.ACTION_MY_PACKAGE_REPLACED) 18 | || action.equals("android.intent.action.QUICKBOOT_POWERON") 19 | || action.equals("com.htc.intent.action.QUICKBOOT_POWERON")) { 20 | FlutterLocalNotificationsPlugin.rescheduleNotifications(context); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/isolate/IsolatePreferences.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.isolate; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | import androidx.annotation.Nullable; 6 | import io.flutter.view.FlutterCallbackInformation; 7 | 8 | public class IsolatePreferences { 9 | 10 | private static final String SHARED_PREFS_FILE_NAME = "flutter_local_notifications_plugin"; 11 | 12 | private final String CALLBACK_DISPATCHER_HANDLE_KEY = 13 | "com.dexterous.flutterlocalnotifications.CALLBACK_DISPATCHER_HANDLE_KEY"; 14 | 15 | private final String CALLBACK_HANDLE_KEY = 16 | "com.dexterous.flutterlocalnotifications.CALLBACK_HANDLE_KEY"; 17 | 18 | public IsolatePreferences(Context context) { 19 | this.context = context; 20 | } 21 | 22 | private final Context context; 23 | 24 | private SharedPreferences get() { 25 | return context.getSharedPreferences(SHARED_PREFS_FILE_NAME, Context.MODE_PRIVATE); 26 | } 27 | 28 | public void saveCallbackKeys(Long dispatcherCallbackHandle, Long callbackHandle) { 29 | get().edit().putLong(CALLBACK_DISPATCHER_HANDLE_KEY, dispatcherCallbackHandle).apply(); 30 | get().edit().putLong(CALLBACK_HANDLE_KEY, callbackHandle).apply(); 31 | } 32 | 33 | public Long getCallbackDispatcherHandle() { 34 | return get().getLong(CALLBACK_DISPATCHER_HANDLE_KEY, -1L); 35 | } 36 | 37 | public Long getCallbackHandle() { 38 | return get().getLong(CALLBACK_HANDLE_KEY, -1L); 39 | } 40 | 41 | @Nullable 42 | public FlutterCallbackInformation lookupDispatcherHandle() { 43 | return FlutterCallbackInformation.lookupCallbackInformation(getCallbackDispatcherHandle()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/BitmapSource.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | @Keep 6 | public enum BitmapSource { 7 | DrawableResource, 8 | FilePath, 9 | ByteArray 10 | } 11 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/DateTimeComponents.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | @Keep 6 | public enum DateTimeComponents { 7 | Time, 8 | DayOfWeekAndTime, 9 | DayOfMonthAndTime, 10 | DateAndTime 11 | } 12 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/IconSource.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | @Keep 6 | public enum IconSource { 7 | DrawableResource, 8 | BitmapFilePath, 9 | ContentUri, 10 | FlutterBitmapAsset, 11 | ByteArray 12 | } 13 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/MessageDetails.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | import java.io.Serializable; 6 | 7 | @Keep 8 | public class MessageDetails implements Serializable { 9 | public String text; 10 | public Long timestamp; 11 | public PersonDetails person; 12 | public String dataMimeType; 13 | public String dataUri; 14 | 15 | public MessageDetails( 16 | String text, Long timestamp, PersonDetails person, String dataMimeType, String dataUri) { 17 | this.text = text; 18 | this.timestamp = timestamp; 19 | this.person = person; 20 | this.dataMimeType = dataMimeType; 21 | this.dataUri = dataUri; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/NotificationChannelAction.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | @Keep 6 | public enum NotificationChannelAction { 7 | CreateIfNotExists, 8 | Update 9 | } 10 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/NotificationChannelGroupDetails.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | import java.io.Serializable; 6 | import java.util.Map; 7 | 8 | @Keep 9 | public class NotificationChannelGroupDetails implements Serializable { 10 | private static final String ID = "id"; 11 | private static final String NAME = "name"; 12 | private static final String DESCRIPTION = "description"; 13 | 14 | public String id; 15 | public String name; 16 | public String description; 17 | 18 | public static NotificationChannelGroupDetails from(Map arguments) { 19 | NotificationChannelGroupDetails notificationChannelGroupDetails = 20 | new NotificationChannelGroupDetails(); 21 | notificationChannelGroupDetails.id = (String) arguments.get(ID); 22 | notificationChannelGroupDetails.name = (String) arguments.get(NAME); 23 | notificationChannelGroupDetails.description = (String) arguments.get(DESCRIPTION); 24 | return notificationChannelGroupDetails; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/NotificationStyle.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | @Keep 6 | public enum NotificationStyle { 7 | Default, 8 | BigPicture, 9 | BigText, 10 | Inbox, 11 | Messaging, 12 | Media 13 | } 14 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/PersonDetails.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | import java.io.Serializable; 6 | 7 | @Keep 8 | public class PersonDetails implements Serializable { 9 | public Boolean bot; 10 | public Object icon; 11 | public IconSource iconBitmapSource; 12 | public Boolean important; 13 | public String key; 14 | public String name; 15 | public String uri; 16 | 17 | public PersonDetails( 18 | Boolean bot, 19 | Object icon, 20 | IconSource iconSource, 21 | Boolean important, 22 | String key, 23 | String name, 24 | String uri) { 25 | this.bot = bot; 26 | this.icon = icon; 27 | this.iconBitmapSource = iconSource; 28 | this.important = important; 29 | this.key = key; 30 | this.name = name; 31 | this.uri = uri; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/RepeatInterval.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | @Keep 6 | public enum RepeatInterval { 7 | EveryMinute, 8 | Hourly, 9 | Daily, 10 | Weekly 11 | } 12 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/ScheduleMode.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | import com.google.gson.*; 6 | 7 | import java.lang.reflect.Type; 8 | 9 | @Keep 10 | public enum ScheduleMode { 11 | alarmClock, 12 | exact, 13 | exactAllowWhileIdle, 14 | inexact, 15 | inexactAllowWhileIdle; 16 | 17 | public boolean useAllowWhileIdle() { 18 | return this == exactAllowWhileIdle || this == inexactAllowWhileIdle; 19 | } 20 | 21 | public boolean useExactAlarm() { 22 | return this == exact || this == exactAllowWhileIdle; 23 | } 24 | 25 | public boolean useAlarmClock() { 26 | return this == alarmClock; 27 | } 28 | 29 | public static class Deserializer implements JsonDeserializer { 30 | @Override 31 | public ScheduleMode deserialize( 32 | JsonElement json, Type typeOfT, JsonDeserializationContext context) 33 | throws JsonParseException { 34 | try { 35 | return ScheduleMode.valueOf(json.getAsString()); 36 | } catch (Exception e) { 37 | return json.getAsBoolean() ? ScheduleMode.exactAllowWhileIdle : ScheduleMode.exact; 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/ScheduledNotificationRepeatFrequency.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | @Keep 6 | public enum ScheduledNotificationRepeatFrequency { 7 | Daily, 8 | Weekly 9 | } 10 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/SoundSource.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | @Keep 6 | public enum SoundSource { 7 | RawResource, 8 | Uri 9 | } 10 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/Time.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | import java.io.Serializable; 6 | import java.util.Map; 7 | 8 | @Keep 9 | public class Time implements Serializable { 10 | private static final String HOUR = "hour"; 11 | private static final String MINUTE = "minute"; 12 | private static final String SECOND = "second"; 13 | 14 | public Integer hour = 0; 15 | public Integer minute = 0; 16 | public Integer second = 0; 17 | 18 | public static Time from(Map arguments) { 19 | Time time = new Time(); 20 | time.hour = (Integer) arguments.get(HOUR); 21 | time.minute = (Integer) arguments.get(MINUTE); 22 | time.second = (Integer) arguments.get(SECOND); 23 | return time; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/styles/BigPictureStyleInformation.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models.styles; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | import com.dexterous.flutterlocalnotifications.models.BitmapSource; 6 | 7 | @Keep 8 | public class BigPictureStyleInformation extends DefaultStyleInformation { 9 | public String contentTitle; 10 | public Boolean htmlFormatContentTitle; 11 | public String summaryText; 12 | public Boolean htmlFormatSummaryText; 13 | public Object largeIcon; 14 | public BitmapSource largeIconBitmapSource; 15 | public Object bigPicture; 16 | public BitmapSource bigPictureBitmapSource; 17 | public Boolean hideExpandedLargeIcon; 18 | 19 | public BigPictureStyleInformation( 20 | Boolean htmlFormatTitle, 21 | Boolean htmlFormatBody, 22 | String contentTitle, 23 | Boolean htmlFormatContentTitle, 24 | String summaryText, 25 | Boolean htmlFormatSummaryText, 26 | Object largeIcon, 27 | BitmapSource largeIconBitmapSource, 28 | Object bigPicture, 29 | BitmapSource bigPictureBitmapSource, 30 | Boolean hideExpandedLargeIcon) { 31 | super(htmlFormatTitle, htmlFormatBody); 32 | this.contentTitle = contentTitle; 33 | this.htmlFormatContentTitle = htmlFormatContentTitle; 34 | this.summaryText = summaryText; 35 | this.htmlFormatSummaryText = htmlFormatSummaryText; 36 | this.largeIcon = largeIcon; 37 | this.largeIconBitmapSource = largeIconBitmapSource; 38 | this.bigPicture = bigPicture; 39 | this.bigPictureBitmapSource = bigPictureBitmapSource; 40 | this.hideExpandedLargeIcon = hideExpandedLargeIcon; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/styles/BigTextStyleInformation.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models.styles; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | @Keep 6 | public class BigTextStyleInformation extends DefaultStyleInformation { 7 | public String bigText; 8 | public Boolean htmlFormatBigText; 9 | public String contentTitle; 10 | public Boolean htmlFormatContentTitle; 11 | public String summaryText; 12 | public Boolean htmlFormatSummaryText; 13 | 14 | public BigTextStyleInformation( 15 | Boolean htmlFormatTitle, 16 | Boolean htmlFormatBody, 17 | String bigText, 18 | Boolean htmlFormatBigText, 19 | String contentTitle, 20 | Boolean htmlFormatContentTitle, 21 | String summaryText, 22 | Boolean htmlFormatSummaryText) { 23 | super(htmlFormatTitle, htmlFormatBody); 24 | this.bigText = bigText; 25 | this.htmlFormatBigText = htmlFormatBigText; 26 | this.contentTitle = contentTitle; 27 | this.htmlFormatContentTitle = htmlFormatContentTitle; 28 | this.summaryText = summaryText; 29 | this.htmlFormatSummaryText = htmlFormatSummaryText; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/styles/DefaultStyleInformation.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models.styles; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | @Keep 6 | public class DefaultStyleInformation extends StyleInformation { 7 | public Boolean htmlFormatTitle; 8 | public Boolean htmlFormatBody; 9 | 10 | public DefaultStyleInformation(Boolean htmlFormatTitle, Boolean htmlFormatBody) { 11 | this.htmlFormatTitle = htmlFormatTitle; 12 | this.htmlFormatBody = htmlFormatBody; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/styles/InboxStyleInformation.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models.styles; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | import java.util.ArrayList; 6 | 7 | @Keep 8 | public class InboxStyleInformation extends DefaultStyleInformation { 9 | public Boolean htmlFormatLines; 10 | public ArrayList lines; 11 | public String contentTitle; 12 | public Boolean htmlFormatContentTitle; 13 | public String summaryText; 14 | public Boolean htmlFormatSummaryText; 15 | 16 | public InboxStyleInformation( 17 | Boolean htmlFormatTitle, 18 | Boolean htmlFormatBody, 19 | String contentTitle, 20 | Boolean htmlFormatContentTitle, 21 | String summaryText, 22 | Boolean htmlFormatSummaryText, 23 | ArrayList lines, 24 | Boolean htmlFormatLines) { 25 | super(htmlFormatTitle, htmlFormatBody); 26 | this.contentTitle = contentTitle; 27 | this.htmlFormatContentTitle = htmlFormatContentTitle; 28 | this.summaryText = summaryText; 29 | this.htmlFormatSummaryText = htmlFormatSummaryText; 30 | this.lines = lines; 31 | this.htmlFormatLines = htmlFormatLines; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/styles/MessagingStyleInformation.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models.styles; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | import com.dexterous.flutterlocalnotifications.models.MessageDetails; 6 | import com.dexterous.flutterlocalnotifications.models.PersonDetails; 7 | 8 | import java.util.ArrayList; 9 | 10 | @Keep 11 | public class MessagingStyleInformation extends DefaultStyleInformation { 12 | public PersonDetails person; 13 | public String conversationTitle; 14 | public Boolean groupConversation; 15 | public ArrayList messages; 16 | 17 | public MessagingStyleInformation( 18 | PersonDetails person, 19 | String conversationTitle, 20 | Boolean groupConversation, 21 | ArrayList messages, 22 | Boolean htmlFormatTitle, 23 | Boolean htmlFormatBody) { 24 | super(htmlFormatTitle, htmlFormatBody); 25 | this.person = person; 26 | this.conversationTitle = conversationTitle; 27 | this.groupConversation = groupConversation; 28 | this.messages = messages; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/models/styles/StyleInformation.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.models.styles; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | import java.io.Serializable; 6 | 7 | @Keep 8 | public abstract class StyleInformation implements Serializable {} 9 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/utils/BooleanUtils.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.utils; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | @Keep 6 | public class BooleanUtils { 7 | public static boolean getValue(Boolean booleanObject) { 8 | return booleanObject != null && booleanObject.booleanValue(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/utils/LongUtils.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.utils; 2 | 3 | public class LongUtils { 4 | public static Long parseLong(Object object) { 5 | if (object instanceof Integer) { 6 | return ((Integer) object).longValue(); 7 | } 8 | if (object instanceof Long) { 9 | return (Long) object; 10 | } 11 | return null; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/main/java/com/dexterous/flutterlocalnotifications/utils/StringUtils.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications.utils; 2 | 3 | import androidx.annotation.Keep; 4 | 5 | @Keep 6 | public class StringUtils { 7 | public static Boolean isNullOrEmpty(String string) { 8 | return string == null || string.isEmpty(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /flutter_local_notifications/android/src/test/java/com/dexterous/flutterlocalnotifications/IsolatePreferencesTest.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutterlocalnotifications; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import android.content.Context; 6 | import androidx.test.core.app.ApplicationProvider; 7 | import com.dexterous.flutterlocalnotifications.isolate.IsolatePreferences; 8 | import org.junit.Before; 9 | import org.junit.Test; 10 | import org.junit.runner.RunWith; 11 | import org.robolectric.RobolectricTestRunner; 12 | 13 | @RunWith(RobolectricTestRunner.class) 14 | public class IsolatePreferencesTest { 15 | private static final Long DISPATCHER_ID = 123L; 16 | private static final Long HANDLE_ID = 124L; 17 | 18 | private Context context; 19 | 20 | @Before 21 | public void before() { 22 | context = ApplicationProvider.getApplicationContext(); 23 | } 24 | 25 | @Test 26 | public void saveAndGet_ShouldReturnCorrectValues() { 27 | final IsolatePreferences preferences = new IsolatePreferences(context); 28 | preferences.saveCallbackKeys(DISPATCHER_ID, HANDLE_ID); 29 | assertEquals(DISPATCHER_ID, preferences.getCallbackDispatcherHandle()); 30 | assertEquals(HANDLE_ID, preferences.getCallbackHandle()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Exceptions to above rules. 37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages -------------------------------------------------------------------------------- /flutter_local_notifications/example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 17 | base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 18 | - platform: macos 19 | create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 20 | base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 21 | 22 | # User provided section 23 | 24 | # List of Local paths (relative to this file) that should be 25 | # ignored by the migrate tool. 26 | # 27 | # Files that are not part of the templates will be ignored by default. 28 | unmanaged_files: 29 | - 'lib/main.dart' 30 | - 'ios/Runner.xcodeproj/project.pbxproj' 31 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/README.md: -------------------------------------------------------------------------------- 1 | # flutter_local_notifications_example 2 | 3 | Demonstrates how to use the flutter_local_notifications plugin. 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view our online 8 | [documentation](https://flutter.io/). 9 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | .cxx/ 9 | 10 | # Remember to never publicly share your keystore. 11 | # See https://flutter.dev/to/reference-keystore 12 | key.properties 13 | **/*.keystore 14 | **/*.jks -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Note: This file is not required for flutter_local_notifications v19 and higher 2 | 3 | ## Gson rules 4 | # Gson uses generic type information stored in a class file when working with fields. Proguard 5 | # removes such information by default, so configure it to keep all of it. 6 | -keepattributes Signature 7 | 8 | # For using GSON @Expose annotation 9 | -keepattributes *Annotation* 10 | 11 | # Gson specific classes 12 | -dontwarn sun.misc.** 13 | #-keep class com.google.gson.stream.** { *; } 14 | 15 | # Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory, 16 | # JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) 17 | -keep class * extends com.google.gson.TypeAdapter 18 | -keep class * implements com.google.gson.TypeAdapterFactory 19 | -keep class * implements com.google.gson.JsonSerializer 20 | -keep class * implements com.google.gson.JsonDeserializer 21 | 22 | # Prevent R8 from leaving Data object members always null 23 | -keepclassmembers,allowobfuscation class * { 24 | @com.google.gson.annotations.SerializedName ; 25 | } 26 | 27 | # Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher. 28 | -keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken 29 | -keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/androidTest/java/com/dexterous/flutter_local_notifications_example/MainActivityTest.java: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutter_local_notifications_example; 2 | 3 | import androidx.test.rule.ActivityTestRule; 4 | import org.junit.Rule; 5 | import org.junit.runner.RunWith; 6 | 7 | import dev.flutter.plugins.integration_test.FlutterTestRunner; 8 | 9 | @RunWith(FlutterTestRunner.class) 10 | public class MainActivityTest { 11 | @Rule 12 | public ActivityTestRule rule = 13 | new ActivityTestRule<>(MainActivity.class, true, false); 14 | } 15 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/kotlin/com/dexterous/flutter_local_notifications_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.dexterous.flutter_local_notifications_example 2 | 3 | import android.content.ContentResolver 4 | import android.content.Context 5 | import android.media.RingtoneManager 6 | import io.flutter.embedding.android.FlutterActivity 7 | import io.flutter.embedding.engine.FlutterEngine 8 | import io.flutter.plugin.common.MethodChannel 9 | import java.util.* 10 | 11 | 12 | class MainActivity: FlutterActivity() { 13 | override fun configureFlutterEngine(flutterEngine: FlutterEngine) { 14 | super.configureFlutterEngine(flutterEngine) 15 | MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "dexterx.dev/flutter_local_notifications_example").setMethodCallHandler { call, result -> 16 | if ("drawableToUri" == call.method) { 17 | val resourceId = this@MainActivity.resources.getIdentifier(call.arguments as String, "drawable", this@MainActivity.packageName) 18 | result.success(resourceToUriString(this@MainActivity.applicationContext, resourceId)) 19 | } 20 | if ("getAlarmUri" == call.method) { 21 | result.success(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM).toString()) 22 | } 23 | } 24 | } 25 | 26 | private fun resourceToUriString(context: Context, resId: Int): String? { 27 | return (ContentResolver.SCHEME_ANDROID_RESOURCE + "://" 28 | + context.resources.getResourcePackageName(resId) 29 | + "/" 30 | + context.resources.getResourceTypeName(resId) 31 | + "/" 32 | + context.resources.getResourceEntryName(resId)) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/drawable/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/android/app/src/main/res/drawable/app_icon.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/drawable/food.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/android/app/src/main/res/drawable/food.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/drawable/me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/android/app/src/main/res/drawable/me.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/drawable/sample_large_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/android/app/src/main/res/drawable/sample_large_icon.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/drawable/secondary_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/android/app/src/main/res/drawable/secondary_icon.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/raw/keep.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/raw/slow_spring_board.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/android/app/src/main/res/raw/slow_spring_board.mp3 -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | rootProject.buildDir = '../build' 9 | subprojects { 10 | project.buildDir = "${rootProject.buildDir}/${project.name}" 11 | } 12 | subprojects { 13 | project.evaluationDependsOn(':app') 14 | } 15 | 16 | tasks.register("clean", Delete) { 17 | delete rootProject.buildDir 18 | } 19 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | android.enableR8=true 5 | # https://github.com/robolectric/robolectric/issues/6521 6 | android.jetifier.ignorelist=bcprov 7 | android.defaults.buildfeatures.buildconfig=true 8 | android.nonTransitiveRClass=false 9 | android.nonFinalResIds=false -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | }() 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 21 | id "com.android.application" version '8.6.0' apply false 22 | id "org.jetbrains.kotlin.android" version "1.9.10" apply false 23 | } 24 | 25 | include ":app" -------------------------------------------------------------------------------- /flutter_local_notifications/example/icons/1.5x/app_icon_density.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/icons/1.5x/app_icon_density.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/icons/2.0x/app_icon_density.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/icons/2.0x/app_icon_density.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/icons/3.0x/app_icon_density.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/icons/3.0x/app_icon_density.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/icons/4.0x/app_icon_density.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/icons/4.0x/app_icon_density.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/icons/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/icons/app_icon.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/icons/app_icon_density.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/icons/app_icon_density.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/icons/coworker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/icons/coworker.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | 36 | Podfile.lock 37 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '12.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | target 'RunnerTests' do 36 | inherit! :search_paths 37 | end 38 | end 39 | 40 | post_install do |installer| 41 | installer.pods_project.targets.each do |target| 42 | flutter_additional_ios_build_settings(target) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | import flutter_local_notifications 4 | 5 | @main 6 | @objc class AppDelegate: FlutterAppDelegate { 7 | 8 | override func application( 9 | _ application: UIApplication, 10 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 11 | ) -> Bool { 12 | // This is required to make any communication available in the action isolate. 13 | FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in 14 | GeneratedPluginRegistrant.register(with: registry) 15 | } 16 | 17 | if #available(iOS 10.0, *) { 18 | UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate 19 | } 20 | 21 | GeneratedPluginRegistrant.register(with: self) 22 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Flutter Local Notifications 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | flutter_local_notifications_example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/Runner.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.usernotifications.time-sensitive 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/Runner/RunnerDebug.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.usernotifications.critical-alerts 6 | 7 | com.apple.developer.usernotifications.time-sensitive 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | @testable import flutter_local_notifications 6 | 7 | // This demonstrates a simple unit test of the Swift portion of this plugin's implementation. 8 | // 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | 11 | class RunnerTests: XCTestCase { 12 | 13 | func testGetPlatformVersion() { 14 | let plugin = FlutterLocalNotificationsPlugin() 15 | 16 | let call = FlutterMethodCall(methodName: "getPlatformVersion", arguments: []) 17 | 18 | let resultExpectation = expectation(description: "result block must be called.") 19 | plugin.handle(call) { result in 20 | XCTAssertEqual(result as! String, "iOS " + UIDevice.current.systemVersion) 21 | resultExpectation.fulfill() 22 | } 23 | waitForExpectations(timeout: 1) 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/ios/slow_spring_board.aiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/ios/slow_spring_board.aiff -------------------------------------------------------------------------------- /flutter_local_notifications/example/lib/padded_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class PaddedElevatedButton extends StatelessWidget { 4 | const PaddedElevatedButton({ 5 | required this.buttonText, 6 | required this.onPressed, 7 | Key? key, 8 | }) : super(key: key); 9 | 10 | final String buttonText; 11 | final VoidCallback onPressed; 12 | 13 | @override 14 | Widget build(BuildContext context) => Padding( 15 | padding: const EdgeInsets.fromLTRB(0, 0, 0, 8), 16 | child: ElevatedButton( 17 | onPressed: onPressed, 18 | child: Text(buttonText), 19 | ), 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/lib/plugin.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_local_notifications/flutter_local_notifications.dart'; 2 | 3 | final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = 4 | FlutterLocalNotificationsPlugin(); 5 | 6 | int id = 0; 7 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | 11 | void fl_register_plugins(FlPluginRegistry* registry) { 12 | g_autoptr(FlPluginRegistrar) flutter_timezone_registrar = 13 | fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterTimezonePlugin"); 14 | flutter_timezone_plugin_register_with_registrar(flutter_timezone_registrar); 15 | } 16 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | flutter_timezone 7 | ) 8 | 9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | 9 | Podfile.lock 10 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import device_info_plus 9 | import flutter_local_notifications 10 | import flutter_timezone 11 | import path_provider_foundation 12 | 13 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 14 | DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) 15 | FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) 16 | FlutterTimezonePlugin.register(with: registry.registrar(forPlugin: "FlutterTimezonePlugin")) 17 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 18 | } 19 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | target 'RunnerTests' do 35 | inherit! :search_paths 36 | end 37 | end 38 | 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | flutter_additional_macos_build_settings(target) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @main 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | 10 | override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { 11 | return true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = flutter_local_notifications_example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.dexterous.flutterLocalNotificationsExample 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.dexterous. All rights reserved. 15 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import FlutterMacOS 2 | import Cocoa 3 | import XCTest 4 | 5 | @testable import flutter_local_notifications 6 | 7 | // This demonstrates a simple unit test of the Swift portion of this plugin's implementation. 8 | // 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | 11 | class RunnerTests: XCTestCase { 12 | 13 | func testGetPlatformVersion() { 14 | let plugin = FlutterLocalNotificationsPlugin() 15 | 16 | let call = FlutterMethodCall(methodName: "getPlatformVersion", arguments: []) 17 | 18 | let resultExpectation = expectation(description: "result block must be called.") 19 | plugin.handle(call) { result in 20 | XCTAssertEqual(result as! String, 21 | "macOS " + ProcessInfo.processInfo.operatingSystemVersionString) 22 | resultExpectation.fulfill() 23 | } 24 | waitForExpectations(timeout: 1) 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/macos/slow_spring_board.aiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/macos/slow_spring_board.aiff -------------------------------------------------------------------------------- /flutter_local_notifications/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_local_notifications_example 2 | description: Demonstrates how to use the flutter_local_notifications plugin. 3 | publish_to: none 4 | 5 | dependencies: 6 | cupertino_icons: ^1.0.8 7 | device_info_plus: ^11.3.0 8 | flutter: 9 | sdk: flutter 10 | flutter_local_notifications: 11 | path: ../ 12 | flutter_timezone: ^4.0.1 13 | http: ^1.3.0 14 | image: ^4.5.2 15 | path_provider: ^2.1.5 16 | timezone: ^0.10.0 17 | 18 | dev_dependencies: 19 | flutter_driver: 20 | sdk: flutter 21 | flutter_test: 22 | sdk: flutter 23 | integration_test: 24 | sdk: flutter 25 | msix: ^3.16.9 26 | 27 | flutter: 28 | uses-material-design: true 29 | assets: 30 | - icons/ 31 | - sound/ 32 | 33 | environment: 34 | sdk: ^3.4.0 35 | flutter: ">=3.22.0" 36 | 37 | msix_config: 38 | display_name: Flutter Local Notifications Example 39 | identity_name: Com.Example.FlutterLocalNotificationsExample 40 | msix_version: 1.0.0.0 41 | store: false 42 | install_certificate: false 43 | output_name: example 44 | toast_activator: 45 | clsid: "d49b0314-ee7a-4626-bf79-97cdb8a991bb" 46 | arguments: "msix-args" 47 | display_name: "Flutter Local Notifications" 48 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/sound/slow_spring_board.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/sound/slow_spring_board.mp3 -------------------------------------------------------------------------------- /flutter_local_notifications/example/test_driver/integration_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:integration_test/integration_test_driver.dart'; 2 | 3 | Future main() => integrationDriver(); 4 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | 19 | .vs 20 | out 21 | flutter/ephemeral 22 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | 11 | void RegisterPlugins(flutter::PluginRegistry* registry) { 12 | FlutterTimezonePluginCApiRegisterWithRegistrar( 13 | registry->GetRegistrarForPlugin("FlutterTimezonePluginCApi")); 14 | } 15 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | flutter_timezone 7 | ) 8 | 9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 10 | flutter_local_notifications_windows 11 | ) 12 | 13 | set(PLUGIN_BUNDLED_LIBRARIES) 14 | 15 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 16 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 17 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 20 | endforeach(plugin) 21 | 22 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 23 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 24 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 25 | endforeach(ffi_plugin) 26 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "utils.cpp" 8 | "win32_window.cpp" 9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 10 | "Runner.rc" 11 | "runner.exe.manifest" 12 | ) 13 | apply_standard_settings(${BINARY_NAME}) 14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 17 | add_dependencies(${BINARY_NAME} flutter_assemble) 18 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "flutter_window.h" 7 | #include "utils.h" 8 | 9 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 10 | _In_ wchar_t *command_line, _In_ int show_command) { 11 | // Attach to console when present (e.g., 'flutter run') or create a 12 | // new console when running with a debugger. 13 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 14 | CreateAndAttachConsole(); 15 | } 16 | 17 | // Initialize COM, so that it is available for use in the library and/or 18 | // plugins. 19 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 20 | 21 | flutter::DartProject project(L"data"); 22 | 23 | std::vector command_line_arguments = 24 | GetCommandLineArguments(); 25 | 26 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 27 | 28 | FlutterWindow window(project); 29 | Win32Window::Point origin(10, 10); 30 | Win32Window::Size size(1280, 720); 31 | if (!window.CreateAndShow(L"example", origin, size)) { 32 | return EXIT_FAILURE; 33 | } 34 | window.SetQuitOnClose(true); 35 | 36 | ::MSG msg; 37 | while (::GetMessage(&msg, nullptr, 0, 0)) { 38 | ::TranslateMessage(&msg); 39 | ::DispatchMessage(&msg); 40 | } 41 | 42 | ::CoUninitialize(); 43 | return EXIT_SUCCESS; 44 | } 45 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications/example/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /flutter_local_notifications/example/windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /flutter_local_notifications/example/windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /flutter_local_notifications/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | 13 | *.pbxuser 14 | *.mode1v3 15 | *.mode2v3 16 | *.perspectivev3 17 | 18 | !default.pbxuser 19 | !default.mode1v3 20 | !default.mode2v3 21 | !default.perspectivev3 22 | 23 | xcuserdata 24 | 25 | *.moved-aside 26 | 27 | *.pyc 28 | *sync/ 29 | Icon? 30 | .tags* 31 | 32 | -------------------------------------------------------------------------------- /flutter_local_notifications/ios/flutter_local_notifications.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'flutter_local_notifications' 6 | s.version = '0.0.1' 7 | s.summary = 'Flutter plugin for displaying local notifications.' 8 | s.description = <<-DESC 9 | Flutter plugin for displaying local notifications. 10 | DESC 11 | s.homepage = 'https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications' 12 | s.license = { :type => 'BSD', :file => '../LICENSE' } 13 | s.author = { 'Michael Bui' => 'borromini_eeckhout@simplelogin.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'flutter_local_notifications/Sources/flutter_local_notifications/**/*.{h,m}' 16 | s.public_header_files = 'flutter_local_notifications/Sources/flutter_local_notifications/include/**/*.h' 17 | s.dependency 'Flutter' 18 | s.resource_bundles = {'flutter_local_notifications_privacy' => ['flutter_local_notifications/Sources/flutter_local_notifications/PrivacyInfo.xcprivacy']} 19 | s.ios.deployment_target = '11.0' 20 | end 21 | 22 | -------------------------------------------------------------------------------- /flutter_local_notifications/ios/flutter_local_notifications/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.9 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "flutter_local_notifications", 8 | platforms: [ 9 | .iOS("11.0") 10 | ], 11 | products: [ 12 | .library(name: "flutter-local-notifications", targets: ["flutter_local_notifications"]) 13 | ], 14 | dependencies: [], 15 | targets: [ 16 | .target( 17 | name: "flutter_local_notifications", 18 | dependencies: [], 19 | resources: [ 20 | .process("PrivacyInfo.xcprivacy") 21 | ], 22 | cSettings: [ 23 | .headerSearchPath("include/flutter_local_notifications") 24 | ] 25 | ) 26 | ] 27 | ) 28 | -------------------------------------------------------------------------------- /flutter_local_notifications/ios/flutter_local_notifications/Sources/flutter_local_notifications/ActionEventSink.m: -------------------------------------------------------------------------------- 1 | // 2 | // ActionEventSink.m 3 | // flutter_local_notifications 4 | // 5 | // Created by Sebastian Roth on 11/1/20. 6 | // 7 | 8 | #import "./include/flutter_local_notifications/ActionEventSink.h" 9 | 10 | @interface ActionEventSink () { 11 | NSMutableArray *cache; 12 | FlutterEventSink eventSink; 13 | } 14 | 15 | @end 16 | 17 | @implementation ActionEventSink 18 | 19 | - (instancetype)init { 20 | self = [super init]; 21 | if (self) { 22 | cache = [NSMutableArray array]; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)addItem:(NSDictionary *)item { 28 | if (eventSink) { 29 | eventSink(item); 30 | } else { 31 | [cache addObject:item]; 32 | } 33 | } 34 | 35 | - (FlutterError *_Nullable)onListenWithArguments:(id _Nullable)arguments 36 | eventSink: 37 | (nonnull FlutterEventSink)events { 38 | for (NSDictionary *item in cache) { 39 | events(item); 40 | } 41 | [cache removeAllObjects]; 42 | 43 | eventSink = events; 44 | 45 | return nil; 46 | } 47 | 48 | - (FlutterError *_Nullable)onCancelWithArguments:(id _Nullable)arguments { 49 | eventSink = nil; 50 | 51 | return nil; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /flutter_local_notifications/ios/flutter_local_notifications/Sources/flutter_local_notifications/FlutterLocalNotificationsConverters.m: -------------------------------------------------------------------------------- 1 | #import "./include/flutter_local_notifications/FlutterLocalNotificationsConverters.h" 2 | 3 | @implementation FlutterLocalNotificationsConverters 4 | 5 | + (UNNotificationCategoryOptions)parseNotificationCategoryOptions: 6 | (NSArray *)options { 7 | int result = UNNotificationCategoryOptionNone; 8 | 9 | for (NSNumber *option in options) { 10 | result |= [option intValue]; 11 | } 12 | 13 | return result; 14 | } 15 | 16 | + (UNNotificationActionOptions)parseNotificationActionOptions: 17 | (NSArray *)options { 18 | int result = UNNotificationActionOptionNone; 19 | 20 | for (NSNumber *option in options) { 21 | result |= [option intValue]; 22 | } 23 | 24 | return result; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /flutter_local_notifications/ios/flutter_local_notifications/Sources/flutter_local_notifications/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyTrackingDomains 6 | 7 | NSPrivacyAccessedAPITypes 8 | 9 | 10 | NSPrivacyAccessedAPIType 11 | NSPrivacyAccessedAPICategoryUserDefaults 12 | NSPrivacyAccessedAPITypeReasons 13 | 14 | CA92.1 15 | 16 | 17 | 18 | NSPrivacyCollectedDataTypes 19 | 20 | NSPrivacyTracking 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /flutter_local_notifications/ios/flutter_local_notifications/Sources/flutter_local_notifications/include/flutter_local_notifications/ActionEventSink.h: -------------------------------------------------------------------------------- 1 | // 2 | // ActionEventSink.h 3 | // flutter_local_notifications 4 | // 5 | // Created by Sebastian Roth on 11/1/20. 6 | // 7 | 8 | #import 9 | 10 | #if TARGET_OS_OSX 11 | #import 12 | #else 13 | #import 14 | #endif 15 | 16 | NS_ASSUME_NONNULL_BEGIN 17 | 18 | @interface ActionEventSink : NSObject 19 | 20 | - (void)addItem:(NSDictionary *)item; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END 25 | -------------------------------------------------------------------------------- /flutter_local_notifications/ios/flutter_local_notifications/Sources/flutter_local_notifications/include/flutter_local_notifications/FlutterEngineManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // FlutterEngineManager.h 3 | // flutter_local_notifications 4 | // 5 | // Created by Sebastian Roth on 12/30/21. 6 | // 7 | 8 | #import 9 | 10 | #import 11 | 12 | #import "ActionEventSink.h" 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | @interface FlutterEngineManager : NSObject 17 | 18 | /// The App Delegate used by this plugin should only be added to the main 19 | /// isolate in a Flutter App. 20 | /// 21 | /// This method checks whether the background engine is running or whether the 22 | /// registrat belongs to it. 23 | + (BOOL)shouldAddAppDelegateToRegistrar: 24 | (NSObject *)registrar; 25 | 26 | - (void)startEngineIfNeeded:(ActionEventSink *)actionEventSink 27 | registerPlugins:(FlutterPluginRegistrantCallback)registerPlugins; 28 | 29 | - (void)registerDispatcherHandle:(NSNumber *)dispatcherHandle 30 | callbackHandle:(NSNumber *)callbackHandle; 31 | 32 | /// Called from the dart side to know which Dart method to call up next to 33 | /// actually handle the notification. 34 | - (NSNumber *)getCallbackHandle; 35 | 36 | @end 37 | 38 | NS_ASSUME_NONNULL_END 39 | -------------------------------------------------------------------------------- /flutter_local_notifications/ios/flutter_local_notifications/Sources/flutter_local_notifications/include/flutter_local_notifications/FlutterLocalNotificationsConverters.h: -------------------------------------------------------------------------------- 1 | // 2 | // FlutterLocalNotificationsFlutterLocalNotificationsConverters.h 3 | // flutter_local_notifications 4 | // 5 | 6 | #import 7 | #import 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | @interface FlutterLocalNotificationsConverters : NSObject 12 | 13 | + (UNNotificationCategoryOptions)parseNotificationCategoryOptions: 14 | (NSArray *)options API_AVAILABLE(ios(10.0), macosx(10.14)); 15 | + (UNNotificationActionOptions)parseNotificationActionOptions:(NSArray *)options 16 | API_AVAILABLE(ios(10.0), macosx(10.14)); 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /flutter_local_notifications/ios/flutter_local_notifications/Sources/flutter_local_notifications/include/flutter_local_notifications/FlutterLocalNotificationsPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface FlutterLocalNotificationsPlugin : NSObject 5 | @end 6 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/callback_dispatcher.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:flutter/services.dart'; 4 | import 'package:flutter/widgets.dart'; 5 | import 'package:flutter_local_notifications_platform_interface/flutter_local_notifications_platform_interface.dart'; 6 | 7 | // ignore_for_file: public_member_api_docs, avoid_annotating_with_dynamic 8 | @pragma('vm:entry-point') 9 | void callbackDispatcher() { 10 | WidgetsFlutterBinding.ensureInitialized(); 11 | 12 | const EventChannel backgroundChannel = 13 | EventChannel('dexterous.com/flutter/local_notifications/actions'); 14 | 15 | const MethodChannel channel = 16 | MethodChannel('dexterous.com/flutter/local_notifications'); 17 | 18 | channel.invokeMethod('getCallbackHandle').then((int? handle) { 19 | final DidReceiveBackgroundNotificationResponseCallback? callback = 20 | handle == null 21 | ? null 22 | : PluginUtilities.getCallbackFromHandle( 23 | CallbackHandle.fromRawHandle(handle)) 24 | as DidReceiveBackgroundNotificationResponseCallback?; 25 | 26 | backgroundChannel 27 | .receiveBroadcastStream() 28 | .map>((dynamic event) => event) 29 | .map>( 30 | (Map event) => Map.castFrom(event)) 31 | .listen((Map event) { 32 | final Object notificationId = event['notificationId']; 33 | final int id; 34 | if (notificationId is int) { 35 | id = notificationId; 36 | } else if (notificationId is String) { 37 | id = int.parse(notificationId); 38 | } else { 39 | id = -1; 40 | } 41 | callback?.call(NotificationResponse( 42 | id: id, 43 | actionId: event['actionId'], 44 | input: event['input'], 45 | payload: event['payload'], 46 | notificationResponseType: 47 | NotificationResponseType.selectedNotificationAction, 48 | )); 49 | }); 50 | }); 51 | } 52 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/helpers.dart: -------------------------------------------------------------------------------- 1 | import 'package:clock/clock.dart'; 2 | import 'package:timezone/timezone.dart'; 3 | 4 | import 'types.dart'; 5 | 6 | /// Helper method for validating a date/time value represents a future point in 7 | /// time where `matchDateTimeComponents` is null. 8 | void validateDateIsInTheFuture( 9 | TZDateTime scheduledDate, 10 | DateTimeComponents? matchDateTimeComponents, 11 | ) { 12 | if (matchDateTimeComponents != null) { 13 | return; 14 | } 15 | if (scheduledDate.isBefore(clock.now())) { 16 | throw ArgumentError.value( 17 | scheduledDate, 'scheduledDate', 'Must be a date in the future'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/initialization_settings.dart: -------------------------------------------------------------------------------- 1 | import '../flutter_local_notifications.dart'; 2 | 3 | /// Settings for initializing the plugin for each platform. 4 | class InitializationSettings { 5 | /// Constructs an instance of [InitializationSettings]. 6 | const InitializationSettings({ 7 | this.android, 8 | this.iOS, 9 | this.macOS, 10 | this.linux, 11 | this.windows, 12 | }); 13 | 14 | /// Settings for Android. 15 | /// 16 | /// It is nullable, because we don't want to force users to specify settings 17 | /// for platforms that they don't target. 18 | final AndroidInitializationSettings? android; 19 | 20 | /// Settings for iOS. 21 | /// 22 | /// It is nullable, because we don't want to force users to specify settings 23 | /// for platforms that they don't target. 24 | final DarwinInitializationSettings? iOS; 25 | 26 | /// Settings for macOS. 27 | /// 28 | /// It is nullable, because we don't want to force users to specify settings 29 | /// for platforms that they don't target. 30 | final DarwinInitializationSettings? macOS; 31 | 32 | /// Settings for Linux. 33 | /// 34 | /// It is nullable, because we don't want to force users to specify settings 35 | /// for platforms that they don't target. 36 | final LinuxInitializationSettings? linux; 37 | 38 | /// Settings for Windows. 39 | final WindowsInitializationSettings? windows; 40 | } 41 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/notification_details.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_local_notifications_linux/flutter_local_notifications_linux.dart'; 2 | import 'package:flutter_local_notifications_windows/flutter_local_notifications_windows.dart'; 3 | 4 | import 'platform_specifics/android/notification_details.dart'; 5 | import 'platform_specifics/darwin/notification_details.dart'; 6 | 7 | /// Contains notification details specific to each platform. 8 | class NotificationDetails { 9 | /// Constructs an instance of [NotificationDetails]. 10 | const NotificationDetails({ 11 | this.android, 12 | this.iOS, 13 | this.macOS, 14 | this.linux, 15 | this.windows, 16 | }); 17 | 18 | /// Notification details for Android. 19 | final AndroidNotificationDetails? android; 20 | 21 | /// Notification details for iOS. 22 | final DarwinNotificationDetails? iOS; 23 | 24 | /// Notification details for macOS. 25 | final DarwinNotificationDetails? macOS; 26 | 27 | /// Notification details for Linux. 28 | final LinuxNotificationDetails? linux; 29 | 30 | /// Notification details for Windows. 31 | final WindowsNotificationDetails? windows; 32 | } 33 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/android/initialization_settings.dart: -------------------------------------------------------------------------------- 1 | /// Plugin initialization settings for Android. 2 | class AndroidInitializationSettings { 3 | /// Constructs an instance of [AndroidInitializationSettings]. 4 | const AndroidInitializationSettings(this.defaultIcon); 5 | 6 | /// Specifies the default icon for notifications. 7 | final String defaultIcon; 8 | } 9 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/android/message.dart: -------------------------------------------------------------------------------- 1 | import 'person.dart'; 2 | 3 | /// Represents a message used in Android messaging style notifications. 4 | class Message { 5 | /// Constructs an instance of [Message]. 6 | const Message( 7 | this.text, 8 | this.timestamp, 9 | this.person, { 10 | this.dataMimeType, 11 | this.dataUri, 12 | }) : assert( 13 | (dataMimeType == null && dataUri == null) || 14 | (dataMimeType != null && dataUri != null), 15 | 'Must provide both dataMimeType and dataUri together or not at all.', 16 | ); 17 | 18 | /// The message text 19 | final String text; 20 | 21 | /// Time at which the message arrived. 22 | /// 23 | /// Note that this is eventually converted to milliseconds since epoch as 24 | /// required by Android. 25 | final DateTime timestamp; 26 | 27 | /// Person that sent this message. 28 | /// 29 | /// When this is set to `null` the `Person` given to 30 | /// [MessagingStyleInformation.person] i.e. this would indicate that the 31 | /// message was sent from the user. 32 | final Person? person; 33 | 34 | /// MIME type for this message context when the [dataUri] is provided. 35 | final String? dataMimeType; 36 | 37 | /// Uri containing the content. 38 | /// 39 | /// The original text will be used if the content or MIME type isn't supported 40 | final String? dataUri; 41 | } 42 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/android/notification_channel_group.dart: -------------------------------------------------------------------------------- 1 | /// A group of related Android notification channels. 2 | class AndroidNotificationChannelGroup { 3 | /// Constructs an instance of [AndroidNotificationChannelGroup]. 4 | const AndroidNotificationChannelGroup( 5 | this.id, 6 | this.name, { 7 | this.description, 8 | }); 9 | 10 | /// The id of this group. 11 | final String id; 12 | 13 | /// The name of this group. 14 | final String name; 15 | 16 | /// The description of this group. 17 | /// 18 | /// Only applicable to Android 9.0 or newer. 19 | final String? description; 20 | } 21 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/android/notification_sound.dart: -------------------------------------------------------------------------------- 1 | /// Represents an Android notification sound. 2 | abstract class AndroidNotificationSound { 3 | /// The location of the sound. 4 | String get sound; 5 | } 6 | 7 | /// Represents a raw resource belonging to the Android application that should 8 | /// be used for the notification sound. 9 | /// 10 | /// These resources would be found in the `res/raw` directory of the Android application 11 | class RawResourceAndroidNotificationSound implements AndroidNotificationSound { 12 | /// Constructs an instance of [RawResourceAndroidNotificationSound]. 13 | const RawResourceAndroidNotificationSound(this._sound); 14 | 15 | final String? _sound; 16 | 17 | /// The name of the raw resource for the notification sound. 18 | @override 19 | String get sound => _sound!; 20 | } 21 | 22 | /// Represents a URI on the Android device that should be used for the 23 | /// notification sound. 24 | /// 25 | /// One way of obtaining such URIs is to use the native Android RingtoneManager 26 | /// APIs, which may require developers to write their own code that makes use 27 | /// of platform channels. 28 | class UriAndroidNotificationSound implements AndroidNotificationSound { 29 | /// Constructs an instance of [UriAndroidNotificationSound]. 30 | const UriAndroidNotificationSound(this._sound); 31 | 32 | final String _sound; 33 | 34 | /// The URI for the notification sound. 35 | @override 36 | String get sound => _sound; 37 | } 38 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/android/person.dart: -------------------------------------------------------------------------------- 1 | import 'icon.dart'; 2 | 3 | /// Details of a person e.g. someone who sent a message. 4 | class Person { 5 | /// Constructs an instance of [Person]. 6 | const Person({ 7 | this.bot = false, 8 | this.icon, 9 | this.important = false, 10 | this.key, 11 | this.name, 12 | this.uri, 13 | }); 14 | 15 | /// Whether or not this person represents a machine rather than a human. 16 | final bool bot; 17 | 18 | /// Icon for this person. 19 | final AndroidIcon? icon; 20 | 21 | /// Whether or not this is an important person. 22 | final bool important; 23 | 24 | /// Unique identifier for this person. 25 | final String? key; 26 | 27 | /// Name of this person. 28 | final String? name; 29 | 30 | /// Uri for this person. 31 | final String? uri; 32 | } 33 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/android/schedule_mode.dart: -------------------------------------------------------------------------------- 1 | /// Used to specify how notifications should be scheduled on Android. 2 | /// 3 | /// This leverages the use of alarms to schedule notifications as described 4 | /// at https://developer.android.com/training/scheduling/alarms 5 | enum AndroidScheduleMode { 6 | /// Used to specify that the notification should be scheduled to be shown at 7 | /// the exact time specified AND will execute whilst device is in 8 | /// low-power idle mode. Requires SCHEDULE_EXACT_ALARM permission. 9 | alarmClock, 10 | 11 | /// Used to specify that the notification should be scheduled to be shown at 12 | /// the exact time specified but may not execute whilst device is in 13 | /// low-power idle mode. 14 | exact, 15 | 16 | /// Used to specify that the notification should be scheduled to be shown at 17 | /// the exact time specified and will execute whilst device is in 18 | /// low-power idle mode. 19 | exactAllowWhileIdle, 20 | 21 | /// Used to specify that the notification should be scheduled to be shown at 22 | /// at roughly specified time but may not execute whilst device is in 23 | /// low-power idle mode. 24 | inexact, 25 | 26 | /// Used to specify that the notification should be scheduled to be shown at 27 | /// at roughly specified time and will execute whilst device is in 28 | /// low-power idle mode. 29 | inexactAllowWhileIdle, 30 | } 31 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/android/styles/big_picture_style_information.dart: -------------------------------------------------------------------------------- 1 | import '../bitmap.dart'; 2 | import 'default_style_information.dart'; 3 | 4 | /// Used to pass the content for an Android notification displayed using the 5 | /// big picture style. 6 | class BigPictureStyleInformation extends DefaultStyleInformation { 7 | /// Constructs an instance of [BigPictureStyleInformation]. 8 | const BigPictureStyleInformation( 9 | this.bigPicture, { 10 | this.contentTitle, 11 | this.summaryText, 12 | this.htmlFormatContentTitle = false, 13 | this.htmlFormatSummaryText = false, 14 | this.largeIcon, 15 | bool htmlFormatContent = false, 16 | bool htmlFormatTitle = false, 17 | this.hideExpandedLargeIcon = false, 18 | }) : super(htmlFormatContent, htmlFormatTitle); 19 | 20 | /// Overrides ContentTitle in the big form of the template. 21 | final String? contentTitle; 22 | 23 | /// Set the first line of text after the detail section in the big form of 24 | /// the template. 25 | final String? summaryText; 26 | 27 | /// Specifies if the overridden ContentTitle should have formatting applied 28 | /// through HTML markup. 29 | final bool htmlFormatContentTitle; 30 | 31 | /// Specifies if formatting should be applied to the first line of text after 32 | /// the detail section in the big form of the template. 33 | final bool htmlFormatSummaryText; 34 | 35 | /// The bitmap that will override the large icon when the big notification is 36 | /// shown. 37 | final AndroidBitmap? largeIcon; 38 | 39 | /// The bitmap to be used as the payload for the BigPicture notification. 40 | final AndroidBitmap bigPicture; 41 | 42 | /// Hides the large icon when showing the expanded notification. 43 | final bool hideExpandedLargeIcon; 44 | } 45 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/android/styles/big_text_style_information.dart: -------------------------------------------------------------------------------- 1 | import 'default_style_information.dart'; 2 | 3 | /// Used to pass the content for an Android notification displayed using the 4 | /// big text style. 5 | class BigTextStyleInformation extends DefaultStyleInformation { 6 | /// Constructs an instance of [BigTextStyleInformation]. 7 | const BigTextStyleInformation( 8 | this.bigText, { 9 | this.htmlFormatBigText = false, 10 | this.contentTitle, 11 | this.htmlFormatContentTitle = false, 12 | this.summaryText, 13 | this.htmlFormatSummaryText = false, 14 | bool htmlFormatContent = false, 15 | bool htmlFormatTitle = false, 16 | }) : super(htmlFormatContent, htmlFormatTitle); 17 | 18 | /// Provide the longer text to be displayed in the big form of the template 19 | /// in place of the content text. 20 | final String bigText; 21 | 22 | /// Overrides ContentTitle in the big form of the template. 23 | final String? contentTitle; 24 | 25 | /// Set the first line of text after the detail section in the big form of 26 | /// the template. 27 | final String? summaryText; 28 | 29 | /// Specifies if formatting should be applied to the longer text through 30 | /// HTML markup. 31 | final bool htmlFormatBigText; 32 | 33 | /// Specifies if the overridden ContentTitle should have formatting applies 34 | /// through HTML markup. 35 | final bool htmlFormatContentTitle; 36 | 37 | /// Specifies if formatting should be applied to the first line of text 38 | /// after the detail section in the big form of the template. 39 | final bool htmlFormatSummaryText; 40 | } 41 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/android/styles/default_style_information.dart: -------------------------------------------------------------------------------- 1 | import 'style_information.dart'; 2 | 3 | /// The default Android notification style. 4 | class DefaultStyleInformation implements StyleInformation { 5 | /// Constructs an instance of [DefaultStyleInformation]. 6 | const DefaultStyleInformation( 7 | this.htmlFormatContent, 8 | this.htmlFormatTitle, 9 | ); 10 | 11 | /// Specifies if formatting should be applied to the content through HTML 12 | /// markup. 13 | final bool htmlFormatContent; 14 | 15 | /// Specifies if formatting should be applied to the title through HTML 16 | /// markup. 17 | final bool htmlFormatTitle; 18 | } 19 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/android/styles/inbox_style_information.dart: -------------------------------------------------------------------------------- 1 | import 'default_style_information.dart'; 2 | 3 | /// Used to pass the content for an Android notification displayed using the 4 | /// inbox style. 5 | class InboxStyleInformation extends DefaultStyleInformation { 6 | /// Constructs an instance of [InboxStyleInformation]. 7 | const InboxStyleInformation( 8 | this.lines, { 9 | this.htmlFormatLines = false, 10 | this.contentTitle, 11 | this.htmlFormatContentTitle = false, 12 | this.summaryText, 13 | this.htmlFormatSummaryText = false, 14 | bool htmlFormatContent = false, 15 | bool htmlFormatTitle = false, 16 | }) : super(htmlFormatContent, htmlFormatTitle); 17 | 18 | /// Overrides ContentTitle in the big form of the template. 19 | final String? contentTitle; 20 | 21 | /// Set the first line of text after the detail section in the big form of 22 | /// the template. 23 | final String? summaryText; 24 | 25 | /// The lines that form part of the digest section for inbox-style 26 | /// notifications. 27 | final List lines; 28 | 29 | /// Specifies if the lines should have formatting applied through HTML markup. 30 | final bool htmlFormatLines; 31 | 32 | /// Specifies if the overridden ContentTitle should have formatting applied 33 | /// through HTML markup. 34 | final bool htmlFormatContentTitle; 35 | 36 | /// Specifies if formatting should be applied to the first line of text after 37 | /// the detail section in the big form of the template. 38 | final bool htmlFormatSummaryText; 39 | } 40 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/android/styles/media_style_information.dart: -------------------------------------------------------------------------------- 1 | import 'default_style_information.dart'; 2 | 3 | /// Used to pass the content for an Android notification displayed using the 4 | /// media style. 5 | /// 6 | /// When used, the bitmap given to [AndroidNotificationDetails.largeIcon] will 7 | /// be treated as album artwork. 8 | class MediaStyleInformation extends DefaultStyleInformation { 9 | /// Constructs an instance of [MediaStyleInformation]. 10 | const MediaStyleInformation({ 11 | bool htmlFormatContent = false, 12 | bool htmlFormatTitle = false, 13 | }) : super(htmlFormatContent, htmlFormatTitle); 14 | } 15 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/android/styles/messaging_style_information.dart: -------------------------------------------------------------------------------- 1 | import '../message.dart'; 2 | import '../person.dart'; 3 | import 'default_style_information.dart'; 4 | 5 | /// Used to pass the content for an Android notification displayed using the 6 | /// messaging style. 7 | class MessagingStyleInformation extends DefaultStyleInformation { 8 | /// Constructs an instance of [MessagingStyleInformation]. 9 | MessagingStyleInformation( 10 | this.person, { 11 | this.conversationTitle, 12 | this.groupConversation, 13 | this.messages, 14 | bool htmlFormatContent = false, 15 | bool htmlFormatTitle = false, 16 | }) : super(htmlFormatContent, htmlFormatTitle); 17 | 18 | /// The person displayed for any messages that are sent by the user. 19 | final Person person; 20 | 21 | /// The title to be displayed on this conversation. 22 | final String? conversationTitle; 23 | 24 | /// Whether this conversation notification represents a group. 25 | final bool? groupConversation; 26 | 27 | /// Messages to be displayed by this notification 28 | final List? messages; 29 | } 30 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/android/styles/style_information.dart: -------------------------------------------------------------------------------- 1 | /// Abstract class for defining an Android notification style 2 | abstract class StyleInformation {} 3 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/darwin/notification_action_option.dart: -------------------------------------------------------------------------------- 1 | /// Describes when & how the notification action is displayed. 2 | /// 3 | /// Corresponds to 4 | /// https://developer.apple.com/documentation/usernotifications/unnotificationactionoptions 5 | /// for more details. 6 | enum DarwinNotificationActionOption { 7 | /// The action can be performed only on an unlocked device. 8 | /// 9 | /// Corresponds to [`UNNotificationActionOptions.authenticationRequired`](https://developer.apple.com/documentation/usernotifications/unnotificationactionoptions/1648196-authenticationrequired). 10 | authenticationRequired(1 << 0), 11 | 12 | /// The action performs a destructive task. 13 | /// 14 | /// Corresponds to [`UNNotificationActionOptions.destructive`](https://developer.apple.com/documentation/usernotifications/unnotificationactionoptions/1648199-destructive) 15 | destructive(1 << 1), 16 | 17 | /// The action causes the app to launch in the foreground. 18 | /// 19 | /// Corresponds to [`UNNotificationActionOptions.foreground`](https://developer.apple.com/documentation/usernotifications/unnotificationactionoptions/1648192-foreground) 20 | 21 | foreground(1 << 2); 22 | 23 | /// Constructs an instance of [DarwinNotificationActionOption]. 24 | const DarwinNotificationActionOption(this.value); 25 | 26 | /// The integer representation of [DarwinNotificationActionOption]. 27 | final int value; 28 | } 29 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/darwin/notification_category.dart: -------------------------------------------------------------------------------- 1 | import 'notification_action.dart'; 2 | import 'notification_category_option.dart'; 3 | 4 | /// Corresponds to the `UNNotificationCategory` type which is used to configure 5 | /// notification categories and accompanying options. 6 | /// 7 | /// See the official docs at 8 | /// https://developer.apple.com/documentation/usernotifications/unnotificationcategory 9 | /// for more details. 10 | class DarwinNotificationCategory { 11 | /// Constructs a instance of [DarwinNotificationCategory]. 12 | const DarwinNotificationCategory( 13 | this.identifier, { 14 | this.actions = const [], 15 | this.options = const {}, 16 | }); 17 | 18 | /// The unique string assigned to the category. 19 | final String identifier; 20 | 21 | /// The actions to display when a notification of this type is presented. 22 | final List actions; 23 | 24 | /// Options for how to handle notifications of this type. 25 | final Set options; 26 | } 27 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/platform_specifics/darwin/notification_enabled_options.dart: -------------------------------------------------------------------------------- 1 | /// Data class that represent current state of notification options. 2 | /// 3 | /// Used for Darwin systems, like iOS and macOS. 4 | class NotificationsEnabledOptions { 5 | /// Constructs an instance of [NotificationsEnabledOptions] 6 | const NotificationsEnabledOptions({ 7 | required this.isEnabled, 8 | required this.isSoundEnabled, 9 | required this.isAlertEnabled, 10 | required this.isBadgeEnabled, 11 | required this.isProvisionalEnabled, 12 | required this.isCriticalEnabled, 13 | }); 14 | 15 | /// Whenever notifications are enabled. 16 | /// 17 | /// Can be either [isEnabled] or [isProvisionalEnabled]. 18 | final bool isEnabled; 19 | 20 | /// Whenever sound notifications are enabled. 21 | final bool isSoundEnabled; 22 | 23 | /// Whenever alert notifications are enabled. 24 | final bool isAlertEnabled; 25 | 26 | /// Whenever badge notifications are enabled. 27 | final bool isBadgeEnabled; 28 | 29 | /// Whenever provisional notifications are enabled. 30 | /// 31 | /// Can be either [isEnabled] or [isProvisionalEnabled]. 32 | final bool isProvisionalEnabled; 33 | 34 | /// Whenever critical notifications are enabled. 35 | final bool isCriticalEnabled; 36 | } 37 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/typedefs.dart: -------------------------------------------------------------------------------- 1 | /// Signature of the callback that is triggered when a notification is shown 2 | /// whilst the app is in the foreground. 3 | /// 4 | /// This property is only applicable to iOS versions older than 10. 5 | typedef DidReceiveLocalNotificationCallback = void Function( 6 | int id, String? title, String? body, String? payload); 7 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/types.dart: -------------------------------------------------------------------------------- 1 | /// The days of the week. 2 | enum Day { 3 | /// Sunday. 4 | sunday(1), 5 | 6 | /// Monday. 7 | monday(2), 8 | 9 | /// Tuesday. 10 | tuesday(3), 11 | 12 | /// Wednesday. 13 | wednesday(4), 14 | 15 | /// Thursday. 16 | thursday(5), 17 | 18 | /// Friday. 19 | friday(6), 20 | 21 | /// Saturday. 22 | saturday(7); 23 | 24 | /// Constructs an instance of [Day]. 25 | const Day(this.value); 26 | 27 | /// The integer representation of [Day]. 28 | final int value; 29 | } 30 | 31 | /// The components of a date and time representations. 32 | enum DateTimeComponents { 33 | /// The time. 34 | time, 35 | 36 | /// The day of the week and time. 37 | dayOfWeekAndTime, 38 | 39 | /// The day of the month and time. 40 | dayOfMonthAndTime, 41 | 42 | /// The date and time. 43 | dateAndTime, 44 | } 45 | -------------------------------------------------------------------------------- /flutter_local_notifications/lib/src/tz_datetime_mapper.dart: -------------------------------------------------------------------------------- 1 | import 'package:timezone/timezone.dart'; 2 | 3 | // ignore_for_file: public_member_api_docs 4 | extension TZDateTimeMapper on TZDateTime { 5 | Map toMap() { 6 | String twoDigits(int n) { 7 | if (n >= 10) { 8 | return '$n'; 9 | } 10 | return '0$n'; 11 | } 12 | 13 | final String offsetMinutesComponent = 14 | twoDigits(timeZoneOffset.inMinutes.remainder(60)); 15 | final int offsetHoursComponent = 16 | (timeZoneOffset.inMicroseconds ~/ Duration.microsecondsPerHour).abs(); 17 | final String iso8601OffsetComponent = 18 | '${timeZoneOffset.isNegative ? '-' : '+'}${twoDigits(offsetHoursComponent)}$offsetMinutesComponent'; // ignore: lines_longer_than_80_chars 19 | final String iso8601DateComponent = toIso8601String() 20 | .split('.')[0] 21 | .replaceAll(iso8601OffsetComponent, '') 22 | .replaceAll('Z', ''); 23 | 24 | return { 25 | 'timeZoneName': location.name, 26 | 'scheduledDateTime': iso8601DateComponent, 27 | 'scheduledDateTimeISO8601': toIso8601String(), 28 | }; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /flutter_local_notifications/macos/flutter_local_notifications.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint flutter_local_notifications.podspec' to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'flutter_local_notifications' 7 | s.version = '0.0.1' 8 | s.summary = 'Flutter plugin for displaying local notifications.' 9 | s.description = <<-DESC 10 | Flutter plugin for displaying local notifications. 11 | DESC 12 | s.homepage = 'https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications' 13 | s.license = { :type => 'BSD', :file => '../LICENSE' } 14 | s.author = { 'Michael Bui' => 'borromini_eeckhout@simplelogin.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'flutter_local_notifications/Sources/flutter_local_notifications/**/*.swift' 17 | s.dependency 'FlutterMacOS' 18 | 19 | s.platform = :osx, '10.14' 20 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } 21 | s.resource_bundles = {'flutter_local_notifications_privacy' => ['flutter_local_notifications/Sources/flutter_local_notifications/PrivacyInfo.xcprivacy']} 22 | s.swift_version = '5.0' 23 | end 24 | -------------------------------------------------------------------------------- /flutter_local_notifications/macos/flutter_local_notifications/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.9 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "flutter_local_notifications", 8 | platforms: [ 9 | .macOS("10.14") 10 | ], 11 | products: [ 12 | .library(name: "flutter-local-notifications", targets: ["flutter_local_notifications"]) 13 | ], 14 | dependencies: [], 15 | targets: [ 16 | .target( 17 | name: "flutter_local_notifications", 18 | dependencies: [], 19 | resources: [ 20 | .process("PrivacyInfo.xcprivacy") 21 | ], 22 | cSettings: [ 23 | .headerSearchPath("include/flutter_local_notifications") 24 | ] 25 | ) 26 | ] 27 | ) 28 | -------------------------------------------------------------------------------- /flutter_local_notifications/macos/flutter_local_notifications/Sources/flutter_local_notifications/FlutterLocalNotificationsConverters.swift: -------------------------------------------------------------------------------- 1 | import UserNotifications 2 | 3 | public class FlutterLocalNotificationsConverters { 4 | public static func parseNotificationCategoryOptions(_ options: [Any]?) -> UNNotificationCategoryOptions { 5 | var result: UInt = 0 6 | 7 | for option in options ?? [] { 8 | guard let option = option as? NSNumber else { 9 | continue 10 | } 11 | result |= option.uintValue 12 | } 13 | 14 | return UNNotificationCategoryOptions(rawValue: result) 15 | } 16 | 17 | public static func parseNotificationActionOptions(_ options: [Any]?) -> UNNotificationActionOptions { 18 | var result: UInt = 0 19 | 20 | for option in options ?? [] { 21 | guard let option = option as? NSNumber else { 22 | continue 23 | } 24 | result |= option.uintValue 25 | } 26 | 27 | return UNNotificationActionOptions(rawValue: result) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /flutter_local_notifications/macos/flutter_local_notifications/Sources/flutter_local_notifications/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyTrackingDomains 6 | 7 | NSPrivacyAccessedAPITypes 8 | 9 | 10 | NSPrivacyAccessedAPIType 11 | NSPrivacyAccessedAPICategoryUserDefaults 12 | NSPrivacyAccessedAPITypeReasons 13 | 14 | CA92.1 15 | 16 | 17 | 18 | NSPrivacyCollectedDataTypes 19 | 20 | NSPrivacyTracking 21 | 22 | 23 | -------------------------------------------------------------------------------- /flutter_local_notifications/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_local_notifications 2 | description: A cross platform plugin for displaying and scheduling local 3 | notifications for Flutter applications with the ability to customise for each 4 | platform. 5 | version: 19.2.1 6 | homepage: https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications 7 | issue_tracker: https://github.com/MaikuB/flutter_local_notifications/issues 8 | 9 | dependencies: 10 | clock: ^1.1.0 11 | flutter: 12 | sdk: flutter 13 | flutter_local_notifications_linux: ^6.0.0 14 | flutter_local_notifications_windows: ^1.0.0 15 | flutter_local_notifications_platform_interface: ^9.0.0 16 | timezone: ^0.10.0 17 | 18 | dev_dependencies: 19 | flutter_driver: 20 | sdk: flutter 21 | flutter_test: 22 | sdk: flutter 23 | mockito: ^5.3.2 24 | plugin_platform_interface: ^2.1.8 25 | 26 | flutter: 27 | plugin: 28 | platforms: 29 | android: 30 | package: com.dexterous.flutterlocalnotifications 31 | pluginClass: FlutterLocalNotificationsPlugin 32 | dartPluginClass: AndroidFlutterLocalNotificationsPlugin 33 | ios: 34 | pluginClass: FlutterLocalNotificationsPlugin 35 | dartPluginClass: IOSFlutterLocalNotificationsPlugin 36 | macos: 37 | pluginClass: FlutterLocalNotificationsPlugin 38 | dartPluginClass: MacOSFlutterLocalNotificationsPlugin 39 | linux: 40 | default_package: flutter_local_notifications_linux 41 | windows: 42 | default_package: flutter_local_notifications_windows 43 | 44 | environment: 45 | sdk: ^3.4.0 46 | flutter: ">=3.22.0" 47 | -------------------------------------------------------------------------------- /flutter_local_notifications/test/flutter_local_notifications_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:flutter_local_notifications/flutter_local_notifications.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:mockito/mockito.dart'; 5 | import 'package:plugin_platform_interface/plugin_platform_interface.dart'; 6 | 7 | void main() { 8 | TestWidgetsFlutterBinding.ensureInitialized(); 9 | final MockFlutterLocalNotificationsPlugin mock = 10 | MockFlutterLocalNotificationsPlugin(); 11 | FlutterLocalNotificationsPlatform.instance = mock; 12 | 13 | test('Creates DarwinNotificationAttachment when file path is specified', () { 14 | expect(const DarwinNotificationAttachment(''), 15 | isA()); 16 | }); 17 | } 18 | 19 | class MockMethodChannel extends Mock implements MethodChannel {} 20 | 21 | class MockFlutterLocalNotificationsPlugin extends Mock 22 | with 23 | MockPlatformInterfaceMixin // ignore: prefer_mixin 24 | implements 25 | FlutterLocalNotificationsPlatform {} 26 | -------------------------------------------------------------------------------- /flutter_local_notifications/test/utils/date_formatter.dart: -------------------------------------------------------------------------------- 1 | import 'package:timezone/timezone.dart' as tz; 2 | 3 | String convertDateToISO8601String(tz.TZDateTime dateTime) { 4 | String _twoDigits(int n) { 5 | if (n >= 10) { 6 | return '$n'; 7 | } 8 | return '0$n'; 9 | } 10 | 11 | String _fourDigits(int n) { 12 | final int absN = n.abs(); 13 | final String sign = n < 0 ? '-' : ''; 14 | if (absN >= 1000) { 15 | return '$n'; 16 | } 17 | if (absN >= 100) { 18 | return '${sign}0$absN'; 19 | } 20 | if (absN >= 10) { 21 | return '${sign}00$absN'; 22 | } 23 | return '${sign}000$absN'; 24 | } 25 | 26 | return '${_fourDigits(dateTime.year)}-${_twoDigits(dateTime.month)}-${_twoDigits(dateTime.day)}T${_twoDigits(dateTime.hour)}:${_twoDigits(dateTime.minute)}:${_twoDigits(dateTime.second)}'; // ignore: lines_longer_than_80_chars 27 | } 28 | -------------------------------------------------------------------------------- /flutter_local_notifications_linux/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | -------------------------------------------------------------------------------- /flutter_local_notifications_linux/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2018 Michael Bui. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of the copyright holder nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /flutter_local_notifications_linux/README.md: -------------------------------------------------------------------------------- 1 | # Flutter Local Notifications Linux plugin 2 | 3 | The Linux implementation of [`flutter_local_notifications`](https://pub.dev/packages/flutter_local_notifications). 4 | 5 | ## Usage 6 | 7 | This package is already included as part of the `flutter_local_notifications` package dependency, and will 8 | be included when using `flutter_local_notifications` as normal. 9 | -------------------------------------------------------------------------------- /flutter_local_notifications_linux/lib/flutter_local_notifications_linux.dart: -------------------------------------------------------------------------------- 1 | /// The Linux implementation of `flutter_local_notifications`. 2 | library flutter_local_notifications_linux; 3 | 4 | // flutter_local_notifications_linux depends on dbus and posix 5 | // which uses FFI internally; export a stub for platforms that don't 6 | // support FFI (e.g., web) to avoid having transitive dependencies 7 | // break web compilation. 8 | export 'src/flutter_local_notifications_stub.dart' 9 | if (dart.library.ffi) 'src/flutter_local_notifications.dart'; 10 | export 'src/model/capabilities.dart'; 11 | export 'src/model/enums.dart'; 12 | export 'src/model/icon.dart'; 13 | export 'src/model/initialization_settings.dart'; 14 | export 'src/model/location.dart'; 15 | export 'src/model/notification_details.dart'; 16 | export 'src/model/sound.dart'; 17 | export 'src/model/timeout.dart'; 18 | -------------------------------------------------------------------------------- /flutter_local_notifications_linux/lib/src/dbus_wrapper.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:dbus/dbus.dart'; 4 | 5 | /// Mockable [DBusRemoteObject] wrapper 6 | class DBusWrapper { 7 | late final DBusRemoteObject _object; 8 | late final String _destination; 9 | 10 | /// Build an instance of [DBusRemoteObject] 11 | void build({ 12 | required String destination, 13 | required String path, 14 | }) { 15 | _destination = destination; 16 | _object = DBusRemoteObject( 17 | DBusClient.session(), 18 | name: destination, 19 | path: DBusObjectPath(path), 20 | ); 21 | } 22 | 23 | /// Invokes a method on this [DBusRemoteObject]. 24 | /// Throws [DBusMethodResponseException] if the remote side returns an error. 25 | /// 26 | /// If [replySignature] is provided this causes this method to throw a 27 | /// [DBusReplySignatureException] if the result is successful but the returned 28 | /// values do not match the provided signature. 29 | Future callMethod( 30 | String? interface, 31 | String name, 32 | Iterable values, { 33 | DBusSignature? replySignature, 34 | bool noReplyExpected = false, 35 | bool noAutoStart = false, 36 | bool allowInteractiveAuthorization = false, 37 | }) => 38 | _object.callMethod( 39 | interface, 40 | name, 41 | values, 42 | replySignature: replySignature, 43 | noReplyExpected: noReplyExpected, 44 | noAutoStart: noAutoStart, 45 | allowInteractiveAuthorization: allowInteractiveAuthorization, 46 | ); 47 | 48 | /// Creates a stream of signal with the given [name]. 49 | DBusRemoteObjectSignalStream subscribeSignal(String name) => 50 | DBusRemoteObjectSignalStream( 51 | object: _object, interface: _destination, name: name); 52 | } 53 | -------------------------------------------------------------------------------- /flutter_local_notifications_linux/lib/src/file_system.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | /// Mockable file system representation 4 | // ignore: one_member_abstracts 5 | abstract class FileSystem { 6 | /// Returns a [File], that referred to the given [path] 7 | File open(String path); 8 | } 9 | 10 | /// A real implementation of [FileSystem] 11 | class LocalFileSystem implements FileSystem { 12 | @override 13 | File open(String path) => File(path); 14 | } 15 | -------------------------------------------------------------------------------- /flutter_local_notifications_linux/lib/src/model/initialization_settings.dart: -------------------------------------------------------------------------------- 1 | import 'icon.dart'; 2 | import 'sound.dart'; 3 | 4 | /// Plugin initialization settings for Linux. 5 | class LinuxInitializationSettings { 6 | /// Constructs an instance of [LinuxInitializationSettings] 7 | const LinuxInitializationSettings({ 8 | required this.defaultActionName, 9 | this.defaultIcon, 10 | this.defaultSound, 11 | this.defaultSuppressSound = false, 12 | }); 13 | 14 | /// Name of the default action (usually triggered by clicking 15 | /// the notification). 16 | /// The name can be anything, though implementations are free not to 17 | /// display it. 18 | final String defaultActionName; 19 | 20 | /// Specifies the default icon for notifications. 21 | final LinuxNotificationIcon? defaultIcon; 22 | 23 | /// Specifies the default sound for notifications. 24 | /// Typical value is `ThemeLinuxSound('message')` 25 | final LinuxNotificationSound? defaultSound; 26 | 27 | /// Causes the server to suppress playing any sounds, if it has that ability. 28 | /// This is usually set when the client itself is going to play its own sound. 29 | final bool defaultSuppressSound; 30 | } 31 | -------------------------------------------------------------------------------- /flutter_local_notifications_linux/lib/src/model/location.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | 3 | /// Represents the location on the screen that the notification should point to. 4 | @immutable 5 | class LinuxNotificationLocation { 6 | /// Constructs an instance of [LinuxNotificationLocation] 7 | const LinuxNotificationLocation(this.x, this.y); 8 | 9 | /// Represents the `X` location on the screen that the notification 10 | /// should point to. 11 | final int x; 12 | 13 | /// Represents the `Y` location on the screen that the notification 14 | /// should point to. 15 | final int y; 16 | 17 | /// Creates a copy of this object, 18 | /// but with the given fields replaced with the new values. 19 | LinuxNotificationLocation copyWith({ 20 | int? x, 21 | int? y, 22 | }) => 23 | LinuxNotificationLocation(x ?? this.x, y ?? this.y); 24 | 25 | @override 26 | bool operator ==(Object other) { 27 | if (identical(this, other)) { 28 | return true; 29 | } 30 | 31 | return other is LinuxNotificationLocation && other.x == x && other.y == y; 32 | } 33 | 34 | @override 35 | int get hashCode => x.hashCode ^ y.hashCode; 36 | 37 | @override 38 | String toString() => 'LinuxNotificationLocation(x: $x, y: $y)'; 39 | } 40 | -------------------------------------------------------------------------------- /flutter_local_notifications_linux/lib/src/model/sound.dart: -------------------------------------------------------------------------------- 1 | import 'enums.dart'; 2 | 3 | /// Represents Linux notification sound. 4 | abstract class LinuxNotificationSound { 5 | /// Implementation-defined sound content. 6 | Object get content; 7 | 8 | /// Defines the type of sound. 9 | LinuxSoundType get type; 10 | } 11 | 12 | /// Represents a sound from the Flutter Assets directory. 13 | class AssetsLinuxSound extends LinuxNotificationSound { 14 | /// Constructs an instance of [AssetsLinuxSound]. 15 | AssetsLinuxSound(this.relativePath); 16 | 17 | @override 18 | Object get content => relativePath; 19 | 20 | @override 21 | LinuxSoundType get type => LinuxSoundType.assets; 22 | 23 | /// Sound relative path inside the Flutter Assets directory 24 | final String relativePath; 25 | } 26 | 27 | /// Represents a system theme sound. 28 | /// See https://www.freedesktop.org/wiki/Specifications/sound-theme-spec/ for more help. 29 | class ThemeLinuxSound extends LinuxNotificationSound { 30 | /// Constructs an instance of [ThemeLinuxSound]. 31 | ThemeLinuxSound(this.name); 32 | 33 | @override 34 | Object get content => name; 35 | 36 | @override 37 | LinuxSoundType get type => LinuxSoundType.theme; 38 | 39 | /// A themeable named sound from the 40 | /// freedesktop.org sound naming specification http://0pointer.de/public/sound-naming-spec.html 41 | final String name; 42 | } 43 | -------------------------------------------------------------------------------- /flutter_local_notifications_linux/lib/src/model/timeout.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | 3 | /// The timeout of the Linux notification. 4 | @immutable 5 | class LinuxNotificationTimeout { 6 | /// Constructs an instance of [LinuxNotificationTimeout] 7 | /// with a given [value] in milliseconds. 8 | const LinuxNotificationTimeout(this.value); 9 | 10 | /// Constructs an instance of [LinuxNotificationTimeout] 11 | /// with a given [Duration] value. 12 | LinuxNotificationTimeout.fromDuration(Duration duration) 13 | : value = duration.inMilliseconds; 14 | 15 | /// Constructs an instance of [LinuxNotificationTimeout] 16 | /// with a [value] equal to `-1`. 17 | /// The system default timeout value will be used. 18 | const LinuxNotificationTimeout.systemDefault() : value = -1; 19 | 20 | /// Constructs an instance of [LinuxNotificationTimeout] 21 | /// with a [value] equal to `0`. The notification will be never expires. 22 | const LinuxNotificationTimeout.expiresNever() : value = 0; 23 | 24 | /// The integer representation in milliseconds. 25 | final int value; 26 | 27 | @override 28 | bool operator ==(Object other) { 29 | if (identical(this, other)) { 30 | return true; 31 | } 32 | 33 | return other is LinuxNotificationTimeout && other.value == value; 34 | } 35 | 36 | @override 37 | int get hashCode => value.hashCode; 38 | 39 | @override 40 | String toString() => 'LinuxNotificationTimeout(value: $value)'; 41 | } 42 | -------------------------------------------------------------------------------- /flutter_local_notifications_linux/lib/src/posix.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ffi' as ffi; 2 | 3 | /// Represents Linux POSIX calls. 4 | class Posix { 5 | /// Constructs an instance of [Posix]. 6 | Posix() { 7 | final ffi.DynamicLibrary _dylib = ffi.DynamicLibrary.open('libc.so.6'); 8 | getpid = _dylib 9 | .lookup>('getpid') 10 | .asFunction(); 11 | getsid = _dylib 12 | .lookup>('getsid') 13 | .asFunction(); 14 | getuid = _dylib 15 | .lookup>('getuid') 16 | .asFunction(); 17 | } 18 | 19 | /// Get the process ID of the calling process. 20 | late final int Function() getpid; 21 | 22 | /// Return the session ID of the given process. 23 | late final int Function(int pid) getsid; 24 | 25 | /// Get the real user ID of the calling process. 26 | late final int Function() getuid; 27 | } 28 | -------------------------------------------------------------------------------- /flutter_local_notifications_linux/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_local_notifications_linux 2 | description: Linux implementation of the flutter_local_notifications plugin 3 | version: 6.0.0 4 | homepage: https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications 5 | issue_tracker: https://github.com/MaikuB/flutter_local_notifications/issues 6 | 7 | flutter: 8 | plugin: 9 | implements: flutter_local_notifications 10 | platforms: 11 | linux: 12 | dartPluginClass: LinuxFlutterLocalNotificationsPlugin 13 | 14 | 15 | dependencies: 16 | dbus: ^0.7.8 17 | ffi: ^2.0.1 18 | flutter: 19 | sdk: flutter 20 | flutter_local_notifications_platform_interface: ^9.0.0 21 | path: ^1.8.0 22 | xdg_directories: ">=0.2.0+1 <2.0.0" 23 | 24 | dev_dependencies: 25 | build_runner: ^2.3.3 26 | flutter_test: 27 | sdk: flutter 28 | mockito: ^5.3.2 29 | 30 | environment: 31 | sdk: ^3.4.0 32 | flutter: ">=3.22.0" 33 | -------------------------------------------------------------------------------- /flutter_local_notifications_linux/test/posix_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter_local_notifications_linux/src/posix.dart'; 4 | import 'package:flutter_test/flutter_test.dart'; 5 | 6 | void main() { 7 | group('POSIX |', () { 8 | late Posix posix; 9 | 10 | setUpAll(() { 11 | posix = Posix(); 12 | }); 13 | 14 | test('getpid', () { 15 | expect(posix.getpid(), equals(pid)); 16 | }); 17 | }, skip: !Platform.isLinux); 18 | } 19 | -------------------------------------------------------------------------------- /flutter_local_notifications_platform_interface/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | build/ 32 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 76 | -------------------------------------------------------------------------------- /flutter_local_notifications_platform_interface/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 27321ebbad34b0a3fafe99fac037102196d655ff 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /flutter_local_notifications_platform_interface/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 Michael Bui. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of the copyright holder nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /flutter_local_notifications_platform_interface/README.md: -------------------------------------------------------------------------------- 1 | # flutter_local_notifications_platform_interface 2 | 3 | A common platform interface for the [`flutter_local_notifications`](https://pub.dev/packages/flutter_local_notifications) plugin. 4 | 5 | ## Usage 6 | 7 | Platform-specific implementations should extend from the `FlutterLocalNotificationsPlatform` class. Upon registering the plugin, the default implementation `FlutterLocalNotificationsPlatform` can be set by calling `FlutterLocalNotificationsPlatform.instance = MyFlutterLocalNotificationsPlatform()` where `MyFlutterLocalNotificationsPlatform()` represents the platform-specific implementation. 8 | -------------------------------------------------------------------------------- /flutter_local_notifications_platform_interface/lib/src/helpers.dart: -------------------------------------------------------------------------------- 1 | /// Helper method for validating notification IDs. 2 | /// 3 | /// Ensures IDs are valid 32-bit integers. 4 | void validateId(int id) { 5 | ArgumentError.checkNotNull(id, 'id'); 6 | if (id > 0x7FFFFFFF || id < -0x80000000) { 7 | throw ArgumentError.value(id, 'id', 8 | 'must fit within the size of a 32-bit integer i.e. in the range [-2^31, 2^31 - 1]'); // ignore: lines_longer_than_80_chars 9 | } 10 | } 11 | 12 | /// Helper method for validation repeat interval duration used passed 13 | /// to periodicallyShowWithDuration(). 14 | /// 15 | /// Ensures the duration is at least one minute. 16 | void validateRepeatDurationInterval(Duration repeatDurationInterval) { 17 | ArgumentError.checkNotNull(repeatDurationInterval, 'repeatDurationInterval'); 18 | if (repeatDurationInterval.inMinutes < 1) { 19 | throw ArgumentError.value(repeatDurationInterval, 'repeatDurationInterval', 20 | 'must be at one minute or more'); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /flutter_local_notifications_platform_interface/lib/src/typedefs.dart: -------------------------------------------------------------------------------- 1 | import 'types.dart'; 2 | 3 | /// Signature of callback triggered on main isolate when a user taps on a 4 | /// notification or a notification action. 5 | typedef DidReceiveNotificationResponseCallback = void Function( 6 | NotificationResponse details); 7 | 8 | /// Signature of callback triggered on background isolate when a user taps on a 9 | /// notification or a notification action. 10 | typedef DidReceiveBackgroundNotificationResponseCallback = void Function( 11 | NotificationResponse details); 12 | -------------------------------------------------------------------------------- /flutter_local_notifications_platform_interface/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_local_notifications_platform_interface 2 | description: A common platform interface for the flutter_local_notifications plugin. 3 | version: 9.0.0 4 | homepage: https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications_platform_interface 5 | issue_tracker: https://github.com/MaikuB/flutter_local_notifications/issues 6 | 7 | environment: 8 | sdk: ^3.4.0 9 | flutter: ">=3.22.0" 10 | 11 | dependencies: 12 | plugin_platform_interface: ^2.1.8 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | mockito: ^5.3.2 18 | -------------------------------------------------------------------------------- /flutter_local_notifications_platform_interface/test/flutter_local_notifications_platform_interface_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_local_notifications_platform_interface/flutter_local_notifications_platform_interface.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:mockito/mockito.dart'; 4 | import 'package:plugin_platform_interface/plugin_platform_interface.dart'; 5 | 6 | class FlutterLocalNotificationsPlatformMock extends Mock 7 | with MockPlatformInterfaceMixin 8 | implements FlutterLocalNotificationsPlatform {} 9 | 10 | class ImplementsFlutterLocalNotificationsPlatform extends Mock 11 | implements FlutterLocalNotificationsPlatform {} 12 | 13 | class ExtendsFlutterLocalNotificationsPlatform 14 | extends FlutterLocalNotificationsPlatform {} 15 | 16 | void main() { 17 | TestWidgetsFlutterBinding.ensureInitialized(); 18 | group('$FlutterLocalNotificationsPlatform', () { 19 | test('Cannot be implemented with `implements`', () { 20 | expect(() { 21 | FlutterLocalNotificationsPlatform.instance = 22 | ImplementsFlutterLocalNotificationsPlatform(); 23 | }, throwsAssertionError); 24 | }); 25 | 26 | test('Can be mocked with `implements`', () { 27 | final FlutterLocalNotificationsPlatformMock mock = 28 | FlutterLocalNotificationsPlatformMock(); 29 | FlutterLocalNotificationsPlatform.instance = mock; 30 | }); 31 | 32 | test('Can be extended', () { 33 | FlutterLocalNotificationsPlatform.instance = 34 | ExtendsFlutterLocalNotificationsPlatform(); 35 | }); 36 | }); 37 | } 38 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | build/ 30 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49" 8 | channel: "stable" 9 | 10 | project_type: plugin_ffi 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 17 | base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 18 | - platform: windows 19 | create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 20 | base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49 21 | 22 | # User provided section 23 | 24 | # List of Local paths (relative to this file) that should be 25 | # ignored by the migrate tool. 26 | # 27 | # Files that are not part of the templates will be ignored by default. 28 | unmanaged_files: 29 | - 'lib/main.dart' 30 | - 'ios/Runner.xcodeproj/project.pbxproj' 31 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.0.0] 2 | 3 | * Initial release for Windows. Thanks to PR [Levi Lesches](https://github.com/Levi-Lesches) that continued the work done initially done by [Kenneth](https://github.com/kennethnym) and [lightrabbit](https://github.com/lightrabbit) -------------------------------------------------------------------------------- /flutter_local_notifications_windows/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2024 Michael Bui. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of the copyright holder nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /flutter_local_notifications_windows/build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | if not exist build mkdir build 3 | cd build 4 | cmake ../windows 5 | cmake --build . 6 | cd .. 7 | copy build\shared\Debug\flutter_local_notifications_windows.dll . 8 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/dart_test.yaml: -------------------------------------------------------------------------------- 1 | platforms: [vm] 2 | test_on: windows 3 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/ffigen.yaml: -------------------------------------------------------------------------------- 1 | # Run with `dart run ffigen --config ffigen.yaml`. 2 | name: NotificationsPluginBindings 3 | description: | 4 | Bindings for `src/ffi_api.h`. 5 | 6 | Regenerate bindings with `dart run ffigen --config ffigen.yaml`. 7 | output: 'lib/src/ffi/bindings.dart' 8 | 9 | silence-enum-warning: true 10 | 11 | headers: 12 | entry-points: 13 | - 'src/ffi_api.h' 14 | include-directives: 15 | - 'src/ffi_api.h' 16 | 17 | preamble: | 18 | // ignore_for_file: always_specify_types 19 | // ignore_for_file: camel_case_types 20 | // ignore_for_file: non_constant_identifier_names 21 | 22 | comments: 23 | style: any 24 | length: full 25 | 26 | type-map: 27 | native-types: 28 | 'char': # Converts `char` to `Utf8` instead of `Char` 29 | 'lib': 'pkg_ffi' 30 | 'c-type': 'Utf8' 31 | 'dart-type': 'Utf8' 32 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/flutter_local_notifications_windows.dart: -------------------------------------------------------------------------------- 1 | export 'src/details.dart'; 2 | export 'src/msix/stub.dart' if (dart.library.ffi) 'src/msix/ffi.dart'; 3 | export 'src/plugin/stub.dart' if (dart.library.ffi) 'src/plugin/ffi.dart'; 4 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details.dart: -------------------------------------------------------------------------------- 1 | export 'details/initialization_settings.dart'; 2 | export 'details/notification_action.dart'; 3 | export 'details/notification_audio.dart'; 4 | export 'details/notification_details.dart'; 5 | export 'details/notification_header.dart'; 6 | export 'details/notification_input.dart'; 7 | export 'details/notification_parts.dart'; 8 | export 'details/notification_progress.dart'; 9 | export 'details/notification_row.dart'; 10 | 11 | /// The result of updating a notification. 12 | enum NotificationUpdateResult { 13 | /// The update was successful. 14 | success, 15 | 16 | /// There was an unexpected error updating the notification. 17 | error, 18 | 19 | /// No notification with the provided ID could be found. 20 | notFound, 21 | } 22 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details/initialization_settings.dart: -------------------------------------------------------------------------------- 1 | /// Plugin initialization settings for Windows. 2 | class WindowsInitializationSettings { 3 | /// Creates a new settings object for initializing this plugin on Windows. 4 | const WindowsInitializationSettings({ 5 | required this.appName, 6 | required this.appUserModelId, 7 | required this.guid, 8 | this.iconPath, 9 | }); 10 | 11 | /// The name of the app that should be shown in the notification toast. 12 | final String appName; 13 | 14 | /// The unique app user model ID that identifies the app, 15 | /// in the form of CompanyName.ProductName.SubProduct.VersionInformation. 16 | /// 17 | /// See https://docs.microsoft.com/en-us/windows/win32/shell/appids 18 | /// for more information. 19 | final String appUserModelId; 20 | 21 | /// The GUID that identifies the notification activation callback. 22 | final String guid; 23 | 24 | /// The path to the icon of the notification. 25 | final String? iconPath; 26 | } 27 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details/notification_header.dart: -------------------------------------------------------------------------------- 1 | /// Decides how the application will open when the header is pressed. 2 | enum WindowsHeaderActivation { 3 | /// Opens the app in the foreground. 4 | foreground, 5 | 6 | /// Opens any app using a custom protocol. 7 | protocol, 8 | } 9 | 10 | /// A header that groups multiple Windows notifications. 11 | class WindowsHeader { 12 | /// Creates a Windows header. 13 | const WindowsHeader({ 14 | required this.id, 15 | required this.title, 16 | required this.arguments, 17 | this.activation, 18 | }); 19 | 20 | /// A unique ID for this header. 21 | final String id; 22 | 23 | /// The title of the header. 24 | final String title; 25 | 26 | /// An application-defined payload that will be passed back when pressed. 27 | final String arguments; 28 | 29 | /// Specifies how the application will open. 30 | final WindowsHeaderActivation? activation; 31 | } 32 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details/notification_progress.dart: -------------------------------------------------------------------------------- 1 | import '../../flutter_local_notifications_windows.dart'; 2 | 3 | /// A progress bar in a Windows notification. 4 | /// 5 | /// To update the progress after the notification has been shown, 6 | /// use [FlutterLocalNotificationsWindows.updateProgressBar]. 7 | class WindowsProgressBar { 8 | /// Creates a progress bar for a Windows notification. 9 | WindowsProgressBar({ 10 | required this.id, 11 | required this.status, 12 | required this.value, 13 | this.title, 14 | this.label, 15 | }); 16 | 17 | /// A unique ID for this progress bar. 18 | final String id; 19 | 20 | /// An optional title. 21 | final String? title; 22 | 23 | /// Describes what's happening, like `Downloading...` or `Installing...` 24 | final String status; 25 | 26 | /// The value of the progress, from 0.0 to 1.0. 27 | /// 28 | /// Setting this to null indicates a indeterminate progress bar. 29 | double? value; 30 | 31 | /// Overrides the default reading as a percent with a different text. 32 | /// 33 | /// Useful for indicating discrete progress, like `3/10` instead of `30%`. 34 | String? label; 35 | } 36 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details/notification_row.dart: -------------------------------------------------------------------------------- 1 | import 'notification_parts.dart'; 2 | 3 | /// A group of notification content that must be displayed as a whole row. 4 | /// 5 | /// See: https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-group 6 | class WindowsRow { 7 | /// Makes a group of multiple columns. 8 | const WindowsRow(this.columns); 9 | 10 | /// The different columns being grouped together. 11 | final List columns; 12 | } 13 | 14 | /// A vertical column of text and images in a Windows notification. 15 | class WindowsColumn { 16 | /// A const constructor. 17 | const WindowsColumn(this.parts); 18 | 19 | /// A list of text or images in this column. 20 | final List parts; 21 | } 22 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details/notification_to_xml.dart: -------------------------------------------------------------------------------- 1 | import 'package:xml/xml.dart'; 2 | 3 | import '../../flutter_local_notifications_windows.dart'; 4 | import 'xml/details.dart'; 5 | 6 | export 'xml/progress.dart'; 7 | 8 | /// Converts a notification with [WindowsNotificationDetails] into XML. 9 | /// 10 | /// For more details, refer to the [Toast Notification XML schema](https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/schema-root). 11 | String notificationToXml({ 12 | String? title, 13 | String? body, 14 | String? payload, 15 | WindowsNotificationDetails? details, 16 | }) { 17 | final XmlBuilder builder = XmlBuilder(); 18 | builder.element( 19 | 'toast', 20 | attributes: { 21 | ...details?.attributes ?? {}, 22 | if (payload != null) 'launch': payload, 23 | if (details?.scenario == null) 'useButtonStyle': 'true', 24 | }, 25 | nest: () { 26 | builder.element( 27 | 'visual', 28 | nest: () { 29 | builder.element( 30 | 'binding', 31 | attributes: {'template': 'ToastGeneric'}, 32 | nest: () { 33 | builder 34 | ..element('text', nest: title) 35 | ..element('text', nest: body); 36 | details?.generateBinding(builder); 37 | }, 38 | ); 39 | }, 40 | ); 41 | details?.buildXml(builder); 42 | }, 43 | ); 44 | return builder 45 | .buildDocument() 46 | .toXmlString(pretty: true, indentAttribute: (_) => true); 47 | } 48 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details/xml/action.dart: -------------------------------------------------------------------------------- 1 | import 'package:xml/xml.dart'; 2 | import '../notification_action.dart'; 3 | 4 | /// Converts a [WindowsAction] to XML 5 | extension ActionToXml on WindowsAction { 6 | /// Serializes this notification action as Windows-compatible XML. 7 | /// 8 | /// See: https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-action#syntax 9 | void buildXml(XmlBuilder builder) { 10 | builder.element( 11 | 'action', 12 | attributes: { 13 | 'content': content, 14 | 'arguments': arguments, 15 | 'activationType': activationType.name, 16 | 'afterActivationBehavior': activationBehavior.name, 17 | if (placement != null) 'placement': placement!.name, 18 | if (imageUri != null) 'imageUri': imageUri!.toString(), 19 | if (inputId != null) 'hint-inputId': inputId!, 20 | if (buttonStyle != null) 'hint-buttonStyle': buttonStyle!.name, 21 | if (tooltip != null) 'hint-toolTip': tooltip!, 22 | }, 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details/xml/audio.dart: -------------------------------------------------------------------------------- 1 | import 'package:xml/xml.dart'; 2 | import '../notification_audio.dart'; 3 | 4 | /// Converts a [WindowsNotificationAudio] to XML 5 | extension AudioToXml on WindowsNotificationAudio { 6 | /// Serializes this audio to Windows-compatible XML. 7 | /// 8 | /// See: https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-audio 9 | void buildXml(XmlBuilder builder) => builder.element( 10 | 'audio', 11 | attributes: { 12 | 'src': source, 13 | 'silent': isSilent.toString(), 14 | 'loop': shouldLoop.toString(), 15 | }, 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details/xml/header.dart: -------------------------------------------------------------------------------- 1 | import 'package:xml/xml.dart'; 2 | 3 | import '../notification_header.dart'; 4 | 5 | /// Converts a [WindowsHeader] to XML 6 | extension HeaderToXml on WindowsHeader { 7 | /// Serializes this header to XML. 8 | /// 9 | /// See: https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-header 10 | void buildXml(XmlBuilder builder) => builder.element( 11 | 'header', 12 | attributes: { 13 | 'id': id, 14 | 'title': title, 15 | 'arguments': arguments, 16 | if (activation != null) 'activationType': activation!.name, 17 | }, 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details/xml/image.dart: -------------------------------------------------------------------------------- 1 | import 'package:xml/xml.dart'; 2 | 3 | import '../notification_parts.dart'; 4 | 5 | /// Converts a [WindowsImage] to XML 6 | extension ImageToXml on WindowsImage { 7 | /// Serializes this image to Windows-compatible XML. 8 | /// 9 | /// See: https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-image 10 | void buildXml(XmlBuilder builder) { 11 | builder.element( 12 | 'image', 13 | attributes: { 14 | 'src': uri.toString(), 15 | 'alt': altText, 16 | 'addImageQuery': addQueryParams.toString(), 17 | if (placement != null) 'placement': placement!.name, 18 | if (crop != null) 'hint-crop': crop!.name, 19 | }, 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details/xml/input.dart: -------------------------------------------------------------------------------- 1 | import 'package:xml/xml.dart'; 2 | 3 | import '../notification_input.dart'; 4 | 5 | /// Converts a [WindowsTextInput] to XML 6 | extension TextInputToXml on WindowsTextInput { 7 | /// Serializes this input to Windows-compatible XML. 8 | /// 9 | /// See: https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-input 10 | void buildXml(XmlBuilder builder) => builder.element( 11 | 'input', 12 | attributes: { 13 | 'id': id, 14 | 'type': type.name, 15 | if (title != null) 'title': title!, 16 | if (placeHolderContent != null) 17 | 'placeHolderContent': placeHolderContent!, 18 | }, 19 | ); 20 | } 21 | 22 | /// Converts a [WindowsSelectionInput] to XML 23 | extension SelectionInputToXml on WindowsSelectionInput { 24 | /// Serializes this input to Windows-compatible XML. 25 | /// 26 | /// See: https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-input 27 | void buildXml(XmlBuilder builder) => builder.element( 28 | 'input', 29 | attributes: { 30 | 'id': id, 31 | 'type': type.name, 32 | if (title != null) 'title': title!, 33 | if (defaultItem != null) 'defaultInput': defaultItem!, 34 | }, 35 | nest: () { 36 | for (final WindowsSelection item in items) { 37 | item.buildXml(builder); 38 | } 39 | }, 40 | ); 41 | } 42 | 43 | /// Converts a [WindowsSelection] to XML 44 | extension SelectionToXml on WindowsSelection { 45 | /// Serializes this selection to Windows-compatible XML. 46 | /// 47 | /// See: https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-selection 48 | void buildXml(XmlBuilder builder) => builder.element( 49 | 'selection', 50 | attributes: { 51 | 'id': id, 52 | 'content': content, 53 | }, 54 | ); 55 | } 56 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details/xml/progress.dart: -------------------------------------------------------------------------------- 1 | import 'package:xml/xml.dart'; 2 | 3 | import '../notification_progress.dart'; 4 | 5 | /// Converts a [WindowsProgressBar] to XML 6 | extension ProgressBarToXml on WindowsProgressBar { 7 | /// Serializes this progress bar to Windows-compatible XML. 8 | /// 9 | /// See: https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-progress 10 | void buildXml(XmlBuilder builder) => builder.element( 11 | 'progress', 12 | attributes: { 13 | 'status': status, 14 | 'value': '{$id-progressValue}', 15 | if (title != null) 'title': title!, 16 | if (label != null) 'valueStringOverride': '{$id-progressString}', 17 | }, 18 | ); 19 | 20 | /// The data bindings for this progress bar. 21 | /// 22 | /// To support dynamic updates, [buildXml] will inject placeholder strings 23 | /// called data bindings instead of actual values. This can then be updated 24 | /// dynamically later by calling 25 | /// [FlutterLocalNotificationsWindows.updateProgressBar]. 26 | Map get data => { 27 | '$id-progressValue': value?.toString() ?? 'indeterminate', 28 | if (label != null) '$id-progressString': label!, 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details/xml/row.dart: -------------------------------------------------------------------------------- 1 | import 'package:xml/xml.dart'; 2 | 3 | import '../notification_parts.dart'; 4 | import '../notification_row.dart'; 5 | 6 | import 'image.dart'; 7 | import 'text.dart'; 8 | 9 | /// Converts a [WindowsRow] to XML 10 | extension RowToXml on WindowsRow { 11 | /// Serializes this group to XML. 12 | /// 13 | /// See: https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-group 14 | void buildXml(XmlBuilder builder) => builder.element( 15 | 'group', 16 | nest: () { 17 | for (final WindowsColumn column in columns) { 18 | builder.element( 19 | 'subgroup', 20 | attributes: {'hint-weight': '1'}, 21 | nest: () { 22 | for (final WindowsNotificationPart part in column.parts) { 23 | switch (part) { 24 | case WindowsImage(): 25 | part.buildXml(builder); 26 | case WindowsNotificationText(): 27 | part.buildXml(builder); 28 | } 29 | } 30 | }, 31 | ); 32 | } 33 | }, 34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/details/xml/text.dart: -------------------------------------------------------------------------------- 1 | import 'package:xml/xml.dart'; 2 | 3 | import '../notification_parts.dart'; 4 | 5 | /// Converts a [WindowsNotificationText] to XML 6 | extension TextToXml on WindowsNotificationText { 7 | /// Serializes this text to Windows-compatible XML. 8 | /// 9 | /// See: https://learn.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-text 10 | void buildXml(XmlBuilder builder) => builder.element( 11 | 'text', 12 | attributes: { 13 | if (languageCode != null) 'lang': languageCode!, 14 | if (placement != null) 'placement': placement!.name, 15 | 'hint-callScenarioCenterAlign': centerIfCall.toString(), 16 | 'hint-align': 'center', 17 | if (isCaption) 'hint-style': 'captionsubtle', 18 | }, 19 | nest: text, 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/lib/src/msix/stub.dart: -------------------------------------------------------------------------------- 1 | import '../../flutter_local_notifications_windows.dart'; 2 | 3 | /// Helpful methods to support MSIX and package identity. 4 | class MsixUtils { 5 | /// Returns whether the current app was installed with an MSIX installer. 6 | /// 7 | /// Using an MSIX grants your application [package identity](https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/package-identity-overview), 8 | /// which allows it to use [certain APIs](https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/modernize-packaged-apps). 9 | /// 10 | /// Specifically, using an MSIX installer allows your app to: 11 | /// - use [FlutterLocalNotificationsWindows.getActiveNotifications] 12 | /// - use [FlutterLocalNotificationsWindows.cancel] 13 | /// - use custom files for notification sounds 14 | /// - use network sources for notifications 15 | /// - use `ms-appx:///` URIs for resources 16 | /// 17 | /// These functions will simply do nothing or return empty data in apps 18 | /// without package identity. Additionally: 19 | /// - [WindowsImage.getAssetUri] will return a `file:///` or `ms-appx:///` URI, 20 | /// depending on whether the app is running in debug, release, or as an MSIX. 21 | /// - [WindowsNotificationAudio.asset] takes an audio file to use for apps 22 | /// with package identity, and a preset fallbacks for apps without. 23 | static bool hasPackageIdentity() => false; // platforms without FFI 24 | 25 | /// Gets an `ms-appx:///` URI from a [Flutter asset](https://docs.flutter.dev/ui/assets/assets-and-images). 26 | static Uri getAssetUri(String path) => 27 | Uri.parse('ms-appx:///data/flutter_assets/$path'); 28 | } 29 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_local_notifications_windows 2 | description: Windows implementation of the flutter_local_notifications plugin 3 | version: 1.0.0 4 | homepage: https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications_windows 5 | issue_tracker: https://github.com/MaikuB/flutter_local_notifications/issues 6 | 7 | environment: 8 | sdk: ^3.4.0 9 | flutter: ">=3.22.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | ffi: ^2.1.2 15 | flutter_local_notifications_platform_interface: ^9.0.0 16 | meta: ^1.11.0 17 | timezone: ^0.10.0 18 | xml: ^6.5.0 19 | 20 | dev_dependencies: 21 | ffigen: ^13.0.0 22 | test: ^1.25.2 23 | 24 | flutter: 25 | plugin: 26 | implements: flutter_local_notifications 27 | platforms: 28 | windows: 29 | ffiPlugin: true 30 | dartPluginClass: FlutterLocalNotificationsWindows 31 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/src/.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: GNU 2 | AlignAfterOpenBracket: BlockIndent 3 | AlignConsecutiveDeclarations: None 4 | AlignOperands: DontAlign 5 | AllowAllParametersOfDeclarationOnNextLine: false 6 | AllowAllArgumentsOnNextLine: false 7 | AllowShortBlocksOnASingleLine: false 8 | AllowShortCaseLabelsOnASingleLine: true 9 | AllowShortFunctionsOnASingleLine: All 10 | AllowShortIfStatementsOnASingleLine: WithoutElse 11 | AllowShortLoopsOnASingleLine: true 12 | AlwaysBreakAfterDefinitionReturnType: None 13 | AlwaysBreakAfterReturnType: None 14 | BreakBeforeBraces: Attach 15 | # This requires a newer clang-format 16 | # BinPackParameters: AlwaysOnePerLine 17 | BreakBeforeTernaryOperators: true 18 | BreakBeforeBinaryOperators: NonAssignment 19 | BreakConstructorInitializers: AfterColon 20 | BreakInheritanceList: AfterColon 21 | ColumnLimit: 100 22 | ContinuationIndentWidth: 2 23 | Cpp11BracedListStyle: true 24 | KeepEmptyLinesAtTheStartOfBlocks: false 25 | Language: Cpp 26 | MaxEmptyLinesToKeep: 1 27 | NamespaceIndentation: All 28 | PenaltyExcessCharacter: 200 29 | PenaltyReturnTypeOnItsOwnLine: 1000 30 | PointerAlignment: Left 31 | QualifierAlignment: Left 32 | SortIncludes: false 33 | SpaceAfterCStyleCast: true 34 | SpaceBeforeCpp11BracedList: true 35 | SpaceBeforeInheritanceColon: true 36 | SpacesBeforeTrailingComments: 2 37 | SpaceBeforeParens: ControlStatements 38 | SpacesInContainerLiterals: false 39 | Standard: Cpp11 40 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The Flutter tooling requires that developers have CMake 3.10 or later 2 | # installed. You should not increase this version, as doing so will cause 3 | # the plugin to fail to compile for some customers of the plugin. 4 | cmake_minimum_required(VERSION 3.10) 5 | 6 | project(flutter_local_notifications_windows_library VERSION 1.0.0 LANGUAGES CXX) 7 | 8 | add_library(flutter_local_notifications_windows SHARED 9 | "ffi_api.cpp" 10 | "plugin.cpp" 11 | "utils.cpp" 12 | ) 13 | 14 | target_compile_features(flutter_local_notifications_windows PRIVATE cxx_std_17) 15 | 16 | set_target_properties(flutter_local_notifications_windows PROPERTIES 17 | PUBLIC_HEADER ffi_api.h 18 | OUTPUT_NAME "flutter_local_notifications_windows" 19 | ) 20 | 21 | target_compile_definitions(flutter_local_notifications_windows PUBLIC DART_SHARED_LIB) 22 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/src/plugin.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include // <-- This must be the first Windows header 7 | #include 8 | 9 | #include "ffi_api.h" 10 | 11 | using std::optional; 12 | using std::string; 13 | using namespace winrt::Windows::UI::Notifications; 14 | 15 | /// The C++ container object for WinRT handles. 16 | /// 17 | /// Note that this must be a struct as it was forward-declared as a struct in 18 | /// `ffi_api.h`, which cannot use classes as it must be C-compatible. 19 | struct NativePlugin { 20 | /// Whether the plugin has been properly initialized. 21 | bool isReady = false; 22 | 23 | /// Whether the current application has package identity (ie, was packaged with an MSIX). 24 | /// 25 | /// See [hasPackageIdentity]. 26 | bool hasIdentity = false; 27 | 28 | /// The app user model ID. Used instead of package identity when [hasIdentity] is false. 29 | /// 30 | /// For more details, see https://learn.microsoft.com/en-us/windows/win32/shell/appids 31 | winrt::hstring aumid; 32 | 33 | /// The API responsible for showing notifications. Null if [isReady] is false. 34 | optional notifier; 35 | 36 | /// The API responsible for querying shown notifications. Null if [isReady] is false. 37 | optional history; 38 | 39 | /// A callback to run when a notification is pressed, when the app is or is not running. 40 | NativeNotificationCallback callback; 41 | 42 | NativePlugin() {} 43 | ~NativePlugin() {} 44 | 45 | /// Registers the given [callback] to run when a notification is pressed. 46 | bool registerApp( 47 | const string& aumid, const string& appName, const string& guid, 48 | const optional& iconPath, NativeNotificationCallback callback 49 | ); 50 | }; 51 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/src/utils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include // <-- This must be the first Windows header 7 | #include 8 | #include 9 | #include 10 | 11 | #include "ffi_api.h" 12 | 13 | using std::string; 14 | using std::vector; 15 | using namespace winrt::Windows::UI::Notifications; 16 | 17 | /// Allocates and returns a char array representing the original C++ string. 18 | char* toNativeString(string str); 19 | 20 | /// Allocates and returns a [NativeStringMap] with the given key-value pairs. 21 | NativeStringMap toNativeMap(vector entries); 22 | 23 | /// Parses a [NativeStringMap] into a WinRT [NotificationData]. 24 | NotificationData dataFromMap(NativeStringMap map); 25 | 26 | winrt::guid parseGuid(const std::string& guidString); 27 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/test/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications_windows/test/icon.png -------------------------------------------------------------------------------- /flutter_local_notifications_windows/test/scheduled_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_local_notifications_windows/flutter_local_notifications_windows.dart'; 2 | import 'package:test/test.dart'; 3 | import 'package:timezone/data/latest_all.dart'; 4 | import 'package:timezone/standalone.dart'; 5 | 6 | const WindowsInitializationSettings settings = WindowsInitializationSettings( 7 | appName: 'Test app', 8 | appUserModelId: 'com.test.test', 9 | guid: 'a8c22b55-049e-422f-b30f-863694de08c8'); 10 | 11 | void main() => group('Schedules', () { 12 | final FlutterLocalNotificationsWindows plugin = 13 | FlutterLocalNotificationsWindows(); 14 | setUpAll(initializeTimeZones); 15 | setUpAll(() => plugin.initialize(settings)); 16 | tearDownAll(() async { 17 | await plugin.cancelAll(); 18 | plugin.dispose(); 19 | }); 20 | 21 | Future countPending() async => 22 | (await plugin.pendingNotificationRequests()).length; 23 | late final Location location = getLocation('US/Eastern'); 24 | 25 | test('do not work with earlier time', () async { 26 | final TZDateTime now = TZDateTime.now(location); 27 | final TZDateTime earlier = now.subtract(const Duration(days: 1)); 28 | await plugin.cancelAll(); 29 | expect(await countPending(), 0); 30 | expect(plugin.zonedSchedule(302, null, null, now, null), 31 | throwsArgumentError); 32 | expect(plugin.zonedSchedule(302, null, null, earlier, null), 33 | throwsArgumentError); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/test/sound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/flutter_local_notifications_windows/test/sound.mp3 -------------------------------------------------------------------------------- /flutter_local_notifications_windows/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /flutter_local_notifications_windows/windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The Flutter tooling requires that developers have a version of Visual Studio 2 | # installed that includes CMake 3.14 or later. You should not increase this 3 | # version, as doing so will cause the plugin to fail to compile for some 4 | # customers of the plugin. 5 | cmake_minimum_required(VERSION 3.14) 6 | 7 | # Project-level configuration. 8 | set(PROJECT_NAME "flutter_local_notifications_windows") 9 | project(${PROJECT_NAME} LANGUAGES CXX) 10 | 11 | # Invoke the build for native code shared with the other target platforms. 12 | # This can be changed to accommodate different builds. 13 | add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../src" "${CMAKE_CURRENT_BINARY_DIR}/shared") 14 | 15 | # List of absolute paths to libraries that should be bundled with the plugin. 16 | # This list could contain prebuilt libraries, or libraries created by an 17 | # external build triggered from this build file. 18 | set(flutter_local_notifications_windows_bundled_libraries 19 | # Defined in ../src/CMakeLists.txt. 20 | # This can be changed to accommodate different builds. 21 | $ 22 | PARENT_SCOPE 23 | ) 24 | -------------------------------------------------------------------------------- /images/android_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/images/android_notification.png -------------------------------------------------------------------------------- /images/gnome_linux_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/images/gnome_linux_notification.png -------------------------------------------------------------------------------- /images/ios_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/images/ios_notification.png -------------------------------------------------------------------------------- /images/kde_linux_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/images/kde_linux_notification.png -------------------------------------------------------------------------------- /images/macos_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/images/macos_notification.png -------------------------------------------------------------------------------- /images/windows_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MaikuB/flutter_local_notifications/f1e18cc9357730fb3e83fbd687ffccd2036ef354/images/windows_notification.png -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_local_notifications_workspace 2 | 3 | environment: 4 | sdk: '>=3.0.0 <4.0.0' 5 | dev_dependencies: 6 | melos: ^6.1.0 7 | --------------------------------------------------------------------------------