This is a migrated thread and some comments may be shown as answers.

Background Push-Notification ?

3 Answers 217 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gary
Top achievements
Rank 1
Gary asked on 06 Jan 2015, 07:09 PM
Hi

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

Gary

3 Answers, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 08 Jan 2015, 12:28 PM
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.


Regards,
Anton Dobrev
Telerik
 

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

 
0
Krishna
Top achievements
Rank 1
answered on 10 Sep 2015, 01:09 PM
will you able to share the details how to send pust notification for an app using Telerik app builder ?
0
Dimitar Dimitrov
Telerik team
answered on 15 Sep 2015, 12:13 PM
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.

Regards,
Dimitar Dimitrov
Telerik
 
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
 
Tags
General Discussion
Asked by
Gary
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Krishna
Top achievements
Rank 1
Dimitar Dimitrov
Telerik team
Share this question
or