Skip to content

Notifications #516

Description

@bitmvk

Please Describe The Problem To Be Solved

I want a way to send notifications to the user for example when the app is minimized.

Activity

  1. ndonkoHenri commented on Oct 24, 2022

    @ndonkoHenri
    Contributor
  2. ZenaMel commented on Nov 4, 2022

    @ZenaMel

    somewhat related to #547

  3. adampiskorski commented on Nov 30, 2022

    @adampiskorski

    Another package, but this one seems to promise all the same platforms as Flet: https://pub.dev/packages/awesome_notifications, but it seems to require firebase.

    I think it may end up being the best to implement notifications yourself in a flutter app that loads flet (https://pub.dev/packages/flet), simply because of the complications caused by each platform, I'm not sure how maintainable and up-to-date an integrated flet solution will be

  4. ndonkoHenri commented on Jun 1, 2023

    @ndonkoHenri
    Contributor
  5. arthurbarros commented on Mar 8, 2024

    @arthurbarros

    Article: https://medium.com/@ndonkohenri/sending-desktop-notifications-in-python-flet-97f0834f993d

    Repo: https://github.com/ndonkoHenri/Python-Desktop-Notifications

    Hope it helps while waiting for a native solution.

    I have come across these links in some Google searches, plyer is a good candidate to solve the problem, what is not clear is how to integrate it with flet. In the test I did, at the moment I execute the notification, the application is closed on the Android emulator.

  6. Heoder commented on Mar 14, 2024

    @Heoder

    me too

  7. Heoder commented on Mar 15, 2024

    @Heoder

    Some (possibly) useful links:

    https://pub.dev/packages/flutter_local_notifications

    https://pub.dev/packages/push

    How can I add this package to my python project?

  8. bitmvk commented on Apr 21, 2024

    @bitmvk
    ContributorAuthor

    hey, @ndonkoHenri

    now that we have the ability to use flutter packages in flet,

    we can make a control using any of the flutter packages to send notification.

    Please add this to the roadmap.

  9. ndonkoHenri commented on Apr 21, 2024

    @ndonkoHenri
  10. bitmvk commented on Apr 21, 2024

    @bitmvk
    Author
  11. reopened this on Apr 21, 2024
  12. 34 remaining items

  13. brunobrown commented on Dec 25, 2024

    @brunobrown
    Contributor

    Flet OneSignal - Flutter OneSignal package integration.

  14. Muddassir-Farooq-official commented on Dec 26, 2024

    @Muddassir-Farooq-official

    Flet OneSignal - Flutter OneSignal package integration.

    To send specific notifications to a specific user's device using OneSignal in your Flutter app, you'll need to identify and target that specific device (or user). OneSignal provides several ways to achieve this, such as tags, player IDs, or segments.

    Here’s a step-by-step guide to send notifications to a specific device using OneSignal:

    1. Identify the User Device
      To send notifications to a specific user, you need to capture and store a unique identifier for that user’s device. OneSignal provides a Player ID for each device, which is unique to that device and is required to target notifications to a specific device.

    Getting the OneSignal Player ID in Flutter:
    Once a device is registered with OneSignal, it gets a Player ID. You can capture this ID and store it in your backend or database for later use.

    Here’s how you can get the Player ID in your Flutter app:

    import 'package:onesignal_flutter/onesignal_flutter.dart';
    
    void main() {
      runApp(MyApp());
    
      // Initialize OneSignal
      OneSignal.shared.setAppId("YOUR_ONESIGNAL_APP_ID");
    
      // Get the Player ID (device identifier)
      OneSignal.shared.getDeviceState().then((deviceState) {
        String playerId = deviceState?.userId ?? "No Player ID";
        print("Player ID: $playerId");
  15. Muddassir-Farooq-official commented on Dec 26, 2024

    @Muddassir-Farooq-official

    How can we get user device player I'd using this flet-onesignal

  16. brunobrown commented on Dec 27, 2024

    @brunobrown
    Contributor

    @Muddassir-Farooq-official

    Hi bro,

    What I did was just the beginning of a potential integration for the package. Things have been quite hectic for me lately with other tasks and activities, and I haven’t had the time to dive into the Flutter package to add new features to flet-onesignal.

    Also, my knowledge of Flutter is minimal or almost nonexistent, so I need to study and understand the OneSignal Flutter logic to implement it in flet-onesignal. If you'd like to help implement new features, I’d be grateful and would be more than happy to add you as a collaborator on the project.

    What do you think?

    My invitation also extends to others involved in this issue who may want to contribute.

  17. Muddassir-Farooq-official commented on Dec 28, 2024

    @Muddassir-Farooq-official

    Flet OneSignal - Flutter OneSignal package integration.

    To send specific notifications to a specific user's device using OneSignal in your Flutter app, you'll need to identify and target that specific device (or user). OneSignal provides several ways to achieve this, such as tags, player IDs, or segments.

    Here’s a step-by-step guide to send notifications to a specific device using OneSignal:

    1. Identify the User Device
      To send notifications to a specific user, you need to capture and store a unique identifier for that user’s device. OneSignal provides a Player ID for each device, which is unique to that device and is required to target notifications to a specific device.

    Getting the OneSignal Player ID in Flutter: Once a device is registered with OneSignal, it gets a Player ID. You can capture this ID and store it in your backend or database for later use.

    Here’s how you can get the Player ID in your Flutter app:

    import 'package:onesignal_flutter/onesignal_flutter.dart';
    
    void main() {
      runApp(MyApp());
    
      // Initialize OneSignal
      OneSignal.shared.setAppId("YOUR_ONESIGNAL_APP_ID");
    
      // Get the Player ID (device identifier)
      OneSignal.shared.getDeviceState().then((deviceState) {
        String playerId = deviceState?.userId ?? "No Player ID";
        print("Player ID: $playerId");

    its stucks during build apk for android at

    [14:17:54] Generated splash screens ✅
    Run subprocess: ['C:\src\flutter_windows_3.19.6-stable\flutter\bin\dart.BAT', 'run', 'serious_python:main', 'package', 'G:\Projects\Bistro New', '--platform', 'Android', '--requirements',
    'flet>=0.25.2,onesignal_flet@git+https://github.com/brunobrown/onesignal-flet.git@main', '--exclude', 'build', '--cleanup', '--verbose']
    ( ● ) Packaging Python app ⏳...

  18. brunobrown commented on Dec 29, 2024

    @brunobrown
    Contributor

    Hi bro.

    I use Flutter v3.24.2 and Poetry for managing and configuring my projects. All configuration is done in the pyproject.toml file. Then, I simply run flet build apk.

    Below is an example of a pyproject.toml file configuration in case you also use Poetry:

    [tool.poetry]  
    name = "example-flet-app"  
    version = "0.1.0"  
    description = ""  
    authors = ["brunobrown <example@test.com>"]  
    readme = "README.md" 
    
    [tool.poetry.dependencies]
    python = "^3.12"
    flet = "^0.25.2"
    onesignal_flet = {git = "https://github.com/brunobrown/onesignal-flet.git", rev = "main"}
    
    [tool.flet]
    org = "com.mycompany" # --org
    product = "Product name" # --product
    company = "My Company" # --company
    copyright = "Copyright (C) 2024 by MyCompany" # --copyright
    build_number = 1 # --build-number
    app.module = "main" # --module-name
    compile.cleanup = false # --cleanup-on-compile
    
    [tool.flet.flutter.dependencies]  # <--- here  
    flet_onesignal = "^0.0.1"  # <--- Flutter package here
    
    [build-system]
    requires = ["poetry-core"]
    build-backend = "poetry.core.masonry.api"
    

    Even if you don't use Poetry, you can just create a pyproject.toml file in the root of your project and follow the various configuration examples shared here by Feodor:

  19. Muddassir-Farooq-official commented on Mar 22, 2025

    @Muddassir-Farooq-official

    @betopolione

    Hi bro,
    Maybe this video in the link below or the source code in the repository can help you. Feel free to use it or contribute if you'd like.

    @brunobrown can you merge it in flet as a pull request

  20. Muddassir-Farooq-official commented on Mar 22, 2025

    @Muddassir-Farooq-official

    @FeodorFitsner as flet now supporting pyjnius when will flet support plyer?

  21. Ayberk-Irmak commented on Apr 6, 2025

    @Ayberk-Irmak

    Hey everyone! 👋

    I finally found a solution for sending notifications in Flet mobile applications using Pyjnius!
    Since I know that many of you have been struggling with this issue, I decided to make a video tutorial explaining the entire process.
    Check it out, and let me know what you think!

    🔗 Video Link: How to Send Notifications in Flet using Pyjnius

    Hope it helps! 😊

  22. Muddassir-Farooq-official commented on Apr 7, 2025

    @Muddassir-Farooq-official

    Here is solution for local push notifications in flet

    https://github.com/Bbalduzz/flet_notifications

  23. alejandropoos commented on Apr 9, 2025

    @alejandropoos

    I've noticed that the solution for @Ayberk-Irmak and @Muddassir-Farooq-official doesn't allow using ft.Container, ft.Buttons, or any other non-string control as notification content. How could you put, for example, a container with buttons inside the notification content?

  24. Sushmargowda27 commented on May 28, 2025

    @Sushmargowda27

    Hey everyone! 👋
    I’ve successfully implemented push notifications on Android in my Flet mobile app using Pyjnius.
    Now, I’m trying to get push notifications working on iOS, but I’m stuck. 😕
    Has anyone managed to enable iOS push notifications in a Flet app?
    What’s the right approach or library for iOS?
    Do I need to configure anything specific in Xcode or Apple Developer settings (like provisioning profiles, certificates, etc.)?
    Do I need to use Swift/Objective-C or is there a Python-based solution for iOS like Pyjnius for Android?
    Any help or guidance is greatly appreciated — thanks in advance! 🙏

  25. locked and limited conversation to collaborators on Aug 20, 2025
  26. converted this issue into a discussion #5580 on Aug 20, 2025
  27. moved this from 🆕 New to ✅ Done in Flet Developmenton Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestSuggestion/Request for additional featureplatform: desktopSpecific to the desktop platformplatform: mobileSpecific to the mobile platform

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions