本文介绍了C2DM 和 Titanium Appcelerator 集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在使用 Titanium Appcelerator 来在 Android 上实现 C2DM.在他们的论坛和 Stackoverflow 中查看了许多答案后,我发现 指南 引导我编译和合并模块(titanium-c2dm 来自GitHub) 进入我的程序.我能够正确编译和链接所有内容,但尝试按照示例代码进行注册

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
    }
});

我的设备出现以下错误(来自 adb logcat):

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

推荐答案

这对我有用:

更改 tiapp.xml 和 timodule.xml

change in your tiapp.xml and timodule.xml

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

<service android:name="com.findlaw.c2dm.C2DMReceiver"/>

这篇关于C2DM 和 Titanium Appcelerator 集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 16:27