android_notify icon indicating copy to clipboard operation
android_notify copied to clipboard

Is it possible to use this lib in flet app?

Open amogus-gggy opened this issue 1 year ago • 9 comments

Can i somehow use this library in flet app on android? Flet developers just refusing to add push notifications functionality into flet. If i can how can i do it?

amogus-gggy avatar Oct 03 '25 20:10 amogus-gggy

Hey @amogus-gggy, Sorry for the late reply!

Currently, this library is tested and optimized for Kivy (Python), so it’s not directly compatible with Flet at the moment.

However, according to the Flet docs, using Pyjnius to interact with native Android APIs is possible and since Pyjnius is the main building block for this package, there’s a chance it might work.

I’ll try creating a small Flet app to test this approach and get back to you once I confirm if integration is possible.

Fector101 avatar Oct 06 '25 11:10 Fector101

@amogus-gggy 🥳 i finally figured out a way to make it work will be adding more documentation soon!

Fector101 avatar Oct 17 '25 22:10 Fector101

I've made some changes to the repo allowing usage from Flet python apps.

Also added 3 steps in the README for usage

[!NOTE] while all the notification components can be added Successfully, click events like buttons and opening app from notifications don't for now.


EDIT

[!IMPORTANT] Opening app from notifications now works on flet apps.

Fector101 avatar Nov 06 '25 09:11 Fector101

Reduced it the to one step

In your pyproject.toml file, ensure you include the following:

[tool.flet.android]
dependencies = [
  "pyjnius","https://github.com/Fector101/android_notify/archive/without-androidx.zip"
]

[tool.flet.android.permission]
"android.permission.POST_NOTIFICATIONS" = true

Fector101 avatar Nov 20 '25 23:11 Fector101

Hello! I came to your project in need of a good solution for notifications.

My question is: does it work with the last version of Flet? I'm trying to build the apk so I can test it in the Android Studio emulator, but it can't seem to finish the build.

I see that in the Flet app example the Flet version is 0.27, which is very low (we are currently in 0.80.4). Also, it's only possible to build an Android app with Pyjnius 1.6.1. No other version has wheels available for Android that works with Flet.

Is there any possibility that you can update the project so it works with the latest version? I'm about to go insane because the notifications are the core value for my app, and without them my app is nothing, and I would need to rewrite my entire app in a native language if I can't solve it with Flet.

Thanks for your amazing work!

WhiteHeadbanger avatar Jan 30 '26 04:01 WhiteHeadbanger

Hi! Thanks a lot for the kind words,

I think it’s very possible to run this with the latest versions of Flet and Pyjnius. I pinned it to Flet v0.27 mainly because that was the version where I could reliably get GitHub Actions to build an APK successfully.

Since notifications are a core part of your app, it’s also important to point out that while tapping a notification to open the app currently works, attaching other actions does not yet and notification buttons don’t trigger callbacks for Flet at the moment.

I’ll try building locally from my PC with the latest versions and will get back to you once I have clearer results.

Fector101 avatar Jan 31 '26 09:01 Fector101

@WhiteHeadbanger It works without additional set up when building locally, But incase your'e using git actions to build like me i updated apk-build.yml so it also works for flet>=0.80.5

Point to a released verison for constitent behavoiur


dependencies = [
    "flet>=0.80.5",
    "pyjnius==1.6.1","android-notify==1.60.10.dev0",
]

You can add any components listed here images, progress bars,... And All other behaviours except callback functions

Fector101 avatar Feb 03 '26 03:02 Fector101

Hello! I came to your project in need of a good solution for notifications.

My question is: does it work with the last version of Flet? I'm trying to build the apk so I can test it in the Android Studio emulator, but it can't seem to finish the build.

I see that in the Flet app example the Flet version is 0.27, which is very low (we are currently in 0.80.4). Also, it's only possible to build an Android app with Pyjnius 1.6.1. No other version has wheels available for Android that works with Flet.

Is there any possibility that you can update the project so it works with the latest version? I'm about to go insane because the notifications are the core value for my app, and without them my app is nothing, and I would need to rewrite my entire app in a native language if I can't solve it with Flet.

Thanks for your amazing work!

I've come across difficulties with integrating any kind of notifications for Android using flet, that's why I've built https://github.com/alex-stoica/flet-android-notifications. It's a very young repo, but give it a chance

alex-stoica avatar Mar 04 '26 21:03 alex-stoica

i made it possible to now use without version pinning and tested on flet 0.86.5

dependencies = [
    "flet>=0.80.5", "pyjnius", "android-notify",
    "certifi>=2025.6.15", "requests"
]

i also built a demo app, I'll try to keep updating it

Flet python is actually quite interesting, but I've found it doesn't have some functionality like services which causes some of the gaps in android-notify docs But that shouldn't be a worry because flet is rapidly improving. callback functionality will likely be available on Flet

Fector101 avatar Aug 18 '26 06:08 Fector101