Skip to content

feat(android): initial Android version#8

Merged
hansemannn merged 9 commits into
hansemannn:masterfrom
m1ga:android
Apr 14, 2023
Merged

feat(android): initial Android version#8
hansemannn merged 9 commits into
hansemannn:masterfrom
m1ga:android

Conversation

@m1ga

@m1ga m1ga commented Dec 12, 2021

Copy link
Copy Markdown
Collaborator

This is just a very basic start!

FirebaseDatabase:

  • getReference(); - path, url
  • firebaseServerTimestamp

DatabaseReference:

  • child() - idenfier, path/url
  • childByAutoId() - path
  • setValue(Object), setValue(Object, Callback)
  • removeValue
  • goOffline
  • goOnline
  • event: value (e.key,e.value)
  • updateChildValues
  • setPriority(object, callback)
  • keepSynced(boolean)

Firestore Databse:

  • read data with queryFirestore({collection, [document])
  • event: query

firebase.database-android-1.0.0.zip

@m1ga m1ga marked this pull request as draft December 12, 2021 15:05
@m1ga

m1ga commented Feb 17, 2022

Copy link
Copy Markdown
Collaborator Author

able to push data with auto id now! Example works now on Android, although it complains on iOS that FirebaseDatabase.getReference() is not allowed without an argument.

Screenshot_20220217_125028

@hansemannn

hansemannn commented Feb 17, 2022

Copy link
Copy Markdown
Owner

@m1ga iOS requires an object with at least one of these keys:

  NSString *identifier = [arguments objectForKey:@"identifier"];
  NSString *path = [arguments objectForKey:@"path"];
  NSString *url = [arguments objectForKey:@"url"];
  NSArray *observableEvents = [arguments objectForKey:@"observableEvents"];

@hansemannn

Copy link
Copy Markdown
Owner

Fixed as part of 3c98b58

@m1ga

m1ga commented Feb 17, 2022

Copy link
Copy Markdown
Collaborator Author

@hansemannn nice 👍 will test that later

@m1ga

m1ga commented Feb 19, 2022

Copy link
Copy Markdown
Collaborator Author
  • setPriority
  • keepSynced
  • updateChildValues
  • setValue(data, callback)

@hansemannn

Copy link
Copy Markdown
Owner

@m1ga Anything I should change / add on iOS as well?

@m1ga

m1ga commented Feb 19, 2022

Copy link
Copy Markdown
Collaborator Author

At the moment I try to match the iOS version. Still have to find my way around it to see what url/path does and where I need to store what 😄
It's working but I need to check if both plugins store it in the same places

@hansemannn

Copy link
Copy Markdown
Owner

@m1ga Is this ready for review? I am adding Firestore as well, so I found this one

@m1ga

m1ga commented Sep 22, 2022

Copy link
Copy Markdown
Collaborator Author

oh, have to test that again. It worked but I'm not sure if it stored the data the same way as iOS did.

@m1ga m1ga marked this pull request as ready for review September 23, 2022 13:55
@m1ga

m1ga commented Sep 23, 2022

Copy link
Copy Markdown
Collaborator Author

updated the library and fixed some issues I had with having new "child in child" items all the time.

Only did some smaller tests and the data is there
Screenshot_20220923_151721
I'm getting live updates/events and can add, update and delete items.

So if you have some test case I would love to get some feedback if the structure is right at the end

@m1ga

m1ga commented Apr 14, 2023

Copy link
Copy Markdown
Collaborator Author

Since I had to use it with Firestore Database today:

FirebaseDatabase.queryFirestore({
	collection: "collection",
	// document: "documentId"  // only one document - otherwise whole collection
});

FirebaseDatabase.addEventListener("query", function(e) {
	console.log(e.data);
});

will return an array of id: "", data: "..." where data is a JSON string.

firebase.database-android-1.0.0.zip

no other options yet, but reading works. Keep it in this module (since it is just called database) or should we create a firestore-database spin-off?

@hansemannn

Copy link
Copy Markdown
Owner

Let's start with this one and iterate from there :)

@hansemannn hansemannn merged commit 9e46fc8 into hansemannn:master Apr 14, 2023
@m1ga m1ga deleted the android branch April 14, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants