Backendless listening to push-events

Hi Support Team,

Instead of calling an external API to update my DB, I rather want to set up a listener to receive push-events to update specific table in my DB. I tried searching support & docs but was not able to find any information on that topic. Is there a chance you can outline how to proceed here? Is it possible to implement such behaviour in a hosted service?

Thanks,
Norman

Hi, Norman!
There are 2 ways of delivering messages in Backendless: Push notifications and Pub/Sub.
You can specify the one you need by setting a PushPolicy at DeliveryOptions when publishing a message:

deliveryOptions.setPushPolicy( pushPlolicy );
Backendless.Messaging.publish(channelName, message, publishOptions, deliveryOptions);

PushPolicy is an enum with 2 options: ONLY and ALSO - the first means that the message will be delivered only as push notification and second means both push and pub/sub.
In Backendless console you can set up event listener for Publish events(if you need only Push notifications events you can check for event type inside of the eventHandler method):
http://image.prntscr.com/image/d49d5f4b460a45eab16b1843594d8538.png</img>

Hi Anatolii,

Thanks for your reply.

I am not sure if this is what I was searching for - let me share the abstract of the behaviour from the provider with you:

http://api.football-data.org/event_api

Thanks,
Norman

Hi Anatolli,

Any update on this?

Thanks a lot,
Norman

Hi Norman,

Anatolii has provided you well solution, why you do not want to use it?

Sorry if I misunderstood anything here.

The provided solution seems to be related to sending out push notifications to the existing user base.

From my perspective I need Backendless to react to requests received from another server to update my DB.

Would be great if you can confirm the provided solution can be used for that scenario. Thanks

You can create hosted service, which saves the data you need. Than you can use REST to comunicate with your service. So you have to set up another server to send requests to Backendless service.

Perfect, I´ll try that.

One more thing, which domain should the service call?

Is it api.backendless.com?

Additionally any Port or path needed?

Thanks

you should use api.backendless.com domain