C2DM and Titanium Appcelerator Integration

Go To StackoverFlow.com

0

I am using Titanium Appcelerator in order to implement C2DM on Android. After looking at many answers in their forums and in Stackoverflow, I found a guide that walked me through compiling and incorporating a module(titanium-c2dm from GitHub) into my program. I was able to compile and link everything properly, but in an attempt to register per the sample code

c2dm.registerC2dm(senderId, {
    success:function(e)
    {
        //stuff here
    },
    error:function(e)
    {
        //stuff here
    },
    callback:function(e) // called when a push notification is received
    {
        //stuff here
    }
});

I get the following error on my device (from adb logcat):

I/TiAPI   ( 2731): Registering...
D/C2dmModule( 2731): (KrollRuntimeThread) [196,687] registerC2dm called
D/C2dmModule( 2731): (KrollRuntimeThread) [1,688] get registrationId property
MORE STUFF HAPPENS HERE  
W/ActivityManager(  127): Unable to start service Intent
                          {act=com.google.android.c2dm.intent.REGISTRATION 
                          cat=[com.vivas.c2dmtest] cmp=com.vivas.c2dmtest/com.findlaw.c2dm.C2DMReceiver (has extras) }: not found

Does anybody have any idea how to incorporate this into my project? Any help would be appreciated

2012-04-04 20:29
by avivas
Can you share how you got it to compile? When I try to build with ant, it gives me a build error where it apparently can't find gpref - Colin DeClue 2012-07-06 18:56


2

this worked for me:

change in your tiapp.xml and timodule.xml

<service android:name=".C2DMReceiver"/>

to

<service android:name="com.findlaw.c2dm.C2DMReceiver"/>
2012-04-16 12:47
by user584569
Thanks for your response, this seems to have done the trick. I received a successful registration with a valid registrationID - avivas 2012-04-20 13:50
Ads