【问题标题】:Appcelerator titanium push Notification using C2DM?使用 C2DM 的 Appcelerator 钛推送通知?
【发布时间】:2012-04-05 16:03:17
【问题描述】:

我正在使用 Appcelerator Titanium 版本 1.8.0

【问题讨论】:

  • 太宽泛的问题无法回答...具体点...你可以参考 kitchen Sink 的例子...
  • ki 引用了代码 here 但我仍然收到类似“未找到模块”的错误,但我的问题是我需要创建新模块,或者我可以简单地克隆项目代码。
  • 你能告诉我实现的步骤吗?我不想做大的应用程序,但示例推送通知
  • 谢谢你 Maulik 我会改进的

标签: android titanium push-notification appcelerator-mobile


【解决方案1】:

没那么难:这里是它的步骤......

  1. 从 github 克隆项目
  2. 查找 build.properties
  3. 修改所有路径以适应您环境中的路径(和版本)
  4. (可选)您需要从此处http://developer.android.com/sdk/ndk/index.html 下载并安装 android sdk
  5. 在模块根目录中打开控制台并输入 ant 并回车
  6. 构建过程应该以构建成功之类的内容结束
  7. 在模块目录下,你会在 dist 文件夹中找到构建结果
  8. 打开该文件夹,解压缩 com.findlaw.c2dm-android-0.1.zip
  9. 创建了一个文件夹:modules/android/com.findlaw.c2dm/0.1
  10. 将modules/android/com.findlaw.c2dm/0.1的内容复制到文件夹[your_project]/modules/android/com.findlaw.c2dm/
  11. 将 timodule.xml 复制到项目的根文件夹(tiapp.xml 所在的位置)
  12. 打开 tiapp.xml 并将所有出现的 com.findlaw.c2dm 替换为您的应用程序 ID,但包含以下内容的行除外: com.findlaw.c2dm.C2DMReceiver
  13. 在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

更多请查看我们团队成员的this communication...

您的 Module 文件夹不应位于 Resource 文件夹中

【讨论】:

  • 谢谢你执行后maulik如果我遇到问题可以问你
  • @sugan.s @maulik 你能帮我一把吗?我按照这些说明进行了编译,但出现以下错误: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 我也尝试了 Appcelerator 的问题,即使按照说明进行操作,也总是收到错误 unable to find com.findlaw.titanium.c2dm。感谢您的帮助!
  • @avivas: 你的模块文件夹在哪里?
  • @Maulik 我刚刚更新了我的项目,终于能够正确构建它。但是在电话c2dm = require('com.findlaw.titanium.c2dm'); 上我收到以下错误Uncaught Error: Requested module not found: com.findlaw.titanium.c2dm 有什么想法吗?
  • @Maulik 我终于能够链接和编译,但我得到了一个新错误。你能看到我的新question,看看你能不能帮帮我?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-09-10
  • 1970-01-01
  • 1970-01-01
  • 2012-01-16
  • 1970-01-01
  • 2015-07-12
  • 1970-01-01
相关资源
最近更新 更多