Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions extensions/community/FirebaseNumberType.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"author": "",
"category": "Network",
"extensionNamespace": "",
"fullName": "Firebase",
"gdevelopVersion": "",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZpcmViYXNlIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTIwLDE4LjY5TDEyLjcsMjIuNzRDMTIuMiwyMyAxMS43LDIzIDExLjIsMjIuNzRMNCwxOC42OUwxNy4wNSw1LjU0TDE3LjQsNS40NEMxNy43LDUuNDQgMTcuODcsNS41NyAxNy45LDUuODRMMjAsMTguNjlNOS4zNSw1Ljc0TDQuOCwxMy4yOUw2LjcsMS4zNEM2LjczLDEuMDcgNi45LDAuOTQgNy4yLDAuOTRDNy40LDAuOTQgNy41MywxIDcuNiwxLjE5TDkuNzUsNS4xNEw5LjM1LDUuNzRNMTMuODUsN0w0LjMsMTYuNTlMMTEuNTUsNC4yOUMxMS42NSw0LjA5IDExLjgsNCAxMiw0QzEyLjIsNCAxMi4zMyw0LjA5IDEyLjQsNC4yOUwxMy44NSw3WiIgLz48L3N2Zz4=",
"name": "FirebaseNumberType",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/ee5e58c7db038efea3f7696e4d3433746814bc34497a148068522da45176c121_firebase.svg",
"shortDescription": "Update a field of a docment with a number type instead of a string.",
"version": "0.1.0",
"description": "This functions exactly the same as the original \"Update a field\" built in function, but this sends a number instead of a string. The built in update function forced you to send strings only which then requires you convert types when you read back from the database. Now you can just send numbers, no conversion needed. ",
"tags": [
"firebase",
"network"
],
"authorIds": [
"3L4MIEb0WdbHratJYzkq1pFqZfw2"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [
{
"description": "Update Firebase Field with Number since the built in function seems to take your number and send it as a string.",
"fullName": "Update a number field of a document",
"functionType": "Action",
"group": "Cloud Firestore Database/Fields",
"name": "FirebaseUpdateNumber",
"sentence": "Update field _PARAM1_ of firestore document _PARAM2_ in collection _PARAM3_ with the number _PARAM4_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const num = eventsFunctionContext.getArgument(\"num\");",
"const db = firebase.firestore();",
"const doc = eventsFunctionContext.getArgument(\"doc\");",
"const col = eventsFunctionContext.getArgument(\"col\");",
"const docRef = db.doc(col+\"/\"+doc);",
"const field = eventsFunctionContext.getArgument(\"field\");",
"docRef.update({[field]: num})"
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "Field",
"name": "field",
"type": "string"
},
{
"description": "Document",
"name": "doc",
"type": "string"
},
{
"description": "Collection",
"name": "col",
"type": "string"
},
{
"description": "Number",
"name": "num",
"type": "expression"
}
],
"objectGroups": []
}
],
"eventsBasedBehaviors": [],
"eventsBasedObjects": []
}