簡體   English   中英

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

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

我已從“ Woklight入門”下載了推送通知項目,並已使用正確的API密鑰和senderId將其安裝在設備中。 我已經部署了適配器,並且工作正常。 現在,我正在嘗試進行將推送通知發送到設備的測試。

我可以使用任意值登錄應用程序,對嗎? 像Username =“ Santaclaus”和Password =“ cheese”。

然后通過右鍵單擊適配器>調用過程>指定用戶名和消息來調用適配器過程,在用戶名中我將輸入“ Santaclaus”,並在消息中“ Blabla bla bla”,對嗎?

問題是當我按下“運行”按鈕時,來自Worklight Server的過程“ submitNotification”的調用結果:

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

並且控制台顯示此錯誤:

[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: {}

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

這是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>

我已經從Google Cloud Console創建了一個瀏覽器密鑰。 我首先創建了一個Android密鑰,但我不知道該使用哪個密鑰。 在這種情況下,我使用瀏覽器鍵指定引薦來源,如下所示:

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

設備操作系統版本為android 4.2.1。我正在使用Worklight Developer Edition的最新版本。 您知道如何使它起作用嗎?

謝謝。

請按照此處提供的設置說明進行操作: IBM Worklight 5.0.6.1-Android通知未到達設備或模擬器

  • 模擬器說明與您的情況無關
  • 創建瀏覽器密鑰時 ,只需執行“ Create New Key > Browser Key > Create
  • 不要事后編輯,即不要在添加任何東西“接受請求......”一節。 在您的問題中,您提到您執行此操作-撤消操作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM