且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

IBM工作灯 - 推送通知功能在Android模拟器无法正常工作

更新时间:2023-01-01 09:39:22

有关推送通知在Android模拟器,您需要,以确保安装在Android SDK管理器

For Push Notifications to work in the Android Emulator, you need to make sure to install in the Android SDK Manager:

  • 谷歌API插件对应您使用的是为您的项目的API级别(在工作灯必须是API 8级或以上)。该AVD创建应该使用谷歌API

  • The Google APIs add-on corresponding to the API Level you're using for your project (in Worklight it must be API Level 8 or above). The AVD you create should use this Google API

的谷歌云消息传递为Android库(可在额外类别)

注意:推入Android模拟器工作的在AVD运行Android OS 4.xx的通知

Note: Push Notifications in the Android Emulator work only in an AVD running Android OS 4.x.x.

接下来,需要为建立GCM
这些步骤是有关您是否使用设备或仿真器。

Next, you need to set-up GCM:
These steps are relevant whether you're using a device or emulator.

  1. 创建一个Gmail电子邮件地址
  2. 转到GCM的网页: http://developer.android.com/google/ GCM / gs.html
  3. 点击谷歌API控制台页
  4. 如果你从未做过上述步骤3,您会被要求创建一个项目,该项目将有一个ID。此ID是 senderId 价值,你的应用程序descriptor.xml放置
  5. 单击创建新的服务器密钥.../创建新的Andr​​oid键
  6. 在生成的关键是 API密钥价值,你的应用程序descriptor.xml放置
  1. Create a Gmail email address
  2. Go to GCM's web page: http://developer.android.com/google/gcm/gs.html
  3. Click on "Google APIs Console page"
  4. If you have never done step 3 above, you will be asked to create a project, this project will have an ID. This ID is the senderId value you place in application-descriptor.xml
  5. Click on "Create new Server key..." / "Create new Android key"
  6. The generated key is the API key value you place in application-descriptor.xml

现在你需要:

Now you need to:

  1. 在构建和部署应用程序
  2. 部署适配器
  3. 运行在设备或仿真器
  4. 应用程序