Topic
  • 14 replies
  • Latest Post - ‏2012-11-09T05:08:11Z by ManojKushwaha
ManojKushwaha
ManojKushwaha
23 Posts

Pinned topic Push Notification

‏2012-11-05T12:21:03Z |
Hi,
I am trying to use Push Notification given with the documentation.what I should give in username and password column? Should it be our gmail account and password!
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Push Notification

    ‏2012-11-05T12:29:55Z  
    Hi,

    The Setup section in the Push Notification training module* states that:

    For Android,
    You need to create a Google GCM account and use the senderId and Key given to you during that process.

    For iPhone,
    You need to supply the password belonging to your push notifications-enabled certificate.
    • http://public.dhe.ibm.com/ibmdl/export/pub/software/mobile-solutions/worklight/docs/Module_41_-_Push_Notifications.pdf

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • ManojKushwaha
    ManojKushwaha
    23 Posts

    Re: Push Notification

    ‏2012-11-05T12:49:17Z  
    • IdanAdar
    • ‏2012-11-05T12:29:55Z
    Hi,

    The Setup section in the Push Notification training module* states that:

    For Android,
    You need to create a Google GCM account and use the senderId and Key given to you during that process.

    For iPhone,
    You need to supply the password belonging to your push notifications-enabled certificate.
    • http://public.dhe.ibm.com/ibmdl/export/pub/software/mobile-solutions/worklight/docs/Module_41_-_Push_Notifications.pdf

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Hi Idan,

    I have set up account in GCM. when I am giving my username and password,I am getting 4 buttons,
    1.isPushsupported
    2.isPushSubscribed
    3.Subscribe
    4.Unsubscribe

    3 and 4 are disabled.I have give my API key and sender key in application descriptor, nothing is happening even when I am deploying push adapter its displaying "No subscription found for user " message.Plz give me some suggestion how I will do.
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Push Notification

    ‏2012-11-05T15:05:30Z  
    Are you trying this on Android emulator or an actual Android device running Android OS 2.2 and above?
    Please note: testing push notification should be done on a real device, not emulator.

    I have taken module 41 and did the following:
    1. Pasted the given project ID in Google GCM as my senderId in application-descriptor.xml >> android element >> pushSender element
    2. Pasted the given API Key in Google GCM as my key in application-descriptor.xml >> android element >> pushSender element
    3. Build and deploy
    4. Launch on device

    • After login an alert showed up, stating "onReadyToSubscribe"
    • All 4 buttons were active
    • Tapping on the isPushSupported button showed an alert with "true"
    • Tapping on Subscibe following by pushing a notification to the logged-in user successfully delivered the notification

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • ManojKushwaha
    ManojKushwaha
    23 Posts

    Re: Push Notification

    ‏2012-11-06T05:50:00Z  
    • IdanAdar
    • ‏2012-11-05T13:39:54Z
    Are you trying this on Android emulator or an actual Android device running Android OS 2.2 and above?
    Please note: testing push notification should be done on a real device, not emulator.

    I have taken module 41 and did the following:
    1. Pasted the given project ID in Google GCM as my senderId in application-descriptor.xml >> android element >> pushSender element
    2. Pasted the given API Key in Google GCM as my key in application-descriptor.xml >> android element >> pushSender element
    3. Build and deploy
    4. Launch on device

    • After login an alert showed up, stating "onReadyToSubscribe"
    • All 4 buttons were active
    • Tapping on the isPushSupported button showed an alert with "true"
    • Tapping on Subscibe following by pushing a notification to the logged-in user successfully delivered the notification

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Hi Idan,
    Thanks for your reply. I did according to your process.Now all four button are activated.when I am deploying adapter by giving userId and text its giving following response :-
    {
    "isSuccessful": true,
    "result": "Notification sent to user :: username@gmail.com"
    }
    also when I am running application on my devices I getting same response in logcat.But I am not getting any notification in my device.How I will get notification in the device? In short , I am not getting what is mentioned in the documentation(I have attached the image).My device is Sony Xperia ray(version 2.3.5).
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Push Notification

    ‏2012-11-06T05:58:10Z  
    In this sample app that we provide with the Push Notifications training module, if you keep the app open while pushing a notification, what you will get is the alert pop-ups in your screen shots.

    To see the visualized "notification" in the Android notifications bar, move the app to the background by clicking on the Home button and then push a notification.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • ManojKushwaha
    ManojKushwaha
    23 Posts

    Re: Push Notification

    ‏2012-11-06T06:06:20Z  
    • IdanAdar
    • ‏2012-11-06T05:58:10Z
    In this sample app that we provide with the Push Notifications training module, if you keep the app open while pushing a notification, what you will get is the alert pop-ups in your screen shots.

    To see the visualized "notification" in the Android notifications bar, move the app to the background by clicking on the Home button and then push a notification.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Hi Idan,

    I am not getting both.But in logcat its showing notification sent to the user. what could be the problem?
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Push Notification

    ‏2012-11-06T06:20:30Z  
    Can you please explain the following?
    I am deploying adapter by giving userId and text its giving following response :
    Deploying the adapter by giving a userId?

    You should:
    1. Configure the application-descriptor.xml based on my previous comment
    2. Build and deploy application
    3. Build and deploy adapter
    4. Launch application on device
    5. Login with some username
    6. Click on the Subscribe button and make sure you receive a proper response
    7. Use the JAR file as specified in the training module in order to push the notification to the username you used to login with

    Can you please verify you have done these 7 steps?
    What did you use as the senderId and key?

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: Push Notification

    ‏2012-11-06T06:24:54Z  
    • IdanAdar
    • ‏2012-11-06T06:20:08Z
    Can you please explain the following?
    I am deploying adapter by giving userId and text its giving following response :
    Deploying the adapter by giving a userId?

    You should:
    1. Configure the application-descriptor.xml based on my previous comment
    2. Build and deploy application
    3. Build and deploy adapter
    4. Launch application on device
    5. Login with some username
    6. Click on the Subscribe button and make sure you receive a proper response
    7. Use the JAR file as specified in the training module in order to push the notification to the username you used to login with

    Can you please verify you have done these 7 steps?
    What did you use as the senderId and key?

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Also, I believe the device has to be signed in to a Google account. Is that the case on the device you are trying on?
  • ManojKushwaha
    ManojKushwaha
    23 Posts

    Re: Push Notification

    ‏2012-11-06T06:48:20Z  
    Also, I believe the device has to be signed in to a Google account. Is that the case on the device you are trying on?
    Hi Idan,

    I have done all the steps that you described on previous post. When I am tapping subscribe button its showing alert PushSubscribe_callback invoked and in console under EventSource tab shows 1 subscribed users.
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Push Notification

    ‏2012-11-06T11:11:30Z  
    Is the device registered with a Google Gmail account as suggested above?
    Any errors in LogCat?
    Is there another device to test this on?

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • ManojKushwaha
    ManojKushwaha
    23 Posts

    Re: Push Notification

    ‏2012-11-06T12:36:39Z  
    • IdanAdar
    • ‏2012-11-06T11:11:30Z
    Is the device registered with a Google Gmail account as suggested above?
    Any errors in LogCat?
    Is there another device to test this on?

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Hi Idan,

    Now its Working in that sample application provided in the documentation, but when I want to use in other apps , I am crating same adapter and when I am deploying the adapter At first its showing 'Deployed adapter successfully' then 'Deleted adapter 'PushAdapter' Successfully'.Is there any additional setting I need to do in Other apps.?
  • ManojKushwaha
    ManojKushwaha
    23 Posts

    Re: Push Notification

    ‏2012-11-07T06:37:24Z  
    • IdanAdar
    • ‏2012-11-06T11:11:30Z
    Is the device registered with a Google Gmail account as suggested above?
    Any errors in LogCat?
    Is there another device to test this on?

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Hi,

    My Push Notification is Working now.But when my device is connected with our company's wifi its not receiving notification.when I turn off wifi it receiving on my GPRS network. How it will work on wi-fi?

    Thanks,
    Manoj
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Push Notification

    ‏2012-11-07T07:01:15Z  
    Both the server and device must be able to connect to the public Internet.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • ManojKushwaha
    ManojKushwaha
    23 Posts

    Re: Push Notification

    ‏2012-11-09T05:08:11Z  
    • IdanAdar
    • ‏2012-11-07T07:01:15Z
    Both the server and device must be able to connect to the public Internet.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Hi,
    How I can send notification to multiple devices of different user?