IBM工作灯 - 发送的Android推送通知,但没有收到 [英] IBM Worklight - Android push notification sent but not received
问题描述
我是新来的IBM工作灯,我试图让推通知工作,我的Android设备上。
I am new to IBM Worklight and I am trying to get push notification to work on my Android device.
我按照<一href="http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v620/08_01_Push_notifications_in_hybrid_applications.pdf"相对=nofollow>推送通知的混合应用教程在他们的网站并导入示例项目。
I have followed the "Push notification in hybrid applications" tutorial on their website and imported the sample project.
现在的问题是莫名其妙的我没有收到推送通知在我的Android设备(没有尝试过任何其他设备还)。我没有看到任何错误控制台,并报道说,通知已经发送给用户。
The problem is somehow I didn't receive the push notification in my android device (haven't tried any other device yet). I didn't see any error in the console and it reported that the notifications has been sent to user.
下面是日志:
[2014-07-18 12:44:32] Starting procedure invocation on Worklight Server
[2014-07-18 12:44:33] Not deploying adapter 'PushAdapter' since it was not changed since last deployment
[2014-07-18 12:44:33] Invoking procedure: 'submitNotification' of adapter 'PushAdapter'
[2014-07-18 12:44:33] Server host: 192.168.1.100
[2014-07-18 12:44:33] Server port: 10080
[2014-07-18 12:44:33] Parameters: ["david","test message"]
[2014-07-18 12:44:33] Procedure invocation finished
这是报告正文:
And this is the report body:
{
"isSuccessful": true,
"result": "Notification sent to user :: david"
}
不过,我等待,等待,等待......并通知仍然没有到达......
But I wait and wait and wait... and the notification still not arrived...
我做了什么:
- 在看了很多SO质疑有关此主题像<一个href="http://stackoverflow.com/questions/20871598/ibm-worklight-sent-push-notification-to-android-are-not-arriving">this和<一href="http://stackoverflow.com/questions/20551069/ibm-worklight-5-0-6-1-android-notification-does-not-reach-either-device-or-emu">this (但仍没有运气)
- 在安装谷歌的云信息库为Android,尽管它已经过时了,和谷歌Play业务:
- 生成在谷歌控制台API凭证(试用过的浏览器键和Android键)
- 在应用descriptor.xml设定键
- 启用谷歌云消息传递Android和谷歌Android的游戏开发者API在谷歌控制台项目
- 关闭防火墙
- 加入谷歌服务的lib作为项目参考
- Read many SO question relevant to this topic like this and this (but still no luck)
- Install Google Cloud Messaging Library for Android, although it has already obsolete, and Google Play services :
- Generate API credential in google console (tried both browser key and android key)
- Set key on application-descriptor.xml
- Enable Google Cloud Messaging for Android and Google Play Android Developer API in google console project
- turn off firewall
- add google service lib as project reference
和我跑出去的想法。
看来我的工作灯控制台还没有收到推送通知:
It seems my worklight console also didn't receive the push notification :
它显示0新的消息和0的总消息。
it shows 0 new messages and 0 total messages..
请帮我..我失去希望..任何帮助将是提前pciated :)谢谢非常AP $ P $
please help me.. i am losing hope.. any help would be very appreciated :) thanks in advance
推荐答案
按照下面的说明时,推送通知在我工作灯工作:
Push Notifications in Worklight work for me when following the below instructions:
- 在安装的工作灯工作室V6.2从Eclipse市场
- 下载并导入<一href="http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v620/PushNotificationsHybridProject.zip"相对=nofollow>推送通知示例项目
-
在应用descriptor.xml用我的GCM ID和GCM键
- Installed Worklight Studio v6.2 from the Eclipse Marketplace
- Downloaded and imported the Push Notifications sample project
Used my GCM ID and GCM Key in application-descriptor.xml
- 的GCM ID为项目编号。你可以找到它曾经登录到 GCM控制台,进入创建项目
- 的GCM关键是的浏览器的你在你的GCM项目下的凭据创建密钥>创建关键
- The GCM ID is the "project number". You can find it once logging into the GCM Console and into the project you create
- The GCM Key is the "Browser" key you create in your GCM project under Credentials > Create key
创建使用谷歌API的AVD(不能与Android 4.4.2水平困惑19 的)
Created an AVD using the Google API (not to be confused with Android 4.4.2 level 19)
- 在这一点尤其重要:在Android模拟器测试时,你需要使用谷歌的API,而不是Android的API
- 在当前的物理学设备的测试,你可以使用Android API
右键单击生成的Android项目>运行方式> Android应用程序
Right-click on the generated Android project > Run As > Android application
的AVD启动,应用程序安装
The AVD launches, application is installed
在该装置中,警报()秒从应用程序的JavaScript启动弹出,指示被接收到的通知。
In the device, the alert()s from the application's JavaScript start popping, indicating the notification was received.
以上是在我的家庭网络测试,所以我建议要仔细检查你按照上面还有再次检查您的网络设置。看看幻灯片#53在<一个href="http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v620/08_01_Push_notifications_in_hybrid_applications.pdf"相对=nofollow>推送通知培训模块。
The above was tested in my home network, so I would suggest to double-check that you followed the above as well as check again your network settings. Take a look at slide #53 in the Push Notifications training module.
这篇关于IBM工作灯 - 发送的Android推送通知,但没有收到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!