藍鶯開發者
Web & Mini ProgramiOSAndroidC++Server API

flooim#

flooim#

flooim.flooim(config) ⇒ object#

初始化SDK

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

ParamTypeDescription
configobjectSDK初始化設定
config.appidstringAPPID
config.wsboolean連接地址前綴是否為ws/wss: true - 連接地址前綴為ws或wss, false - 連接地址前綴為http/https
config.autoLoginboolean是否自動登入
config.dnsServerstring | undefinedDNS伺服器地址, 可以不設定,預設為 https://dns.lanying.chat/v2/app_dns
config.logLevelstringSDK的日誌等級, 預設為debug, 取值為 debug、info、warn、error 或 off, 其中off為不打印日誌。

Example

const config = {
// dnsServer: "https://dns.lanying.chat/v2/app_dns",
appid: "YOUR_APP_ID",
ws: false, // uniapp版需要設定為true, web版需要設定為false
autoLogin: true
};
import flooim from 'floo-3.0.0';
const im = flooim(config);

flooim.login(opt)#

登入

Kind: static method of flooim

ParamTypeDescription
optobject
opt.namestring使用者名
opt.passwordstring密碼

flooim.qrlogin(opt)#

二維碼登入

Kind: static method of flooim

ParamTypeDescription
optobject
opt.user_idnumber使用者ID
opt.passwordstring密碼

flooim.tokenLogin(user_id, token)#

token登入

Kind: static method of flooim

ParamTypeDescription
user_idnumber使用者ID
tokenstringToken

flooim.idLogin(opt)#

使用使用者ID和密碼登入

Kind: static method of flooim

ParamTypeDescription
optobject
opt.user_idnumber使用者ID
opt.passwordstring密碼

flooim.isLogin() ⇒ boolean#

是否已登入

Kind: static method of flooim
Returns: boolean - 是否已登入
Example

flooim.on(options, ext)#

事件監聽

Kind: static method of flooim

ParamTypeDescription
optionsEvent | Object.<Event, EventCallback>可以為事件名,也可以為事件名和事件回呼
extEventCallback | undefined事件回呼,只有options為事件名時需要設定

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)#

取消監聽

Kind: static method of flooim

ParamTypeDescription
optionsEvent | Object.<Event, EventCallback>可以為事件名,也可以為事件名和事件回呼
extEventCallback | undefined事件回呼,只有options為事件名時需要設定

Example

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

flooim.logout()#

退出賬戶

Kind: static method of flooim
Example

flooim.setLogLevel(logLevel)#

設定日誌等級

Kind: static method of flooim

ParamTypeDescription
logLevelstringSDK的日誌等級, 預設為debug, 取值為 debug、info、warn、error 或 off, 其中off為不打印日誌。
自動產生的 API 內容,僅在必要位置補充精簡的 AI 解說。