WebIMConfig.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // 'use strict'
  2. /**
  3. * git do not control webim.config.js
  4. * everyone should copy webim.config.js.demo to webim.config.js
  5. * and have their own configs.
  6. * In this way , others won't be influenced by this config while git pull.
  7. *
  8. */
  9. // for react native
  10. let location = {
  11. protocol: 'https'
  12. }
  13. let config = {
  14. /*
  15. * XMPP server
  16. */
  17. xmppURL: 'im-api.easemob.com',
  18. // xmppURL: '172.17.2.139:5280',
  19. /*
  20. * Backend REST API URL
  21. */
  22. // apiURL: (location.protocol === 'https:' ? 'https:' : 'http:') + '//a1.easemob.com',
  23. // ios must be https!!! by lwz
  24. apiURL: 'https://a1.easemob.com',
  25. // apiURL: (location.protocol === 'https:' ? 'https:' : 'http:') + '//172.17.3.155:8080',
  26. /*
  27. * Application AppKey
  28. */
  29. appkey: 'yubo725#rnwechat',
  30. /*
  31. * Whether to use HTTPS
  32. * @parameter {Boolean} true or false
  33. */
  34. https: true,
  35. /*
  36. * isMultiLoginSessions
  37. * true: A visitor can sign in to multiple webpages and receive messages at all the webpages.
  38. * false: A visitor can sign in to only one webpage and receive messages at the webpage.
  39. */
  40. isMultiLoginSessions: false,
  41. /**
  42. * Whether to use window.doQuery()
  43. * @parameter {Boolean} true or false
  44. */
  45. isWindowSDK: false,
  46. /**
  47. * isSandBox=true: xmppURL: 'im-api.sandbox.easemob.com', apiURL: '//a1.sdb.easemob.com',
  48. * isSandBox=false: xmppURL: 'im-api.easemob.com', apiURL: '//a1.easemob.com',
  49. * @parameter {Boolean} true or false
  50. */
  51. isSandBox: false,
  52. /**
  53. * Whether to console.log in strophe.log()
  54. * @parameter {Boolean} true or false
  55. */
  56. isDebug: true,
  57. /**
  58. * will auto connect the xmpp server autoReconnectNumMax times in background when client is offline.
  59. * won't auto connect if autoReconnectNumMax=0.
  60. */
  61. autoReconnectNumMax: 2,
  62. /**
  63. * the interval secons between each atuo reconnectting.
  64. * works only if autoReconnectMaxNum >= 2.
  65. */
  66. autoReconnectInterval: 2,
  67. /**
  68. * webrtc supports WebKit and https only
  69. */
  70. isWebRTC: /WebKit/.test(navigator.userAgent) && /^https\:$/.test(window.location.protocol),
  71. /*
  72. * Set to auto sign-in
  73. */
  74. isAutoLogin: true
  75. }
  76. export default config