2

I am using Appcelerator Titanium Version 1.8.0 have anyone tried push notification using google's C2DM.if so help me to create Sample push notification.

Sugan S
  • 1,782
  • 7
  • 25
  • 47
  • too broad question to answer... Be specific... you can refer kitchen Sink 's example... – Maulik Mar 21 '12 at 06:21
  • k i refered a code [here](https://github.com/IGx89/titanium-c2dm) but Still i am getting Error like "Module not found " but what my question is I need to create new module or i can simply clone the project code. – Sugan S Mar 21 '12 at 06:43
  • can u tell me steps to implement.I don't want to do big app but sample push notification – Sugan S Mar 21 '12 at 06:44
  • 1
    Thank u Maulik i will improve – Sugan S Mar 22 '12 at 07:28

1 Answers1

4

It is not that difficult: Here is steps for it...

  1. Clone project from github
  2. Find build.properties
  3. Modify all paths to fit the paths (and versions) in your environment
  4. Optionally you need to download and install the android sdk from here http://developer.android.com/sdk/ndk/index.html
  5. Open console in module root and type ant and hit enter
  6. The build process should end with something like build successfully
  7. In the module directory, you will find the build result in the dist folder
  8. Open that folder, unzip the com.findlaw.c2dm-android-0.1.zip
  9. A folder is created: modules/android/com.findlaw.c2dm/0.1
  10. copy the content of modules/android/com.findlaw.c2dm/0.1 to the folder [your_project]/modules/android/com.findlaw.c2dm/
  11. Copy timodule.xml to the root folder of your project (where the tiapp.xml is located)
  12. Open tiapp.xml and replace all occurences of com.findlaw.c2dm with your app id, except of the line including this: com.findlaw.c2dm.C2DMReceiver
  13. Register the module in tiapp.xml:
    <modules>
       <module platform="android" version="0.1">com.findlaw.c2dm</module>
     </modules>


 14. Use the module in your code as described in the example of the module

For more check this communication of our team member...

Your Module folder should not inside the Resource folder

enter image description here

Maulik
  • 19,348
  • 14
  • 82
  • 137
  • Thank u maulik after implementing if i get problem may i ask quetion to u – Sugan S Mar 21 '12 at 07:38
  • @sugan.s @maulik would you be able to give me a hand. I followed these instructions and was never able to compile with the following error: `BUILD FAILED /Users/administrator/Documents/C2DM/build.xml:9: Cannot find /Library/Application Support/Titanium/mobilesdk/osx/module/android/build.xml imported from /Users/administrator/Documents/C2DM/build.xml` I also tried the question from Appcelerator and always got the error `unable to find com.findlaw.titanium.c2dm` even after following the instructions. Thanks for your help! – avivas Apr 02 '12 at 20:18
  • @avivas: at where your module folder is located ? – Maulik Apr 03 '12 at 04:20
  • @Maulik I just updated my project, was finally able to build it properly. However on the call `c2dm = require('com.findlaw.titanium.c2dm');` I get the following error `Uncaught Error: Requested module not found: com.findlaw.titanium.c2dm` Any ideas? – avivas Apr 03 '12 at 16:58
  • @Maulik I was finally able to link and compile but I get a new error. Would you be able to see my new [question](http://stackoverflow.com/questions/10018766/c2dm-and-titanium-appcelerator-integration) and see if you can help me out? – avivas Apr 04 '12 at 20:45