Is it possible to use the REST API to push an event to a list (via an HTTP POST) and also specify the priority of the item that is being pushed? Perhaps as a field in the JSON I am posting somehow?
Something like this (semi-pseudo-code):
var myObj = {name: 'My Name', address: 'My Address'};
myObj['priority'] = 123;
$.post('http://demo.firebase.com/demo/testing.json', myObj);
I can do it the following way with the native Javascript library but this does not use the REST API:
var fb = new Firebase('http://demo.firebase.com/demo/testing');
var foo = fb.push({name: 'My Name', address: 'My Address'});
foo.setPriority(1);
We can use any Firebase Realtime Database URL as a REST endpoint. All we need to do is append . json to the end of the URL and send a request from our favorite HTTPS client.
Firebase Cloud Messaging (FCM) provides a reliable and battery-efficient connection between your server and devices that allows you to deliver and receive messages and notifications on iOS, Android, and the web at no cost.
Yes! To post data with a priority, you can use:
var myObj = JSON.stringify({name: 'My Name', address: 'My Address', '.priority': 123});
$.post('http://demo.firebase.com/demo/testing.json', myObj);
If you want to post a raw value (e.g. "hello") with a priority, use:
var myObj = JSON.stringify({'.value': 'hello', '.priority': 123});
$.post('http://demo.firebase.com/demo/testing.json', myObj);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With