Is it possible to add push notification like GCM to Kivy?

1,627 views
Skip to first unread message

KyungHoon Baek

unread,
May 17, 2015, 2:52:33 AM5/17/15
to kivy-...@googlegroups.com
I want to use Kivy for developing android app.
Is it possible to add gcm broadcast receiver to kivy and GCM APIs to use it?
Or is there another way to perform push notification?
Please show me a way.

niavlys

unread,
May 17, 2015, 2:50:29 PM5/17/15
to kivy-...@googlegroups.com
Hi,

I'm currently working on adding push notifications to a kivy app, which is intended to run on both android and iOS. I choose to use parse.com as a backend, because it's:
+ well documented
+ affordable ( 1 million push per app and per month, for free)
+ and mostly, after having tweaked the build process for each platform ( tricky stuff ahead ;), it just work almost fine with kivy!
- cons: parse.com belongs to facebook, for what's worth...

anyway, i still need to clean my code and gather my notes before I could show a proof of concept...

stay tuned!

jetpack

unread,
May 19, 2015, 10:01:14 PM5/19/15
to kivy-...@googlegroups.com
Please do post it. I'm looking to itegrate push notification too.

guitarical

unread,
May 25, 2015, 10:33:13 PM5/25/15
to kivy-...@googlegroups.com
niavlys, have you made any progress on documenting this by chance? I'm working on getting push notifications to work in my kivy app. On android, I'm using plyer as described here and here. However, iOS is proving to be much trickier. Am currently trying to use PyAPNS to get notifications on iOS but no success so far. I'm also using Django as the back-end for the app, so am trying to figure out if Django iOS notifications could be used

Will keep the group posted on my progress. Any help would also be greatly appreciated. Thanks! 

Roger Erens

unread,
May 31, 2015, 3:23:03 PM5/31/15
to kivy-...@googlegroups.com
Does 'being able to receive a push notification' mean that the Kivy app should run continuously?

If that is the case, I think WAMP (integrating PUB/SUB and RPC) might be another way to attack your problem. I have just posted a message showing off a demo app:

Op dinsdag 26 mei 2015 04:33:13 UTC+2 schreef guitarical:

Rakan Alhneiti

unread,
Oct 10, 2015, 7:35:07 AM10/10/15
to Kivy users support
I have not been able to find anything regarding push notifications in Kivy. I am planning to start a project using Kivy but this is still a point that's holding me back.

Have you guys managed to find a way?

I would assume you can still modify the java code to add this but reacting to the push notification within the app is still a question.

Could you please update us on this matter?

Michael Hines

unread,
Sep 29, 2016, 2:34:08 PM9/29/16
to Kivy users support
So, I was able to get this done. It was pretty difficult, but not impossible. After finishing it, I have to say that I do NOT recommend doing this through python ----- for the most part, it's not possible.

I did this on both Android and iOS and in either case, if you don't write Java or modify main.m in Xcode, it's not worth your time.

From a high-level, these are the steps you have to go through:

Android:
1. First, you have to follow ALL the normal steps you would go through that a typical developer using Android Studio would go through. I can provide advise on the hoops I jumped through, but this is the hardest part. This includes creating the API project, getting your API key and project number, and then copying the classes from this example google project into your python-for-android project: https://github.com/googlesamples/google-services/tree/master/android/gcm/app/src/main/java/gcm/play/android/samples/com/gcmquickstart . NOTE: Despite the fact that google recommends firebase, firebase still uses GCM on the backend. There's absolutely no need (yet) to use the Firebase SDK --- you can still use all the standard GCM examples and libraries.
2. Next, when you're actually ready to compile your buildozer project, you need the Jar files that provide Google Play Services and GCM: You have to fire up the Android SDK manager (located in ~/.buildozer) and add the "extras" respository URL to the SDK manager and then install the google play services SDK. (You can google all that stuff on how to do it).
3. The hardest part that I had to figure out was that once the Google Play services SDK is installed (version 9.6.1 as of this writing), you don't get Jars, you get "aar"'s --- Which is basically a zip file inside of a zip file. You will need to following files: a) play-services-gcm.jar b) play-services-iid.jar and c) play-services-basement.jar d) play-services.jar. These files are produced by extracting the "classes.jar" file from the respective "aar" archive format downloaded from the SDK.

Once you have those jars ^^^^ (all 4 of them, don't skip any), you can then link them in your buildozer.spec and compile the application ----- it works perfectly.

So, if you've already made an app with push notifications before, you'll already understand #1 above ^^^^ ---- it's the part that involved grabbing the jar files and doing all of this without Gradle that threw me for a loop that I didn't understand.

The short answer is: Yes, it can be done without gradle.

iOS: Here's using the most recent kivy-ios toolchain makes this pretty easy:

1. Follow all the standard procedures for creating certificates and importing them into the apple member center and activating push notifications for your app. Google all that stuff.
2. Once you have the certificates installed, find the file "main.m" in the kivy-ios toolchain. You will then need to add the usual functions to that file to register your app with APNS and grab the token.

Really, for iOS it's that simple. HANDLING the token is an exercise left for the reader ---- when you get to that point, I would guess you would want to use python in both Android and iOS to handle
sending the tokens to your own respective push notification server/services. Once you have the token, you can switch back to python and be happy with all the python goodness that the excellent
kivy toolchains have provided for us.

qua non

unread,
Oct 1, 2016, 4:07:26 AM10/1/16
to kivy-...@googlegroups.com
Hey Micheal,

Thanks for such a simple and lovely explanation, would you think about adding it to wiki?

or the official documentation?

Regards
Akkshay

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rodolfo Torres

unread,
Nov 9, 2016, 2:14:50 PM11/9/16
to Kivy users support
Thank you so much for this Michael. I don't know much java so I had no idea how to do it for android. Your throughout response really helps.
There is a lot of work still with handling the token and such. I I will try to implement this now and will report back.

purushottam yadav

unread,
Jun 21, 2022, 1:52:18 AM6/21/22
to Kivy users support
i  want to implement push notification in case of android using fcm , i  did not find anything related in internet , can you people please  guide me  .

Robert

unread,
Jun 21, 2022, 2:53:27 AM6/21/22
to Kivy users support
Google: python fcm

purushottam yadav

unread,
Jun 21, 2022, 3:07:12 AM6/21/22
to Kivy users support
yes , I have tried  , 

i am asking if   any github project   available ?  
i tried using      https://github.com/Fox520/pushyy and https://github.com/Fox520/KivyPushNotifications  , and running into errors . 
If you have any github project , please share it  here .

Robert

unread,
Jun 21, 2022, 7:35:07 PM6/21/22
to Kivy users support
Well, it seems like you found a github project.

If you don't understand the errors when you run that example, post them here.
I don't know if I will understand them, but if you don't share them I definitely wont.

purushottam yadav

unread,
Jun 25, 2022, 3:00:00 AM6/25/22
to Kivy users support
this is error , how to handle this ?
Screenshot 2022-06-19 at 17.29.23 (1).png

Robert

unread,
Jun 25, 2022, 1:00:55 PM6/25/22
to Kivy users support
First re-check that the install instructions were followed.

If you still have an issue install `gettext` or if there is still an issue `gettext-develop`  (it depends on the Linux you use)

If you want to know more Google:  AM_ICONV
Reply all
Reply to author
Forward
0 new messages