C2DM and Titanium Appcelerator Integration

末鹿安然 提交于 2019-12-12 03:11:44

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!