问题
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
回答1:
this worked for me:
change in your tiapp.xml and timodule.xml
<service android:name=".C2DMReceiver"/>
to
<service android:name="com.findlaw.c2dm.C2DMReceiver"/>
来源:https://stackoverflow.com/questions/10018766/c2dm-and-titanium-appcelerator-integration