Background Push-Notification ?

Thread is closed for posting
4 posts, 0 answers
  1. Gary
    Gary avatar
    1 posts
    Member since:
    Dec 2014

    Posted 06 Jan 2015 Link to this post


    I'm trying to handle a Push-Notification while my app is running in the background. Is this possible with AppBuilder?

    I've just tried using the "Telerik baas push notification" sample app and I am able to receive notifications in the foreground with no problems. If I hit the home key and send another, I don't appear to get a result.

    The idea behind this, is for my server to give the app a nudge to report back information without the user actually seeing the notification...

    Am Testing on Android 4.4.2 and using console.log in the receive handler to see if the event fires.

    Any help appreciated, thanks

  2. Anton Dobrev
    Anton Dobrev avatar
    609 posts

    Posted 08 Jan 2015 Link to this post

    Hello Gary,

    Thank you for contacting Telerik support.

    When a notification is received and the app is in the background, the event is handled by the OS - the user is notified by the OS that a notification is received (with a banner, alert, via the notification tray). Once you open the app through the notification in the tray/center/banner/alert - there is a pending event that needs to be handled in the client app. This event is not dispatched when the app is in the background until it is invoked in the foreground. Note that iOS devices have a specific behavior explained here.

    In a hybrid app this event is passed from the native code to the JavaScript code. In order to handle this event in the app you need to supply the notificationCallbackIOS/notificationCallbackAndroid so that the notification event could be handled. That is why the logic for enabling the notifications should be placed in a convenient place of the app, for example, in the "deviceready" event handler. Thus, with each start of the application you ensure that the token is refreshed, the device registration is updated and the callbacks are supplied to the native code. If there is a pending notification event - it will be dispatched immediately after the enableNotifications() is called.

    I hope that this information will be helpful for you. Do not hesitate to contact us should any further questions arise.

    Anton Dobrev

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

  3. Krishna
    Krishna avatar
    1 posts
    Member since:
    Aug 2015

    Posted 10 Sep 2015 in reply to Gary Link to this post

    will you able to share the details how to send pust notification for an app using Telerik app builder ?
  4. Dimitar Dimitrov
    Dimitar Dimitrov avatar
    26 posts

    Posted 15 Sep 2015 Link to this post

    Hello Krishna,

    In order to send push notifications, you have to use the functionality provided by the Telerik Backend Services. Here is some info about the product - link.

    The first steps in implementing push notifications in your AppBuilder project are explained very well in our Getting Started Section in the Push Notifications documentation. So my advice is to go through the docs and if you have any further questions or problems about a specific topic, feel free to share them here.

    Dimitar Dimitrov
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
Back to Top