[TIMOB-1919] Android: Support push notifications
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2013-03-14T18:49:20.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Federico Casali |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T03:05:36.000+0000 |
Updated | 2017-03-23T05:23:19.000+0000 |
Description
Right now Ti.Network.registerForPushNotifications only works with iPhone.
Android 2.2 (Froyo) just added push notifications, called C2DM:
http://android-developers.blogspot.com/2010/05/android-cloud-to-device-messaging.html">
http://android-developers.blogspot.com/2010/05/android-cloud-to-dev...
Problem is this only works with v2.2 devices and up.
Urban Airship has an approach that works with almost all android
devices...but I'm not sure how much you want to marry to them:
http://blog.urbanairship.com/blog/2010/09/08/push-notifications-on-android-faq/">
http://blog.urbanairship.com/blog/2010/09/08/push-notifications-on-...
In any case, some kind of built-in support for push on Android would be great.
Don, I have an Android push module written and lightly tested and would be willing to give you guys the code if that'd help you create an officially-supported module quicker; let me know if you're interested.
@Matthew I think there is going to be a module in the marketplace for Urban Airship. We have enough features left for 1.5 that I don't think we're going to get any more modules done before Q1. Would you have any interest in adding yours to the market when it ships?
Possibly; we don't have resources to support it beyond our needs though so someone else will likely need to take over support for it.
@matt, I'd be interested in taking over support for it if you guys will post it. Most of my upcoming projects require C2DM, and installing a 3rd party app like urban airship isnt kosher with my clients.
Would it be acceptable if I released the code under LGPL?
Please do! :)
My application that I'd like to implement will involve a heavy use of push notifications, so I could get a good amount of testing done for anyone interested.
I'm really interested in this. Can you explain please how you're doing a push in this instance, as the application would surely have to be inactive - so is the push a secondary application running in the background, low memory footprint? Can you explain further please. Is it true push?
Chris: I'm going to try to get the code out soon; sometime between tomorrow and the end of the month :p
Peter: True push: http://code.google.com/android/c2dm/index.html">http://code.google.com/android/c2dm/index.html
Matthew, do you have twitter or somewhere I can follow the progress?
How about GitHub? :)
https://github.com/IGx89/titanium-c2dm">https://github.com/IGx89/titanium-c2dm
I haven't done any development on it for a few weeks so it may be broken with the latest 1.5.0 build, but changes should be minor. You'll definitely want to update build.properties to the paths in your local environment though. Feel free to change the package name from com.findlaw.titanium.c2dm to something else. Instructions on how to build and test the module can be found here: http://developer.appcelerator.com/doc/mobile/android/module_sdk">http://developer.appcelerator.com/doc/mobile/android/module_sdk
Looks good! I'll see what I can do about implementing this sometime this week and give you some feedback. Thanks for your contribution!
Looking forward to using C2DM in Titanium in current and future apps.
Attempting to build this module. I've changed build.properties to reflect my environment. When I try to build with ant, or with Eclipse, I get the following error:
/Library/Application Support/Titanium/mobilesdk/osx/1.5.0/module/android/build.xml:10: java.lang.UnsupportedClassVersionError: Bad version number in .class file
Maybe something to do with Java version?
$ javac -version javac 1.6.0_22
$ java -version java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-9M3263)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)
Eclipse is set to use 1.5
Line 10 of that build.xml is:
Does anyone have a pre-built zip of this module (if that would help), or any suggestions?
Just a follow up. I'm now able to build titanium-c2dm in Eclipse if I tell Eclipse to use Java 1.6
Our push notification support is specific to ACS module and not generic.
Android C2DM has just been deprecated in favor of the new "Google Cloud Messaging" ([https://support.google.com/googleplay/android-developer/support/bin/answer.py?hl=en&answer=2663268]). Please add support for "Google Cloud Messaging".
Push Notifications using C2DM are deprecated now, GCM is used now a days for this Purpose folowwing link contains module having user Guide for it https://github.com/liccowee/Google-Cloud-Messaging--Titanium-
Resolving as a duplicate of the linked issue and module
Ingo, I think this should be re-opened. It is great having modules on GitHub but this is such a core feature of apps and has been supported for ages on iOS. I think this is an important parity issue and really should be "built into" appcelerator without the need for a separate module build process
[~ndastur] Our ti.cloudpush module (delivered with the SDK) supports GCM. Is there an issue with using that approach?
@Ingo. It looks to me that the ti.cloudpush methods only support push notifications via ACS which is obviously quite vendor specific. If that is not the case then can the docs be updated. Thanks
Closing ticket as duplicate with reference to the linked issues above.