IBM Worklight 5.0.6.1 - Android notification does not reach either device or emulator

前端 未结 1 766
走了就别回头了
走了就别回头了 2020-12-07 06:18

I followed all steps as given in the Push Notifications training module, as well as in this Stack Overflow question: IBM Worklight - Push Notifications feature does not work

相关标签:
1条回答
  • 2020-12-07 06:36

    I have successfully used the Push Notifications sample application on an AVD running Android 4.3.

    Worklight setup:

    1. Imported the sample
    2. Replaced the API Key and senderId in application-descriptor.xml with the API Key and Project Number from the Google GCM console
      • Note: for API Key make sure you generate a browser key (Google documentation)
    3. Added android:targetSdkVersion="18" in yourApp\android\native\AndroidManifest.xml in the line:

      <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" />

    4. Built and deployed the app and adapter

    5. Right-clicked the generated Android project > Properties > Android and changed the Build Target to Android 4.3

    AVD setup:

    1. Make sure that in the Android SDK Manager you have installed from the Extras section both the Google Cloud Messaging for Android Library as well as Google Play services
    2. Make sure to install the appropriate Google APIs for the API Level you are using in your AVD
    3. Make sure to install the Android image for the API Level you are using in your AVD
    4. Make sure to use this Google API as the Target for your AVD:

      enter image description here

    After that I have:

    1. Launched the app in the AVD
    2. Logged in with "idan"
    3. Tapped the "Subscribe" button
    4. Made sure I am indeed subscribed ("isSubscribed" button") and able to receive notifications ("isPushSupported" button)
    5. Right-clicked on the PushAdapter folder and chose Run As > Invoke Worklight Procedure
    6. Used the parameters: "idan","test message"

    The notification was received in the AVD both when the app is open (the expected alerts were displayed) as well as closed (notification was displayed in the notification bar. Tapping it opened the app and after logging in the expected alerts were displayed).

    0 讨论(0)
提交回复
热议问题