简体   繁体   English

IBM Worklight-未发送到Android的已发送推送通知

[英]IBM Worklight - Sent push notification to Android are not arriving

I've downloaded the push notifications project from "Woklight getting started" and I've installed it in my device with the proper API key and senderId. 我已从“ Woklight入门”下载了推送通知项目,并已使用正确的API密钥和senderId将其安装在设备中。 I've deployed the adapter and it's working fine. 我已经部署了适配器,并且工作正常。 Now I'm trying to do the test of sending push notifications to the device. 现在,我正在尝试进行将推送通知发送到设备的测试。

To log in the application I can use arbitrary values, am I right? 我可以使用任意值登录应用程序,对吗? Like Username="Santaclaus" and Password="cheese". 像Username =“ Santaclaus”和Password =“ cheese”。

Then to invoke the adapter procedure by right-clicking the adapter > invoke procedure > specify username and message, in the username I will put "Santaclaus" and in the message "Blabla bla bla", am I correct? 然后通过右键单击适配器>调用过程>指定用户名和消息来调用适配器过程,在用户名中我将输入“ Santaclaus”,并在消息中“ Blabla bla bla”,对吗?

The problem is that when I press the Run button, the Invocation Result of procedure: 'submitNotification' from the Worklight Server: 问题是当我按下“运行”按钮时,来自Worklight Server的过程“ submitNotification”的调用结果:

    {
   "isSuccessful": true,
   "result": "Notification sent to user :: Santaclaus"
}

and the console shows this error: 并且控制台显示此错误:

[AUDIT   ] CWWKG0016I: Starting server configuration update.
[AUDIT   ] CWWKG0017I: The server configuration was successfully updated in 0.010 seconds.
[AUDIT   ] CWWKT0017I: Web application removed (default_host): http://L3CDH3K.corp.capgemini.com:10080/PushNotifications/
[AUDIT   ] CWWKZ0009I: The application PushNotifications has stopped successfully.
[AUDIT   ] CWWKG0016I: Starting server configuration update.
[AUDIT   ] CWWKG0017I: The server configuration was successfully updated in 0.030 seconds.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://L3CDH3K.corp.capgemini.com:10080/PushNotifications/
[AUDIT   ] CWWKZ0001I: Application PushNotifications started in 3.362 seconds.
[WARNING ] FWLSE0029W: Registration of application PushNotifications-android-1.0 to mediator occured more than once. [project PushNotifications]
[WARNING ] FWLSE0029W: Registration of application PushNotifications-android-1.0 to mediator occured more than once. [project PushNotifications]
[ERROR   ] FWLSE0094E: Error while attempting to invoke GCM service (for sender key starting with 'AIzaSyBb'), sending will not resume until server is restarted or application re-deployed [project PushNotifications]
[ERROR   ] FWLSE0093E: Failed to invoke Google GCM push service. [project PushNotifications]
GCM Service invocation failed (reason: Authentication has failed for sender key starting with 'AIzaSyBb')
[WARNING ] Authentication error: Unable to respond to any of these challenges: {}

and the LogCat shows: LogCat显示:

