Rex's plugins for Construct2
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About

rex_firebase_userid2id

Plugin, ACE table, Discussion thread
Dependence: 
rex_firebase_apiV3


Introduction
Mapping between UserID and another alias ID.

Usage
Concept
UserID provided after
authentication might be too long to remember or to send to friends. A possible solution is to provide a alias ID which could be a string of some random digital numbers, or a user-defined string.

Set alias ID
There are two ways to set alias ID -
  • "Action:Get random ID", to set random number string if alias ID is not existed, and return this alias ID (Sample capx, sample capx-V3)
  • "Action:Try set ID", to set user-input string (Sample capx, sample capx-V3)
"Condition:On request ID successfully" will be triggered if successful, get result alias ID by "Expression:ID".
Otherwise "Condition:On request ID failed" will be triggered.
Get alias ID by UserID
Call "
Action:Get ID" to get alias ID without any addition set.
"Condition:On request ID successfully" will be triggered if successful, get result alias ID by "Expression:ID".
Otherwise "
Condition:On request ID failed" will be triggered,

Get UserID by alias ID
Call "
Action:Get user ID" to get UserID by alias ID. "Condition:On request User ID successfully" will be triggered if found UserID - alias ID record, get result USerID by "Expression:UserID".
Otherwise "Condition:On request User ID failed" will be triggered.

Add rule of data indexing
To improve the querying performance of this plugin, user could add { ".indexOn": ".value" } at page of "Security & Rules". For example , assume that sub domain is "UserID-ID", then the content of Firebase Rules  at page of "Security & Rules" would be
{  
    "rules": {
        ".read": true,
        ".write": true,
               
        "UserID-ID": {
            ".indexOn": ".value"
        }        
    }  
}
 A FIREBASE WARNING would be displayed in console if the defining of data indexing had not been added.

Create a free web site with Weebly
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About