1/*! For license information please see fc10631c.5a08a2d6.js.LICENSE.txt */ 2"use strict";(globalThis.webpackChunkopenim_docs=globalThis.webpackChunkopenim_docs||[]).push([[3696],{15202(e,n,t){t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>a,default:()=>u,frontMatter:()=>i,metadata:()=>s,toc:()=>o});const s=JSON.parse('{"id":"callback/onUserStatusChanged","title":"onUserStatusChanged","description":"Description","source":"@site/i18n/en/docusaurus-plugin-content-docs-sdks/current/callback/onUserStatusChanged.md","sourceDirName":"callback","slug":"/callback/onUserStatusChanged","permalink":"/sdks/callback/onUserStatusChanged","draft":false,"unlisted":false,"editUrl":"https://github.com/OpenIMSDK/docs/tree/main/docs/sdks/callback/onUserStatusChanged.md","tags":[],"version":"current","lastUpdatedAt":1773123673000,"sidebarPosition":3,"frontMatter":{"sidebar_position":3,"toc_min_heading_level":2,"toc_max_heading_level":2},"sidebar":"tutorialSidebar","previous":{"title":"onTotalUnreadMessageCountChanged","permalink":"/sdks/callback/onTotalUnreadMessageCountChanged"},"next":{"title":"onConnectFailed","permalink":"/sdks/callback/onConnectFailed"}}');var r=t(86070),l=t(81753);const i={sidebar_position:3,toc_min_heading_level:2,toc_max_heading_level:2},a="onUserStatusChanged",d={},o=[{value:"Description",id:"description",level:2},{value:"Return Prototype",id:"return-prototype",level:3},{value:"Return Results",id:"return-results",level:3},{value:"Return Prototype",id:"return-prototype-1",level:3},{value:"Return Results",id:"return-results-1",level:3},{value:"Return Prototype",id:"return-prototype-2",level:3},{value:"Return Results",id:"return-results-2",level:3},{value:"Return Prototype",id:"return-prototype-3",level:3},{value:"Call Example",id:"call-example",level:3},{value:"Return Results",id:"return-results-3",level:3},{value:"Return Prototype",id:"return-prototype-4",level:3},{value:"Return Results",id:"return-results-4",level:3},{value:"Call Example",id:"call-example-1",level:3},{value:"Return Prototype",id:"return-prototype-5",level:3},{value:"Return Results",id:"return-results-5",level:3}];function c(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,l.R)(),...e.components},{TabItem:t,Tabs:s}=n;return t||h("TabItem",!0),s||h("Tabs",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"onuserstatuschanged",children:"onUserStatusChanged"})}),"\n",(0,r.jsx)(n.h2,{id:"description",children:"Description"}),"\n",(0,r.jsx)(n.admonition,{type:"info",children:(0,r.jsx)(n.p,{children:"Triggered when the online status of subscribed users changes."})}),"\n",(0,r.jsxs)(s,{groupId:"sdks-language",values:[{label:"iOS",value:"iOS"},{label:"Android",value:"Android"},{label:"Flutter",value:"Flutter"},{label:"uni-app",value:"uni-app"},{label:"Browser/Electron/MiniProgram",value:"Web"},{label:"Unity",value:"Unity"}],children:[(0,r.jsxs)(t,{value:"Flutter",children:[(0,r.jsx)(n.h3,{id:"return-prototype",children:"Return Prototype"}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-dart",metastring:"showLineNumbers",children:" Function(UserStatusInfo info)? onUserStatusChanged;\n"})}),(0,r.jsx)(n.h3,{id:"return-results",children:"Return Results"}),(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"info"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.a,{href:"/sdks/class/user/userStatusInfo",children:"UserStatusInfo"})}),(0,r.jsx)(n.td,{children:"User status info"})]})})]})]}),(0,r.jsxs)(t,{value:"iOS",children:[(0,r.jsx)(n.h3,{id:"return-prototype-1",children:"Return Prototype"}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-swift",metastring:"showLineNumbers",children:"\n- (void)onUserStatusChanged:(OIMUserStatusInfo *)info;\n\n"})}),(0,r.jsx)(n.h3,{id:"return-results-1",children:"Return Results"}),(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"info"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.a,{href:"/sdks/class/user/userStatusInfo",children:"OIMUserStatusInfo"})}),(0,r.jsx)(n.td,{children:"User status info"})]})})]})]}),(0,r.jsxs)(t,{value:"Android",children:[(0,r.jsx)(n.h3,{id:"return-prototype-2",children:"Return Prototype"}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-java",metastring:"showLineNumbers",children:" void onUserStatusChanged(UsersOnlineStatus onlineStatus)\n"})}),(0,r.jsx)(n.h3,{id:"return-results-2",children:"Return Results"}),(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"info"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.a,{href:"/sdks/class/user/userStatusInfo",children:"onlineStatus"})}),(0,r.jsx)(n.td,{children:"User profile information"})]})})]})]}),(0,r.jsxs)(t,{value:"Web",children:[(0,r.jsx)(n.h3,{id:"return-prototype-3",children:"Return Prototype"}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",metastring:"showLineNumbers",children:"\nenum OnlineState {\n Online = 1,\n Offline = 0,\n}\ntype UserOnlineState = {\n platformID: Platform;\n status: OnlineState;\n userID: string;\n};\nonUserStatusChanged(data: WSEvent<UserOnlineState>): void;\n\n"})}),(0,r.jsx)(n.h3,{id:"call-example",children:"Call Example"}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:"showLineNumbers",children:"import { getSDK } from '@openim/wasm-client-sdk';\nconst IMSDK = getSDK();\n\n// use in electron with ffi\n// import { getWithRenderProcess } from '@openim/electron-client-sdk/lib/render';\n// const { instance: IMSDK } = getWithRenderProcess();\n\n// use in mini program\n// import { getSDK } from '@openim/client-sdk';\n// const IMSDK = getSDK();\n\nIMSDK.on(\n CbEvents.OnUserStatusChanged,\n ({ data }) => {}\n);\n"})}),(0,r.jsx)(n.h3,{id:"return-results-3",children:"Return Results"}),(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"data"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.a,{href:"/sdks/class/response",children:"WSEvent"})}),(0,r.jsx)(n.td,{children:"-"})]})})]})]}),(0,r.jsxs)(t,{value:"uni-app",children:[(0,r.jsx)(n.h3,{id:"return-prototype-4",children:"Return Prototype"}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",metastring:"showLineNumbers",children:"\nenum OnlineState {\n Online = 1,\n Offline = 0,\n}\ntype UserOnlineState = {\n platformID: Platform;\n status: OnlineState;\n userID: string;\n};\nonUserStatusChanged(data: WSEvent<UserOnlineState>): void;\n\n"})}),(0,r.jsx)(n.h3,{id:"return-results-4",children:"Return Results"}),(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"data"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.a,{href:"/sdks/class/response",children:"WSEvent"})}),(0,r.jsx)(n.td,{children:"-"})]})})]}),(0,r.jsx)(n.h3,{id:"call-example-1",children:"Call Example"}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",metastring:"showLineNumbers",children:"import IMSDK from 'openim-uniapp-polyfill';\n\nIMSDK.subscribe(\n IMSDK.IMEvents.OnUserStatusChanged,\n ({ data }: WSEvent<UserOnlineState>) => {}\n);\n"})})]}),(0,r.jsxs)(t,{value:"Unity",children:[(0,r.jsx)(n.h3,{id:"return-prototype-5",children:"Return Prototype"}),(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-C#",metastring:"showLineNumbers",children:"void OnUserStatusChanged(OnlineStatus userOnlineStatus);\n"})}),(0,r.jsx)(n.h3,{id:"return-results-5",children:"Return Results"}),(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Name"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"userOnlineStatus"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.a,{href:"/sdks/class/user/userStatusInfo",children:"OnlineStatus"})}),(0,r.jsx)(n.td,{children:"User status info"})]})})]})]})]})]})}function u(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}function h(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},77462(e,n,t){var s=t(30758),r=Symbol.for("react.element"),l=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=s.__SECRET_INT
2ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function o(e,n,t){var s,l={},o=null,c=null;for(s in void 0!==t&&(o=""+t),void 0!==n.key&&(o=""+n.key),void 0!==n.ref&&(c=n.ref),n)i.call(n,s)&&!d.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:r,type:e,key:o,ref:c,props:l,_owner:a.current}}n.Fragment=l,n.jsx=o,n.jsxs=o},86070(e,n,t){e.exports=t(77462)},81753(e,n,t){t.d(n,{R:()=>i,x:()=>a});var s=t(30758);const r={},l=s.createContext(r);function i(e){const n=s.useContext(l);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),s.createElement(l.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.