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.lanyingim.com/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.lanyingim.com/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);
{% lanying_code_snippet repo="lanying-im-web",class="",function="flooim" %}{% endlanying_code_snippet %}

flooim.login(opt)#

Login

Kind: static method of flooim

ParamTypeDescription
optobject
opt.namestringUsername
opt.passwordstringPassword

Example

{% lanying_code_snippet repo="lanying-im-web",class="im",function="login" %}{% endlanying_code_snippet %}

flooim.qrlogin(opt)#

QR code login

Kind: static method of flooim

ParamTypeDescription
optobject
opt.user_idnumberUser ID
opt.passwordstringPassword

Example

{% lanying_code_snippet repo="lanying-im-web",class="im",function="qrlogin" %}{% endlanying_code_snippet %}

flooim.tokenLogin(user_id, token)#

token login

Kind: static method of flooim

ParamTypeDescription
user_idnumberUser ID
tokenstringToken

Example

{% lanying_code_snippet repo="lanying-im-web",class="im",function="tokenLogin" %}{% endlanying_code_snippet %}

flooim.idLogin(opt)#

Login with user ID and password

Kind: static method of flooim

ParamTypeDescription
optobject
opt.user_idnumberUser ID
opt.passwordstringPassword

Example

{% lanying_code_snippet repo="lanying-im-web",class="im",function="idLogin" %}{% endlanying_code_snippet %}

flooim.isLogin() ⇒ boolean#

Logged in or not

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

{% lanying_code_snippet repo="lanying-im-web",class="im",function="isLogin" %}{% endlanying_code_snippet %}

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
   },
   ...
 })
{% lanying_code_snippet repo="lanying-im-web",class="im",function="on" %}{% endlanying_code_snippet %}

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
   },
 ...
 })
{% lanying_code_snippet repo="lanying-im-web",class="im",function="off" %}{% endlanying_code_snippet %}

flooim.logout()#

Log out

Kind: static method of flooim
Example

{% lanying_code_snippet repo="lanying-im-web",class="im",function="logout" %}{% endlanying_code_snippet %}

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.

Example

{% lanying_code_snippet repo="lanying-im-web",class="im",function="setLogLevel" %}{% endlanying_code_snippet %}
Generated API content with concise AI notes where context helps.