[plugin] firebase

Post your completed addons to share with the community

Post » Tue Feb 16, 2016 9:41 am

Hi,

I've got the following problem with Parse. What I want to accomplish is to fetch a random user for whom the column "ready" is set to "yes". The itemtable plugin works well, and I can fetch the current user fields no problem. However this doesn't work:

Image


The notifications should display the fetched user's username (itemtable.LastFetchedItemContent("username")) but only show 0. Why is that?
B
16
S
7
G
1
Posts: 161
Reputation: 3,131

Post » Tue Feb 16, 2016 11:26 am

@pirx

Expression:LastFetchedItemContent is used after "Read by object ID".

See the "Retrieve items" section to retrieve rows -
+ (itemtable) Condition:On received
+ (itemtable) Condition:For each item
- (browser: log) (itemtable) Expression:CurItemContent
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Tue Feb 16, 2016 12:08 pm

Having some trouble querying by value. I keep getting this error:

Image
http://postimg.org/image/ijdesneq1

Here's the code I'm using (see 3rd image that define variable names):

Image
http://postimg.org/image/rsrflnxij

Here's the firebase data:

Image
http://postimg.org/image/rakdnjhxj

Any ideas? Thanks.
B
17
S
2
Posts: 88
Reputation: 1,503

Post » Tue Feb 16, 2016 1:17 pm

@hmott

Update rex_firebase_query plugin, and
Here is a sample capx, remember fill your firebase url in "BASE" constant value.
I only could prove this order by value is worked, but I don't know why it is failed in your case, this bug should not appear imo.
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Tue Feb 16, 2016 4:25 pm

rexrainbow wrote:@pirx

Expression:LastFetchedItemContent is used after "Read by object ID".

See the "Retrieve items" section to retrieve rows -
+ (itemtable) Condition:On received
+ (itemtable) Condition:For each item
- (browser: log) (itemtable) Expression:CurItemContent


Thank you @rexrainbow, it works great!
B
16
S
7
G
1
Posts: 161
Reputation: 3,131

Post » Tue Feb 16, 2016 5:29 pm

rexrainbow wrote:@hmott

Update rex_firebase_query plugin, and
Here is a sample capx, remember fill your firebase url in "BASE" constant value.
I only could prove this order by value is worked, but I don't know why it is failed in your case, this bug should not appear imo.


I don't understand... I updated the plugin and tried the sample file you provided.

The only thing I changed was the BASE url like you instructed. Writing to my database from your sample file works, but the query function is in error.

Image

Here's the code that makes the error:

Image

Does it work for you?

*** Update ***

I've been able to get it to work if searching for the key ("a" through "d" in your example). Also, adding the "Data is null" condition triggers correctly when searching for non-existing key "e", for example.

Attached is a screenshot of what does work (when BASE url filled in: https://<appname>.firebaseio.com).

Image
http://postimg.org/image/4mh8nxv6r

This is good enough for me. Even if I can't search for value, I can at least define and search for the key whether it exists or not. I can then use another query call to get the value if needed.

Thanks again for your help.
Last edited by hmott on Wed Feb 17, 2016 5:51 pm, edited 1 time in total.
B
17
S
2
Posts: 88
Reputation: 1,503

Post » Wed Feb 17, 2016 2:28 am

@hmott

Could you paste the error message of using "order by value"? Is it the same as previous testing from your post?
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Wed Feb 17, 2016 5:51 pm

rexrainbow wrote:@hmott

Could you paste the error message of using "order by value"? Is it the same as previous testing from your post?


I've updated the post with the error and the code that creates it. Hope it helps.
B
17
S
2
Posts: 88
Reputation: 1,503

Post » Thu Feb 18, 2016 4:11 am

@hmott

Try re-download rex_firebase plugin again. I am not sure why the function could not be found in your environment.
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Thu Feb 18, 2016 5:43 pm

rexrainbow wrote:@hmott

Try re-download rex_firebase plugin again. I am not sure why the function could not be found in your environment.


That did it!

Thanks!
B
17
S
2
Posts: 88
Reputation: 1,503

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests