Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Heroku{
- public List<Post> unpublished;
- public List<Post> getUnpublished(){
- Firebase fbase = new Firebase (FBASE_URL);
- ref.addChildEventListener(new ChildEventListener() {
- // Retrieve new posts as they are added to Firebase
- @Override
- public void onChildAdded(DataSnapshot snapshot, String previousChildKey) {
- Map<String, Object> newPost = (Map<String, Object>) snapshot.getValue();
- // push to unpublished like newpost.get...
- }
- }
- try {
- Thread.sleep(1000); //1000 milliseconds is one second.
- } catch(InterruptedException ex) {
- Thread.currentThread().interrupt();
- }
- retun unpublished;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement