Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1919] Android: Support push notifications

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2013-03-14T18:49:20.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterFederico Casali
AssigneeIngo Muschenetz
Created2011-04-15T03:05:36.000+0000
Updated2017-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.

Additional notes

Customer ticket: http://support-admin.appcelerator.com/display/APP-684245

Comments

  1. Matthew Lieder 2011-04-15

    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.

  2. Don Thorp 2011-04-15

    @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?

  3. Matthew Lieder 2011-04-15

    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.

  4. Anthony Webb 2011-04-15

    @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.

  5. Matthew Lieder 2011-04-15

    Would it be acceptable if I released the code under LGPL?

  6. Chris Nelson 2011-04-15

    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.

  7. Peter Sweeney 2011-04-15

    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?

  8. Matthew Lieder 2011-04-15

    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

  9. Chris Nelson 2011-04-15

    Matthew, do you have twitter or somewhere I can follow the progress?

  10. Matthew Lieder 2011-04-15

    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

  11. Chris Nelson 2011-04-15

    Looks good! I'll see what I can do about implementing this sometime this week and give you some feedback. Thanks for your contribution!

  12. chrisbratlien 2011-04-15

    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:

        <taskdef classname="org.appcelerator.titanium.ant.StringTask" name="ti.string" classpath="${ti.module.support.dir}/android/ant-tasks.jar"/>
        

    Does anyone have a pre-built zip of this module (if that would help), or any suggestions?

  13. chrisbratlien 2011-04-15

    Just a follow up. I'm now able to build titanium-c2dm in Eclipse if I tell Eclipse to use Java 1.6

  14. Neeraj Gupta 2012-06-27

    Our push notification support is specific to ACS module and not generic.
  15. Shawn Lipscomb 2012-06-29

    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".
  16. Muhammad Adnan 2012-10-23

    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-
  17. Ingo Muschenetz 2013-03-14

    Resolving as a duplicate of the linked issue and module
  18. Neville Dastur 2013-08-10

    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
  19. Ingo Muschenetz 2013-10-29

    [~ndastur] Our ti.cloudpush module (delivered with the SDK) supports GCM. Is there an issue with using that approach?
  20. Neville Dastur 2013-10-29

    @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
  21. Lee Morris 2017-03-23

    Closing ticket as duplicate with reference to the linked issues above.

JSON Source