[plugin] firebase

Post your completed addons to share with the community

Post » Mon May 11, 2015 1:25 pm

@amkp

You can use following plugin.
Phonegap FileTransfer: download or upload file to your server. (http file download and upload)

see more: https://plus.google.com/102658703990850 ... QceTB8MGfs

@rexrainbow

Thanks
Sang Ki Kwon
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Mon May 11, 2015 1:44 pm

@rexrainbow @cranberrygame

I put your answers in the original post, to keep this one clean :)
how-do-i-download-file-image-in-c2-file-folder_t130103
B
18
S
4
Posts: 83
Reputation: 2,083

Post » Mon May 11, 2015 3:02 pm

@amkp

Sure, you also could pack them in your template.
Just tells me your goods, so that I could put them into my list.
B
108
S
26
G
259
Posts: 4,430
Reputation: 145,679

Post » Fri May 15, 2015 7:50 pm

@rexrainbow:
Thanks to your fantastic plugins I am able to create nice apps.

Anyway I think the following in the firebase runtime.js code
should be:
Code: Select all
    Acts.prototype.SetValueOnDisconnect = function (k, v)
   {
       this.get_ref(k)["onDisconnect"]()["set"](JSON.parse(v));
   };   

    Acts.prototype.UpdateJSONOnDisconnect = function (k, v)
   {
       this.get_ref(k)["onDisconnect"]()["update"](JSON.parse(v));
   };   


notice the JSON.parse (easy catch)
B
3
Posts: 7
Reputation: 191

Post » Sat May 16, 2015 6:47 am

@stefan52a

Thanks, I had fixed it.

Since "SetValueOnDisconnect" is used to assign a number/string value. It does not need to parse JSON.
B
108
S
26
G
259
Posts: 4,430
Reputation: 145,679

Post » Sat May 16, 2015 8:20 am

@rexrainbow:

Is this also true for

Code: Select all
UpdateJSONOnDisconnect


?

i.e. I think this does need to parse JSON
B
3
Posts: 7
Reputation: 191

Post » Sat May 16, 2015 9:16 am

@stefan52a

Yes, I had fixed it. Replace "v" to "JSON.parse(v)".
B
108
S
26
G
259
Posts: 4,430
Reputation: 145,679

Post » Mon May 18, 2015 2:00 pm

hello @rexrainbow

about Parse->FileUpload, Parse->ItemTable

Do you think you can to add a tag ?
-> On Upload "tag" complete
->On Save "tag" complete
B
18
S
4
Posts: 83
Reputation: 2,083

Post » Mon May 18, 2015 3:09 pm

@amkp

Here is a solution to simulate "tag" mechanism:
1. put a private string variable named "tag"
2. create an item table instance before saving request ( or other kinds of request )
3. set the private variable "tag"
4. do saving request ( or other kinds of request ) of item table
5. in OnSaveComplete condition of item table, add "compare instance variable condition" to compare "tag" variable.
6. destroy item table instance while request is finished if necessary.

User could put other private variables to carry data for each request. Each request is owned by a dedicate instance.
The motivation of this solution is - it might need carry some variables/parameter for each handler of request.

How about this solution?
B
108
S
26
G
259
Posts: 4,430
Reputation: 145,679

Post » Mon May 18, 2015 4:49 pm

@rexrainbow
Great, I think this solution will be ok, thanks.
B
18
S
4
Posts: 83
Reputation: 2,083

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests