LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

flooim#

flooim#

flooim.flooim(config) ⇒ object#

InitializationSDK

Kind: static method of flooim
Returns: object - flooim object

ParamTypeDescription
configobjectSDK initialization settings
config.appidstringAPPID
config.wsbooleanWhether the connection address is prefixed with ws/wss: ture - the connection address is prefixed with ws or wss; false - the connection address is prefixed with http/https
config.autoLoginbooleanWhether to login automatically
config.dnsServerstring | undefinedDNS server address, can be empty, default https://dns.lanying.chat/v2/app_dns
config.logLevelstringThe log level of the SDK, the default is debug, and the value can be debug, info, warn, error or off, where off means no log is printed.

Example

const config = {
// dnsServer: "https://dns.lanying.chat/v2/app_dns",
appid: "YOUR_APP_ID",
ws: false, // The uniapp version needs to be set to true, the web version needs to be set to false
autoLogin: true
};
import flooim from 'floo-3.0.0';
const im = flooim(config);

flooim.login(opt)#

Login

Kind: static method of flooim

ParamTypeDescription
optobject
opt.namestringUsername
opt.passwordstringPassword

flooim.qrlogin(opt)#

QR code login

Kind: static method of flooim

ParamTypeDescription
optobject
opt.user_idnumberUser ID
opt.passwordstringPassword

flooim.tokenLogin(user_id, token)#

token login

Kind: static method of flooim

ParamTypeDescription
user_idnumberUser ID
tokenstringToken

flooim.idLogin(opt)#

Login with user ID and password

Kind: static method of flooim

ParamTypeDescription
optobject
opt.user_idnumberUser ID
opt.passwordstringPassword

flooim.isLogin() ⇒ boolean#

Logged in or not

Kind: static method of flooim
Returns: boolean - Logged in or not
Example

flooim.on(options, ext)#

Event listening

Kind: static method of flooim

ParamTypeDescription
optionsEvent | Object.<Event, EventCallback>Can be event name, and also event name plus event callback
extEventCallback | undefinedEvent callback, only required if options is set as event name

Example

const im = flooim(config);
im.on('event', (ret) => {
   //do something with ret
 })
 // or
im.on({
   eventName: (ret) => {
     //do something with ret
   },
   ...
 })

flooim.off(options, ext)#

Unlisten

Kind: static method of flooim

ParamTypeDescription
optionsEvent | Object.<Event, EventCallback>Can be event name, and also event name plus event callback
extEventCallback | undefinedEvent callback, only required if options is set as event name

Example

const im = flooim(config);
 im.off('events', (ret) => {
   //do something with ret
 })
 // or
 im.off({
   eventName: (ret) => {
     //do something with ret
   },
 ...
 })

flooim.logout()#

Log out

Kind: static method of flooim
Example

flooim.setLogLevel(logLevel)#

set log level

Kind: static method of flooim

ParamTypeDescription
logLevelstringThe log level of the SDK, the default is debug, and the value can be debug, info, warn, error or off, where off means no log is printed.
Generated API content with concise AI notes where context helps.