WebIMConfig.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /**
  2. * git do not control webim.config.js
  3. * everyone should copy webim.config.js to webim.config.js
  4. * and have their own configs.
  5. * In this way , others won't be influenced by this config while git pull.
  6. *
  7. */
  8. // for react native
  9. let location = {
  10. protocol: "https"
  11. };
  12. let config = {
  13. /*
  14. * socket server
  15. */
  16. // socketServer: "wss://im-api.easemob.com/ws/", //小程序2.0sdk线上环境 请使用2.0版本sdk
  17. // socketServer: "wss://im-api-hsb.easemob.com/ws/", //小程序2.0sdk沙箱环境 请使用2.0版本sdk
  18. // socketServer: 'wss://im-api-new-hsb.easemob.com/websocket', //小程序沙箱环境
  19. socketServer: 'wss://im-api-wechat.easemob.com/websocket', //小程序线上环境
  20. // socketServer: 'wss://hk-wx.easemob.com/websocket',
  21. /*
  22. * Backend REST API URL
  23. */
  24. // apiURL: (location.protocol === 'https:' ? 'https:' : 'http:') + '//a1.easemob.com',
  25. apiURL: "https://a1.easemob.com", // 线上环境
  26. // apiURL: "https://a1-hsb.easemob.com", // 沙箱环境
  27. // apiURL: 'https://hk-test.easemob.com',
  28. /*
  29. * Application AppKey
  30. */
  31. appkey: "1160220415096727#light-application",
  32. /*
  33. * Whether to use HTTPS '1177161227178308#xcx'
  34. * @parameter {Boolean} true or false
  35. */
  36. https: false,
  37. /*
  38. * isMultiLoginSessions
  39. * true: A visitor can sign in to multiple webpages and receive messages at all the webpages.
  40. * false: A visitor can sign in to only one webpage and receive messages at the webpage.
  41. */
  42. isMultiLoginSessions: false,
  43. /**
  44. * Whether to use window.doQuery()
  45. * @parameter {Boolean} true or false
  46. */
  47. isWindowSDK: false,
  48. /**
  49. * isSandBox=true: xmppURL: 'im-api.sandbox.easemob.com', apiURL: '//a1.sdb.easemob.com',
  50. * isSandBox=false: xmppURL: 'im-api.easemob.com', apiURL: '//a1.easemob.com',
  51. * @parameter {Boolean} true or false
  52. */
  53. isSandBox: false,
  54. /**
  55. * Whether to console.log in strophe.log()
  56. * @parameter {Boolean} true or false
  57. */
  58. isDebug: true,
  59. /**
  60. * will auto connect the xmpp server autoReconnectNumMax times in background when client is offline.
  61. * won't auto connect if autoReconnectNumMax=0.
  62. */
  63. autoReconnectNumMax: 5,
  64. /**
  65. * the interval secons between each atuo reconnectting.
  66. * works only if autoReconnectMaxNum >= 2.
  67. */
  68. autoReconnectInterval: 2,
  69. /**
  70. * webrtc supports WebKit and https only
  71. */
  72. isWebRTC: false,
  73. /*
  74. * Set to auto sign-in
  75. */
  76. isAutoLogin: true,
  77. heartBeatWait: 30000,
  78. /*
  79. * 需要替换成自己的声网 appId,此 appId 有限量,仅供参考使用,同时获取声网 token 的接口仅能供此 appId 使用,换成自己的 appId 后需要自己去实现 app server 获取声网token。
  80. */
  81. AgoraAppId: '15cb0d28b87b425ea613fc46f7c9f974'
  82. };
  83. export default config;