01-02 10:15:27.873: D/PushNotifications(7609): wlclient init started
01-02 10:15:27.883: D/PushNotifications(7609): Read cookies: null
01-02 10:15:27.883: D/PushNotifications(7609): CookieMgr read cookies: {}
01-02 10:15:27.933: W/PushNotifications(7609): Your application is using the WL.OptionsMenu API. Note that, if your application targets Android 3.0 (API level 11) or higher, WL.OptionsMenu might have no effect, depending on the device.
01-02 10:15:27.943: D/PushNotifications(7609): addDeviceIDHeader deviceIDSuccessCallback
01-02 10:15:27.963: D/PushNotifications(7609): connectOnStartup
01-02 10:15:27.973: D/PushNotifications(7609): connectOnStartup isCertificateExists:  false
01-02 10:15:28.473: D/PushNotifications(7609): Request [http://192.168.16.128:10080/PushNotifications/apps/services/api/PushNotifications/android/init]
01-02 10:15:28.563: D/CordovaActivity(7609): onMessage(spinner,stop)
01-02 10:15:30.983: D/SoftKeyboardDetect(7609): Ignore this event
01-02 10:15:31.083: D/dalvikvm(692): GC_CONCURRENT freed 448K, 8% free 8302K/8968K, paused 3ms+9ms, total 54ms
01-02 10:15:31.113: D/SoftKeyboardDetect(7609): Ignore this event
01-02 10:15:32.803: D/dalvikvm(490): GC_CONCURRENT freed 1668K, 18% free 15196K/18376K, paused 2ms+10ms, total 91ms
01-02 10:15:32.883: D/dalvikvm(692): GC_CONCURRENT freed 409K, 8% free 8280K/8968K, paused 3ms+3ms, total 29ms
01-02 10:15:37.473: D/dalvikvm(7544): GC_CONCURRENT freed 150K, 4% free 8393K/8700K, paused 3ms+2ms, total 22ms
01-02 10:15:37.513: D/Finsky(7544): [1] 5.onFinished: Installation state replication succeeded.
01-02 10:15:38.883: D/SoftKeyboardDetect(7609): Ignore this event
01-02 10:15:38.923: W/IInputConnectionWrapper(7609): getTextBeforeCursor on inactive InputConnection
01-02 10:15:38.923: W/IInputConnectionWrapper(7609): getTextAfterCursor on inactive InputConnection
01-02 10:15:39.003: D/SoftKeyboardDetect(7609): Ignore this event
01-02 10:15:40.023: I/GetJar SDK [com.zeptolab.ctr.ads](2538): CommManager checkManifestFile started
01-02 10:15:40.023: W/GetJar SDK [com.zeptolab.ctr.ads](2538): [OPTIONAL] Could not find the com.getjar.sdk.rewards.GetJarReceiver defined inside AndroidManifest.xml. It is required if there is no other implementation of Google Play billing.
01-02 10:15:40.053: I/GetJar SDK [com.zeptolab.ctr.ads](2538): AuthFlow: ensureAuthInternal() state:STARTING
01-02 10:15:40.053: I/GetJar SDK [com.zeptolab.ctr.ads](2538): AuthFlow: ensureAuthInternal() [running auth-flow]
01-02 10:15:40.053: I/GetJar SDK [com.zeptolab.ctr.ads](2538): AuthFlow: ensureAuthInternal() finishing with state:EXPIRY_CHECKING
01-02 10:15:40.133: D/dalvikvm(2538): GC_CONCURRENT freed 5953K, 20% free 25539K/31648K, paused 4ms+4ms, total 72ms
01-02 10:15:40.133: D/dalvikvm(2538): WAIT_FOR_CONCURRENT_GC blocked 39ms
01-02 10:15:44.163: D/PushNotifications(7609): Request [login]
01-02 10:15:44.243: D/SoftKeyboardDetect(7609): Ignore this event
01-02 10:15:44.373: D/PushNotifications(7609): Request [http://192.168.16.128:10080/PushNotifications/apps/services/api/PushNotifications/android/init]
01-02 10:15:48.043: D/dalvikvm(7609): GC_CONCURRENT freed 336K, 7% free 8328K/8864K, paused 2ms+2ms, total 32ms
01-02 10:15:49.433: D/PushNotifications(7609): Request [http://192.168.16.128:10080/PushNotifications/apps/services/api/PushNotifications/android/init]
01-02 10:15:49.463: W/InputMethodManagerService(490): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4186d4c0 attribute=null, token = android.os.BinderProxy@41af16b8
01-02 10:15:49.723: D/PushNotifications(7609): Clearing notification subscriptions.
01-02 10:15:49.723: D/PushNotifications(7609): Updating notification subscriptions.
01-02 10:15:49.723: D/WLDroidGap(7609): unregisterReceivers:Receiver not registered: null
01-02 10:15:49.723: D/WLDroidGap(7609): unregisterReceivers:Receiver not registered: null
01-02 10:15:49.733: V/GCMRegistrar(7609): Registering receiver
01-02 10:15:49.733: D/GCMRegistrar(7609): resetting backoff for com.PushNotifications
01-02 10:15:49.753: V/GCMRegistrar(7609): Registering app com.PushNotifications of senders 515493207294
01-02 10:15:49.753: W/PluginManager(7609): THREAD WARNING: exec() call to Push.subscribe blocked the main thread for 24ms. Plugin should use CordovaInterface.getThreadPool().
01-02 10:15:49.763: D/PushNotifications(7609): response [http://192.168.16.128:10080/PushNotifications/apps/services/api/PushNotifications/android/init] success: /*-secure-
01-02 10:15:49.763: D/PushNotifications(7609): {"WL-Authentication-Success":{"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"PushAppRealm":{"userId":"Santaclaus","attributes":{},"isUserAuthenticated":1,"displayName":"Santaclaus"},"wl_antiXSRFRealm":{"userId":"35rkplsu96msjk6hichq990k2h","attributes":{},"isUserAuthenticated":1,"displayName":"35rkplsu96msjk6hichq990k2h"},"wl_deviceNoProvisioningRealm":{"userId":"05282bf4-9fe4-3c40-8280-3e627db3fe5c","attributes":{"mobileClientData":"com.worklight.core.auth.ext.MobileClientData@eb49d"},"isUserAuthenticated":1,"displayName":"05282bf4-9fe4-3c40-8280-3e627db3fe5c"}},"userPrefs":{},"notificationSubscriptionState":{"eventSources":[{"eventSource":"PushEventSource","alias":"myPush","adapter":"PushAdapter"}],"token":"APA91bFg1hMAQcCZnLHRQ5qIZu5HdkcWpt0p99cftqXD4YrrxD8W-F5r7x3DYRGv-hY0jFTvtg5Yg9Uo1o_EjJFxkoyLUKGxNiRzmh-md9-FwCQ2gfSvTVFT1Vt6J9UigpwdWFCblB-dBBYv4U9Z2S3Vi5gvBFr9WPUwDQGR2Ez5GfQQiYj3x1k"},"gadgetProps":{"directUpdate":{"updateUnpackedSize":1187754,"availableSkins":["default"],"checksum":796238133,"updateSize":385169},"ENVIRONMENT":"android"},"userInfo":{"wl_authenticityRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"PushAppRealm":{"userId":"Santaclaus","attributes":{},"isUserAuthenticated":1,"displayName":"Santaclaus"},"wl_antiXSRFRealm":{"userId":"35rkplsu96msjk6hichq990k2h","attributes":{},"isUserAuthenticated":1,"displayName":"35rkplsu96msjk6hichq990k2h"},"wl_deviceAutoProvisioningRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_deviceNoProvisioningRealm":{"userId":"05282bf4-9fe4-3c40-8280-3e627db3fe5c","attributes":{"mobileClientData":"com.worklight.core.auth.ext.MobileClientData@eb49d"},"isUserAuthenticated":1,"displayName":"05282bf4-9fe4-3c40-8280-3e627db3fe5c"},"myserver":{"userId":"Santaclaus","attributes":{},"isUserAuthenticated":1,"displayName":"Santaclaus"},"wl_anonymousUserRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null}}}*/
01-02 10:15:49.763: D/PushNotifications(7609): wlclient connect success
01-02 10:15:49.773: D/PushNotifications(7609): before: app init onSuccess
01-02 10:15:49.783: D/PushNotifications(7609): after: app init onSuccess
01-02 10:15:49.783: D/PushNotifications(7609): added onPause event handler 
01-02 10:15:49.783: D/PushNotifications(7609): wlclient init success
01-02 10:15:49.913: D/dalvikvm(929): GC_CONCURRENT freed 408K, 8% free 8984K/9664K, paused 3ms+2ms, total 25ms
01-02 10:15:49.993: V/GCMBroadcastReceiver(7609): onReceive: com.google.android.c2dm.intent.REGISTRATION
01-02 10:15:49.993: V/GCMBroadcastReceiver(7609): GCM IntentService class: com.PushNotifications.GCMIntentService
01-02 10:15:49.993: V/GCMBaseIntentService(7609): Acquiring wakelock
01-02 10:15:50.003: V/GCMBaseIntentService(7609): Intent service name: GCMIntentService-515493207294-1
01-02 10:15:50.003: D/GCMBaseIntentService(7609): handleRegistration: registrationId = APA91bFg1hMAQcCZnLHRQ5qIZu5HdkcWpt0p99cftqXD4YrrxD8W-F5r7x3DYRGv-hY0jFTvtg5Yg9Uo1o_EjJFxkoyLUKGxNiRzmh-md9-FwCQ2gfSvTVFT1Vt6J9UigpwdWFCblB-dBBYv4U9Z2S3Vi5gvBFr9WPUwDQGR2Ez5GfQQiYj3x1k, error = null, unregistered = null
01-02 10:15:50.003: D/GCMRegistrar(7609): resetting backoff for com.PushNotifications
01-02 10:15:50.003: V/GCMRegistrar(7609): Saving regId on app version 1
01-02 10:15:50.023: D/WLDroidGap(7609): WLGCMIntentService: Registered at the GCM server with registration id APA91bFg1hMAQcCZnLHRQ5qIZu5HdkcWpt0p99cftqXD4YrrxD8W-F5r7x3DYRGv-hY0jFTvtg5Yg9Uo1o_EjJFxkoyLUKGxNiRzmh-md9-FwCQ2gfSvTVFT1Vt6J9UigpwdWFCblB-dBBYv4U9Z2S3Vi5gvBFr9WPUwDQGR2Ez5GfQQiYj3x1k
01-02 10:15:50.023: V/GCMBaseIntentService(7609): Releasing wakelock
01-02 10:15:50.943: W/InputMethodManagerService(490): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@419c5618 attribute=null, token = android.os.BinderProxy@41af16b8
01-02 10:15:52.613: D/PushNotifications(7609): Request [http://192.168.16.128:10080/PushNotifications/apps/services/api/PushNotifications/android/notifications]
01-02 10:15:52.623: D/WLDroidGap(7609): Push.dispatch(): method=WL.Client.Push.__onmessage
01-02 10:15:52.793: D/PushNotifications(7609): response [http://192.168.16.128:10080/PushNotifications/apps/services/api/PushNotifications/android/notifications] success: /*-secure-
01-02 10:15:52.793: D/PushNotifications(7609): {"errors":[],"isSuccessful":true,"warnings":[],"info":[]}*/
01-02 10:15:55.593: W/InputMethodManagerService(490): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@41b721e8 attribute=null, token = android.os.BinderProxy@41af16b8

This is the android element from application-descriptor.xml file: 这是application-descriptor.xml文件中的android元素:

 <android securityTest="PushApplication-strong-mobile-securityTest" version="1.0">
        <worklightSettings include="true"/>
        <pushSender key="AIzaSyBb08MeW5jlh9bDSlpqHsgGgknT6QHiWn4" senderId="515493207294"/>
        <security>
            <encryptWebResources enabled="false"/>
            <testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>
            <publicSigningKey>Replace this text with the actual public signing key of the certificate used to sign the APK, available by using the 'Extract public signing key' wizard.</publicSigningKey>
        </security>
 </android>

I've created a browser key from Google Cloud Console. 我已经从Google Cloud Console创建了一个浏览器密钥。 I've created an android key in first place, I don't know which should I use. 我首先创建了一个Android密钥,但我不知道该使用哪个密钥。 In this case I used the browser key specifying the referers as follows: 在这种情况下,我使用浏览器键指定引荐来源,如下所示:

0E:30:5F:3A:A0:D9:A5:41:EF:FB:08:1B:7A:AC:0B:92:E1:C7:E8:33;com.PushNotifications

The device OS version is android 4.2.1 I'm using the last version available of Worklight Developer Edition. 设备操作系统版本为android 4.2.1。我正在使用Worklight Developer Edition的最新版本。 Have you any idea how to make it works? 您知道如何使它起作用吗?

Thanks. 谢谢。

Follow the set-up instructions as provided here: IBM Worklight 5.0.6.1 - Android notification does not reach either device or emulator 请按照此处提供的设置说明进行操作: IBM Worklight 5.0.6.1-Android通知未到达设备或模拟器

  • The emulator instructions are not relevant in your case 模拟器说明与您的情况无关
  • When creating the browser key , simply do Create New Key > Browser Key > Create . 创建浏览器密钥时 ,只需执行“ Create New Key > Browser Key > Create
  • Do not edit it afterwards, ie do not add anything in the "Accept requests..." section. 不要事后编辑,即不要在添加任何东西“接受请求......”一节。 In your question you mention that you do this - undo it. 在您的问题中,您提到您执行此操作-撤消操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM