@100mslive/react-native-hms 1.9.2 → 1.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/README.md +5 -1
  2. package/android/local.properties +8 -1
  3. package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +20 -9
  4. package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +72 -13
  5. package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +63 -8
  6. package/ios/HMSDecoder.swift +1 -3
  7. package/ios/HMSHelper.swift +2 -2
  8. package/ios/HMSRNSDK.swift +23 -7
  9. package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  10. package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  11. package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/jatinnagar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  12. package/ios/Hmssdk.xcodeproj/xcuserdata/jatinnagar.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  13. package/lib/commonjs/classes/HMSCameraControl.js +1 -1
  14. package/lib/commonjs/classes/HMSCameraControl.js.map +1 -1
  15. package/lib/commonjs/classes/HMSEncoder.js +1 -1
  16. package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
  17. package/lib/commonjs/classes/HMSNativeEventListener.js +1 -1
  18. package/lib/commonjs/classes/HMSNativeEventListener.js.map +1 -1
  19. package/lib/commonjs/classes/HMSPeerListIterator.js +1 -1
  20. package/lib/commonjs/classes/HMSPeerListIterator.js.map +1 -1
  21. package/lib/commonjs/classes/HMSPeersCache.js +1 -1
  22. package/lib/commonjs/classes/HMSPeersCache.js.map +1 -1
  23. package/lib/commonjs/classes/HMSRoomCache.js +1 -1
  24. package/lib/commonjs/classes/HMSRoomCache.js.map +1 -1
  25. package/lib/commonjs/classes/HMSSDK.js +1 -8
  26. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  27. package/lib/commonjs/classes/HMSSessionStore.js +1 -1
  28. package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
  29. package/lib/commonjs/index.js +11 -2
  30. package/lib/commonjs/index.js.map +1 -1
  31. package/lib/commonjs/utils/notification.js +13 -0
  32. package/lib/commonjs/utils/notification.js.map +1 -0
  33. package/lib/module/classes/HMSCameraControl.js +1 -1
  34. package/lib/module/classes/HMSCameraControl.js.map +1 -1
  35. package/lib/module/classes/HMSEncoder.js +1 -1
  36. package/lib/module/classes/HMSEncoder.js.map +1 -1
  37. package/lib/module/classes/HMSNativeEventListener.js +1 -1
  38. package/lib/module/classes/HMSNativeEventListener.js.map +1 -1
  39. package/lib/module/classes/HMSPeerListIterator.js +1 -1
  40. package/lib/module/classes/HMSPeerListIterator.js.map +1 -1
  41. package/lib/module/classes/HMSPeersCache.js +1 -1
  42. package/lib/module/classes/HMSPeersCache.js.map +1 -1
  43. package/lib/module/classes/HMSRoomCache.js +1 -1
  44. package/lib/module/classes/HMSRoomCache.js.map +1 -1
  45. package/lib/module/classes/HMSSDK.js +1 -8
  46. package/lib/module/classes/HMSSDK.js.map +1 -1
  47. package/lib/module/classes/HMSSessionStore.js +1 -1
  48. package/lib/module/classes/HMSSessionStore.js.map +1 -1
  49. package/lib/module/index.js +5 -1
  50. package/lib/module/index.js.map +1 -1
  51. package/lib/module/utils/notification.js +5 -0
  52. package/lib/module/utils/notification.js.map +1 -0
  53. package/lib/typescript/classes/HMSSDK.d.ts +1 -2
  54. package/lib/typescript/index.d.ts +3 -1
  55. package/lib/typescript/utils/notification.d.ts +5 -0
  56. package/package.json +1 -1
  57. package/sdk-versions.json +2 -2
  58. package/src/classes/HMSCameraControl.ts +1 -1
  59. package/src/classes/HMSEncoder.ts +1 -1
  60. package/src/classes/HMSNativeEventListener.ts +1 -1
  61. package/src/classes/HMSPeerListIterator.ts +8 -6
  62. package/src/classes/HMSPeersCache.ts +1 -1
  63. package/src/classes/HMSRoomCache.ts +1 -1
  64. package/src/classes/HMSSDK.tsx +34 -35
  65. package/src/classes/HMSSessionStore.ts +1 -1
  66. package/src/index.ts +5 -1
  67. package/src/utils/notification.ts +10 -0
  68. /package/lib/commonjs/{classes → modules}/HMSManagerModule.js +0 -0
  69. /package/lib/commonjs/{classes → modules}/HMSManagerModule.js.map +0 -0
  70. /package/lib/module/{classes → modules}/HMSManagerModule.js +0 -0
  71. /package/lib/module/{classes → modules}/HMSManagerModule.js.map +0 -0
  72. /package/lib/typescript/{classes → modules}/HMSManagerModule.d.ts +0 -0
  73. /package/src/{classes → modules}/HMSManagerModule.ts +0 -0
@@ -2,7 +2,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
2
2
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
3
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
4
  import { DeviceEventEmitter } from 'react-native';
5
- import HMSManager from './HMSManagerModule';
5
+ import HMSManager from '../modules/HMSManagerModule';
6
6
  import { HMSConstants } from './HMSConstants';
7
7
  import { getLogger } from './HMSLogger';
8
8
  import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
@@ -1 +1 @@
1
- {"version":3,"names":["DeviceEventEmitter","HMSManager","HMSConstants","getLogger","HMSUpdateListenerActions","EventEmitter","HMSSessionStore","constructor","_defineProperty","set","value","key","data","setSessionMetadataForKey","id","DEFAULT_SDK_ID","get","getSessionMetadataForKey","addKeyChangeListener","forKeys","callback","_deviceEventEmitterSubscription","addListener","ON_SESSION_STORE_CHANGED","_deviceEventEmitterListener","bind","_eventEmitter","uniqueId","join","Date","now","toString","eventEmitter","subscriptions","map","cleanupHandler","_cleanup","keys","catch","err","_addedKeyChangeListenerCount","remove","subscriptionsToRemove","length","context","forEach","subscription","removeKeyChangeListener","error","logger","verbose","Object","getOwnPropertyNames","includes","removeListener","undefined","_getLogger","_this$_eventEmitter","emit"],"sources":["HMSSessionStore.ts"],"sourcesContent":["import { DeviceEventEmitter } from 'react-native';\nimport type { EmitterSubscription as RNEmitterSubscription } from 'react-native';\n\nimport HMSManager from './HMSManagerModule';\n\nimport { HMSConstants } from './HMSConstants';\nimport { getLogger } from './HMSLogger';\nimport { HMSUpdateListenerActions } from './HMSUpdateListenerActions';\nimport { EventEmitter } from '../utils';\nimport type { EmitterSubscription } from '../utils';\n\ntype Nullable<T> = T | null | undefined;\n\nexport type HMSSessionStoreValue = Nullable<string>;\n\n/**\n * Session store is a shared realtime key-value store that is accessible by everyone in the room.\n * It can be utilized to implement features such as pinned text, spotlight (which brings a particular\n * peer to the center stage for everyone in the room) and more.\n *\n * To get an instance of `HMSSessionStore` class, You can add an event listener for `ON_SESSION_STORE_AVAILABLE`\n * event on the `HMSSDK` instance\n *\n * For example:\n * ```\n * hmsInstance.addEventListener(HMSUpdateListenerActions.ON_SESSION_STORE_AVAILABLE, <your callback function>);\n * ```\n *\n * Checkout Session Store docs fore more details ${@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/session-store}\n */\nexport class HMSSessionStore {\n private _deviceEventEmitterSubscription?: RNEmitterSubscription;\n private _eventEmitter?: EventEmitter;\n private _addedKeyChangeListenerCount = 0;\n\n /**\n * This method sets a value for a specific key on session store.\n * Once a value is assigned, it will be available for other peers in the room\n * who are listening for changes in value for that specific key.\n *\n * @param {HMSSessionStoreValue} value\n * @param {string} key\n * @returns {Promise}\n */\n async set(value: HMSSessionStoreValue, key: string) {\n const data: { success: true; finalValue: HMSSessionStoreValue } =\n await HMSManager.setSessionMetadataForKey({\n id: HMSConstants.DEFAULT_SDK_ID,\n key,\n value,\n });\n return data;\n }\n\n /**\n * This method returns the value of any specified key on session store.\n * Note that you will not get updates for any change in value of the specified key,\n * It returns the latest value at the time it was called.\n *\n * To listen to value change updates use `addKeyChangeListener` method instead.\n *\n * @param {string} key\n * @returns {Promise}\n */\n async get(key: string) {\n const data: HMSSessionStoreValue =\n await HMSManager.getSessionMetadataForKey({\n id: HMSConstants.DEFAULT_SDK_ID,\n key,\n });\n return data;\n }\n\n /**\n * This method registers a callback function for listening to value changes of a particular key.\n * Registered Callback function will be called initially with latest value and whenever the value updates\n *\n * @param {string[]} forKeys\n * @param {Function} callback\n * @returns {Object} subscription object\n */\n addKeyChangeListener<T extends string[]>(\n forKeys: T,\n callback: (\n error: string | null,\n data: { key: T[number]; value: HMSSessionStoreValue } | null\n ) => void\n ) {\n // Add Native Device Event Emitter if it is not already added\n if (!this._deviceEventEmitterSubscription) {\n this._deviceEventEmitterSubscription = DeviceEventEmitter.addListener(\n HMSUpdateListenerActions.ON_SESSION_STORE_CHANGED,\n this._deviceEventEmitterListener.bind(this)\n );\n }\n\n // Create JS side EventEmitter\n if (!this._eventEmitter) {\n this._eventEmitter = new EventEmitter();\n }\n\n // Unique Identifier for adding native event listener\n const uniqueId = forKeys.join('') + '_' + Date.now().toString();\n\n const eventEmitter = this._eventEmitter;\n\n // Add listeners on eventEmitter for each key\n const subscriptions = forKeys.map((key) =>\n eventEmitter.addListener(key, callback, { uniqueId })\n );\n\n //\n let cleanupHandler: (() => void) | null = () => {\n this._cleanup(subscriptions);\n };\n\n // Adding 'KeyChangeListener' on native side\n HMSManager.addKeyChangeListener({\n id: HMSConstants.DEFAULT_SDK_ID,\n keys: forKeys,\n uniqueId,\n })\n // Adding 'KeyChangeListener' fails on native side\n .catch((err: any) => {\n if (typeof cleanupHandler === 'function') {\n callback(err, null);\n cleanupHandler();\n cleanupHandler = null;\n }\n });\n\n this._addedKeyChangeListenerCount += 1;\n\n return {\n remove: () => {\n if (typeof cleanupHandler === 'function') {\n cleanupHandler();\n cleanupHandler = null;\n }\n },\n };\n }\n\n private _cleanup(subscriptionsToRemove: EmitterSubscription[]) {\n // Extracting `uniqueId` from first subscription (all subscriptions have same uniqueId)\n // this `uniqueId` will be used to remove 'KeyChangeListener' from native side\n const uniqueId =\n subscriptionsToRemove.length > 0\n ? (subscriptionsToRemove[0]!.context as { uniqueId: string }).uniqueId\n : null;\n\n // Removing required subscriptions from 'eventEmitter'\n subscriptionsToRemove.forEach((subscription) => subscription.remove());\n\n // Removing 'KeyChangeListener' from native side\n HMSManager.removeKeyChangeListener({\n id: HMSConstants.DEFAULT_SDK_ID,\n uniqueId,\n }).catch((error: any) => {\n const logger = getLogger();\n logger?.verbose(\n \"Error while removing key change listener, Listener didn't get registerred at first place or was already removed\",\n error\n );\n });\n\n this._addedKeyChangeListenerCount -= 1;\n\n if (this._addedKeyChangeListenerCount <= 0) {\n this._addedKeyChangeListenerCount = 0;\n if (\n this._deviceEventEmitterSubscription &&\n Object.getOwnPropertyNames(\n this._deviceEventEmitterSubscription\n ).includes('remove') &&\n typeof this._deviceEventEmitterSubscription.remove === 'function'\n ) {\n this._deviceEventEmitterSubscription.remove();\n } else {\n DeviceEventEmitter.removeListener(\n HMSUpdateListenerActions.ON_SESSION_STORE_CHANGED,\n this._deviceEventEmitterListener\n );\n }\n\n this._deviceEventEmitterSubscription = undefined;\n\n this._eventEmitter = undefined;\n }\n }\n\n private _deviceEventEmitterListener(data: {\n id: string;\n key: string;\n value: HMSSessionStoreValue;\n }) {\n // if id is different from default sdk_id, return early\n if (data.id !== HMSConstants.DEFAULT_SDK_ID) {\n return;\n }\n\n // emit event for the key\n getLogger()?.verbose('#Listener ON_SESSION_STORE_CHANGED event: ', data);\n\n this._eventEmitter?.emit(data.key, null, data);\n }\n}\n"],"mappings":";;;AAAA,SAASA,kBAAkB,QAAQ,cAAc;AAGjD,OAAOC,UAAU,MAAM,oBAAoB;AAE3C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,YAAY,QAAQ,UAAU;AAOvC;AACA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HMSUpdateListenerActions","EventEmitter","HMSSessionStore","constructor","_defineProperty","set","value","key","data","setSessionMetadataForKey","id","DEFAULT_SDK_ID","get","getSessionMetadataForKey","addKeyChangeListener","forKeys","callback","_deviceEventEmitterSubscription","addListener","ON_SESSION_STORE_CHANGED","_deviceEventEmitterListener","bind","_eventEmitter","uniqueId","join","Date","now","toString","eventEmitter","subscriptions","map","cleanupHandler","_cleanup","keys","catch","err","_addedKeyChangeListenerCount","remove","subscriptionsToRemove","length","context","forEach","subscription","removeKeyChangeListener","error","logger","verbose","Object","getOwnPropertyNames","includes","removeListener","undefined","_getLogger","_this$_eventEmitter","emit"],"sources":["HMSSessionStore.ts"],"sourcesContent":["import { DeviceEventEmitter } from 'react-native';\nimport type { EmitterSubscription as RNEmitterSubscription } from 'react-native';\n\nimport HMSManager from '../modules/HMSManagerModule';\n\nimport { HMSConstants } from './HMSConstants';\nimport { getLogger } from './HMSLogger';\nimport { HMSUpdateListenerActions } from './HMSUpdateListenerActions';\nimport { EventEmitter } from '../utils';\nimport type { EmitterSubscription } from '../utils';\n\ntype Nullable<T> = T | null | undefined;\n\nexport type HMSSessionStoreValue = Nullable<string>;\n\n/**\n * Session store is a shared realtime key-value store that is accessible by everyone in the room.\n * It can be utilized to implement features such as pinned text, spotlight (which brings a particular\n * peer to the center stage for everyone in the room) and more.\n *\n * To get an instance of `HMSSessionStore` class, You can add an event listener for `ON_SESSION_STORE_AVAILABLE`\n * event on the `HMSSDK` instance\n *\n * For example:\n * ```\n * hmsInstance.addEventListener(HMSUpdateListenerActions.ON_SESSION_STORE_AVAILABLE, <your callback function>);\n * ```\n *\n * Checkout Session Store docs fore more details ${@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/session-store}\n */\nexport class HMSSessionStore {\n private _deviceEventEmitterSubscription?: RNEmitterSubscription;\n private _eventEmitter?: EventEmitter;\n private _addedKeyChangeListenerCount = 0;\n\n /**\n * This method sets a value for a specific key on session store.\n * Once a value is assigned, it will be available for other peers in the room\n * who are listening for changes in value for that specific key.\n *\n * @param {HMSSessionStoreValue} value\n * @param {string} key\n * @returns {Promise}\n */\n async set(value: HMSSessionStoreValue, key: string) {\n const data: { success: true; finalValue: HMSSessionStoreValue } =\n await HMSManager.setSessionMetadataForKey({\n id: HMSConstants.DEFAULT_SDK_ID,\n key,\n value,\n });\n return data;\n }\n\n /**\n * This method returns the value of any specified key on session store.\n * Note that you will not get updates for any change in value of the specified key,\n * It returns the latest value at the time it was called.\n *\n * To listen to value change updates use `addKeyChangeListener` method instead.\n *\n * @param {string} key\n * @returns {Promise}\n */\n async get(key: string) {\n const data: HMSSessionStoreValue =\n await HMSManager.getSessionMetadataForKey({\n id: HMSConstants.DEFAULT_SDK_ID,\n key,\n });\n return data;\n }\n\n /**\n * This method registers a callback function for listening to value changes of a particular key.\n * Registered Callback function will be called initially with latest value and whenever the value updates\n *\n * @param {string[]} forKeys\n * @param {Function} callback\n * @returns {Object} subscription object\n */\n addKeyChangeListener<T extends string[]>(\n forKeys: T,\n callback: (\n error: string | null,\n data: { key: T[number]; value: HMSSessionStoreValue } | null\n ) => void\n ) {\n // Add Native Device Event Emitter if it is not already added\n if (!this._deviceEventEmitterSubscription) {\n this._deviceEventEmitterSubscription = DeviceEventEmitter.addListener(\n HMSUpdateListenerActions.ON_SESSION_STORE_CHANGED,\n this._deviceEventEmitterListener.bind(this)\n );\n }\n\n // Create JS side EventEmitter\n if (!this._eventEmitter) {\n this._eventEmitter = new EventEmitter();\n }\n\n // Unique Identifier for adding native event listener\n const uniqueId = forKeys.join('') + '_' + Date.now().toString();\n\n const eventEmitter = this._eventEmitter;\n\n // Add listeners on eventEmitter for each key\n const subscriptions = forKeys.map((key) =>\n eventEmitter.addListener(key, callback, { uniqueId })\n );\n\n //\n let cleanupHandler: (() => void) | null = () => {\n this._cleanup(subscriptions);\n };\n\n // Adding 'KeyChangeListener' on native side\n HMSManager.addKeyChangeListener({\n id: HMSConstants.DEFAULT_SDK_ID,\n keys: forKeys,\n uniqueId,\n })\n // Adding 'KeyChangeListener' fails on native side\n .catch((err: any) => {\n if (typeof cleanupHandler === 'function') {\n callback(err, null);\n cleanupHandler();\n cleanupHandler = null;\n }\n });\n\n this._addedKeyChangeListenerCount += 1;\n\n return {\n remove: () => {\n if (typeof cleanupHandler === 'function') {\n cleanupHandler();\n cleanupHandler = null;\n }\n },\n };\n }\n\n private _cleanup(subscriptionsToRemove: EmitterSubscription[]) {\n // Extracting `uniqueId` from first subscription (all subscriptions have same uniqueId)\n // this `uniqueId` will be used to remove 'KeyChangeListener' from native side\n const uniqueId =\n subscriptionsToRemove.length > 0\n ? (subscriptionsToRemove[0]!.context as { uniqueId: string }).uniqueId\n : null;\n\n // Removing required subscriptions from 'eventEmitter'\n subscriptionsToRemove.forEach((subscription) => subscription.remove());\n\n // Removing 'KeyChangeListener' from native side\n HMSManager.removeKeyChangeListener({\n id: HMSConstants.DEFAULT_SDK_ID,\n uniqueId,\n }).catch((error: any) => {\n const logger = getLogger();\n logger?.verbose(\n \"Error while removing key change listener, Listener didn't get registerred at first place or was already removed\",\n error\n );\n });\n\n this._addedKeyChangeListenerCount -= 1;\n\n if (this._addedKeyChangeListenerCount <= 0) {\n this._addedKeyChangeListenerCount = 0;\n if (\n this._deviceEventEmitterSubscription &&\n Object.getOwnPropertyNames(\n this._deviceEventEmitterSubscription\n ).includes('remove') &&\n typeof this._deviceEventEmitterSubscription.remove === 'function'\n ) {\n this._deviceEventEmitterSubscription.remove();\n } else {\n DeviceEventEmitter.removeListener(\n HMSUpdateListenerActions.ON_SESSION_STORE_CHANGED,\n this._deviceEventEmitterListener\n );\n }\n\n this._deviceEventEmitterSubscription = undefined;\n\n this._eventEmitter = undefined;\n }\n }\n\n private _deviceEventEmitterListener(data: {\n id: string;\n key: string;\n value: HMSSessionStoreValue;\n }) {\n // if id is different from default sdk_id, return early\n if (data.id !== HMSConstants.DEFAULT_SDK_ID) {\n return;\n }\n\n // emit event for the key\n getLogger()?.verbose('#Listener ON_SESSION_STORE_CHANGED event: ', data);\n\n this._eventEmitter?.emit(data.key, null, data);\n }\n}\n"],"mappings":";;;AAAA,SAASA,kBAAkB,QAAQ,cAAc;AAGjD,OAAOC,UAAU,MAAM,6BAA6B;AAEpD,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,YAAY,QAAQ,UAAU;AAOvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,CAAC;EAAAC,YAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA,uCAGY,CAAC;EAAA;EAExC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,GAAGA,CAACC,KAA2B,EAAEC,GAAW,EAAE;IAClD,MAAMC,IAAyD,GAC7D,MAAMX,UAAU,CAACY,wBAAwB,CAAC;MACxCC,EAAE,EAAEZ,YAAY,CAACa,cAAc;MAC/BJ,GAAG;MACHD;IACF,CAAC,CAAC;IACJ,OAAOE,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMI,GAAGA,CAACL,GAAW,EAAE;IACrB,MAAMC,IAA0B,GAC9B,MAAMX,UAAU,CAACgB,wBAAwB,CAAC;MACxCH,EAAE,EAAEZ,YAAY,CAACa,cAAc;MAC/BJ;IACF,CAAC,CAAC;IACJ,OAAOC,IAAI;EACb;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEM,oBAAoBA,CAClBC,OAAU,EACVC,QAGS,EACT;IACA;IACA,IAAI,CAAC,IAAI,CAACC,+BAA+B,EAAE;MACzC,IAAI,CAACA,+BAA+B,GAAGrB,kBAAkB,CAACsB,WAAW,CACnElB,wBAAwB,CAACmB,wBAAwB,EACjD,IAAI,CAACC,2BAA2B,CAACC,IAAI,CAAC,IAAI,CAC5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,cAAAqD,UAAA,eAAXA,UAAA,CAAaN,OAAO,CAAC,4CAA4C,EAAEtC,IAAI,CAAC;IAExE,CAAA6C,mBAAA,OAAI,CAAC/B,aAAa,cAAA+B,mBAAA,eAAlBA,mBAAA,CAAoBC,IAAI,CAAC9C,IAAI,CAACD,GAAG,EAAE,IAAI,EAAEC,IAAI,CAAC;EAChD;AACF"}
@@ -83,7 +83,7 @@ export * from './classes/HMSIOSAudioMode';
83
83
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
84
84
 
85
85
  // 100ms React Native Native Module
86
- export { default as HMSManagerModule } from './classes/HMSManagerModule';
86
+ export { default as HMSManagerModule } from './modules/HMSManagerModule';
87
87
 
88
88
  // 100ms Components
89
89
  export * from './components/HMSHLSPlayer';
@@ -92,6 +92,10 @@ export * from './components/HMSHLSPlayer';
92
92
  export * from './hooks/useHMSPeerUpdates';
93
93
  export { useHmsViewsResolutionsState } from './hooks/hmsviews';
94
94
 
95
+ // 100ms Utilities
96
+
97
+ export { checkNotifications } from './utils/notification';
98
+
95
99
  // 100ms types
96
100
  export * from './types';
97
101
  export * from './stores/types';
@@ -1 +1 @@
1
- {"version":3,"names":["HMSSDK","HmsManager","default","HMSManagerModule","useHmsViewsResolutionsState"],"sources":["index.ts"],"sourcesContent":["export * from './classes/HMSConfig';\nexport * from './classes/HMSUpdateListenerActions';\nexport * from './classes/HMSMessage';\nexport * from './classes/HMSVideoTrackSettings';\nexport * from './classes/HMSVideoTrack';\nexport * from './classes/HMSVideoSettings';\nexport * from './classes/HMSVideoCodec';\nexport * from './classes/HMSTrackSettings';\nexport * from './classes/HMSTrack';\nexport * from './classes/HMSTrackType';\nexport * from './classes/HMSTrackSource';\nexport * from './classes/HMSSubscribeSettings';\nexport * from './classes/HMSSimulcastSettings';\nexport * from './classes/HMSSimulcastLayerSettings';\nexport * from './classes/HMSSDK';\nexport * from './classes/HMSRoom';\nexport * from './classes/HMSRoleChangeRequest';\nexport * from './classes/HMSRole';\nexport * from './classes/HMSRemoteVideoTrack';\nexport * from './classes/HMSRemotePeer';\nexport * from './classes/HMSRemoteAudioTrack';\nexport * from './classes/HMSPublishSettings';\nexport * from './classes/HMSPermissions';\nexport * from './classes/HMSPeer';\nexport * from './classes/HMSLocalVideoTrack';\nexport * from './classes/HMSLocalPeer';\nexport * from './classes/HMSLocalAudioTrack';\nexport * from './classes/HMSHelper';\nexport * from './classes/HMSEncoder';\nexport * from './classes/HMSAudioTrackSettings';\nexport * from './classes/HMSAudioTrack';\nexport * from './classes/HMSAudioSettings';\nexport * from './classes/HMSAudioCodec';\nexport * from './classes/HMSPeerUpdate';\nexport * from './classes/HMSRoomUpdate';\nexport * from './classes/HMSTrackUpdate';\nexport * from './classes/HMSLogger';\nexport * from './classes/HMSLogLevel';\nexport * from './classes/HMSVideoViewMode';\nexport * from './classes/HMSChangeTrackStateRequest';\nexport * from './classes/HMSSpeaker';\nexport * from './classes/HMSCameraFacing';\nexport * from './classes/HMSException';\nexport * from './classes/HMSRtmpStreamingState';\nexport * from './classes/HMSServerRecordingState';\nexport * from './classes/HMSBrowserRecordingState';\nexport * from './classes/HMSRTMPConfig';\nexport * from './classes/HMSHLSConfig';\nexport * from './classes/HMSHLSMeetingURLVariant';\nexport * from './classes/HMSHLSVariant';\nexport * from './classes/HMSHLSStreamingState';\nexport * from './classes/HMSVideoResolution';\nexport * from './classes/HMSLocalAudioStats';\nexport * from './classes/HMSLocalVideoStats';\nexport * from './classes/HMSRTCStats';\nexport * from './classes/HMSRTCStatsReport';\nexport * from './classes/HMSRemoteAudioStats';\nexport * from './classes/HMSRemoteVideoStats';\nexport * from './classes/HMSHLSRecordingConfig';\nexport * from './classes/HMSHLSRecordingState';\nexport * from './classes/HMSMessageRecipient';\nexport * from './classes/HMSMessageRecipientType';\nexport * from './classes/HMSNetworkQuality';\nexport * from './classes/HMSRtmpVideoResolution';\nexport * from './classes/HMSAudioDevice';\nexport * from './classes/HMSAudioMode';\nexport * from './classes/HMSAudioMixingMode';\nexport * from './classes/HMSAudioNode';\nexport * from './classes/HMSMicNode';\nexport * from './classes/HMSScreenBroadcastAudioReceiverNode';\nexport * from './classes/HMSAudioFilePlayerNode';\nexport * from './classes/HMSAudioMixerSource';\nexport * from './classes/HMSTrackSettingsInitState';\nexport * from './classes/HMSLogSettings';\nexport * from './classes/HMSLogAlarmManager';\nexport * from './classes/HMSPIPListenerActions';\nexport * from './classes/HMSLayer';\nexport * from './classes/HMSSimulcastLayerDefinition';\nexport * from './classes/HMSQualityLimitationReasons';\nexport * from './classes/HMSQualityLimitationReason';\nexport * from './classes/HMSCameraControl';\nexport * from './classes/HMSIOSAudioMode';\nexport type {\n HMSSessionStore,\n HMSSessionStoreValue,\n} from './classes/HMSSessionStore';\nexport type {\n HmsViewComponent as HMSView,\n HmsComponentProps as HMSViewProps,\n} from './classes/HmsView';\nexport type { HMSPIPConfig } from './classes/HMSPIPConfig';\n\nimport { HMSSDK as HmsManager } from './classes/HMSSDK';\n\n// 100ms React Native Native Module\nexport { default as HMSManagerModule } from './classes/HMSManagerModule';\n\n// 100ms Components\nexport * from './components/HMSHLSPlayer';\n\n// 100ms Hooks\nexport * from './hooks/useHMSPeerUpdates';\nexport { useHmsViewsResolutionsState } from './hooks/hmsviews';\n\n// 100ms types\nexport * from './types';\nexport * from './stores/types';\n\nexport default HmsManager;\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,oCAAoC;AAClD,cAAc,sBAAsB;AACpC,cAAc,iCAAiC;AAC/C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,oBAAoB;AAClC,cAAc,wBAAwB;AACtC,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,gCAAgC;AAC9C,cAAc,qCAAqC;AACnD,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,gCAAgC;AAC9C,cAAc,mBAAmB;AACjC,cAAc,+BAA+B;AAC7C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ACrD,cAAc,uCAAuC;AACrD,cAAc,sCAAsC;AACpD,cAAc,4BAA4B;AAC1C,cAAc,2BAA2B;AAWzC,SAASA,MAAM,IAAIC,UAAU,QAAQ,kBAAkB;;AAEvD;AACA,SAASC,OAAO,IAAIC,gBAAgB,QAAQ,4BAA4B;;AAExE;AACA,cAAc,2BAA2B;;AAEzC;AACA,cAAc,2BAA2B;AACzC,SAASC,2BAA2B,QAAQ,kBAAkB;;AAE9D;AACA,cAAc,SAAS;AACvB,cAAc,gBAAgB;AAE9B,eAAeH,UAAU"}
1
+ {"version":3,"names":["HMSSDK","HmsManager","default","HMSManagerModule","useHmsViewsResolutionsState","checkNotifications"],"sources":["index.ts"],"sourcesContent":["export * from './classes/HMSConfig';\nexport * from './classes/HMSUpdateListenerActions';\nexport * from './classes/HMSMessage';\nexport * from './classes/HMSVideoTrackSettings';\nexport * from './classes/HMSVideoTrack';\nexport * from './classes/HMSVideoSettings';\nexport * from './classes/HMSVideoCodec';\nexport * from './classes/HMSTrackSettings';\nexport * from './classes/HMSTrack';\nexport * from './classes/HMSTrackType';\nexport * from './classes/HMSTrackSource';\nexport * from './classes/HMSSubscribeSettings';\nexport * from './classes/HMSSimulcastSettings';\nexport * from './classes/HMSSimulcastLayerSettings';\nexport * from './classes/HMSSDK';\nexport * from './classes/HMSRoom';\nexport * from './classes/HMSRoleChangeRequest';\nexport * from './classes/HMSRole';\nexport * from './classes/HMSRemoteVideoTrack';\nexport * from './classes/HMSRemotePeer';\nexport * from './classes/HMSRemoteAudioTrack';\nexport * from './classes/HMSPublishSettings';\nexport * from './classes/HMSPermissions';\nexport * from './classes/HMSPeer';\nexport * from './classes/HMSLocalVideoTrack';\nexport * from './classes/HMSLocalPeer';\nexport * from './classes/HMSLocalAudioTrack';\nexport * from './classes/HMSHelper';\nexport * from './classes/HMSEncoder';\nexport * from './classes/HMSAudioTrackSettings';\nexport * from './classes/HMSAudioTrack';\nexport * from './classes/HMSAudioSettings';\nexport * from './classes/HMSAudioCodec';\nexport * from './classes/HMSPeerUpdate';\nexport * from './classes/HMSRoomUpdate';\nexport * from './classes/HMSTrackUpdate';\nexport * from './classes/HMSLogger';\nexport * from './classes/HMSLogLevel';\nexport * from './classes/HMSVideoViewMode';\nexport * from './classes/HMSChangeTrackStateRequest';\nexport * from './classes/HMSSpeaker';\nexport * from './classes/HMSCameraFacing';\nexport * from './classes/HMSException';\nexport * from './classes/HMSRtmpStreamingState';\nexport * from './classes/HMSServerRecordingState';\nexport * from './classes/HMSBrowserRecordingState';\nexport * from './classes/HMSRTMPConfig';\nexport * from './classes/HMSHLSConfig';\nexport * from './classes/HMSHLSMeetingURLVariant';\nexport * from './classes/HMSHLSVariant';\nexport * from './classes/HMSHLSStreamingState';\nexport * from './classes/HMSVideoResolution';\nexport * from './classes/HMSLocalAudioStats';\nexport * from './classes/HMSLocalVideoStats';\nexport * from './classes/HMSRTCStats';\nexport * from './classes/HMSRTCStatsReport';\nexport * from './classes/HMSRemoteAudioStats';\nexport * from './classes/HMSRemoteVideoStats';\nexport * from './classes/HMSHLSRecordingConfig';\nexport * from './classes/HMSHLSRecordingState';\nexport * from './classes/HMSMessageRecipient';\nexport * from './classes/HMSMessageRecipientType';\nexport * from './classes/HMSNetworkQuality';\nexport * from './classes/HMSRtmpVideoResolution';\nexport * from './classes/HMSAudioDevice';\nexport * from './classes/HMSAudioMode';\nexport * from './classes/HMSAudioMixingMode';\nexport * from './classes/HMSAudioNode';\nexport * from './classes/HMSMicNode';\nexport * from './classes/HMSScreenBroadcastAudioReceiverNode';\nexport * from './classes/HMSAudioFilePlayerNode';\nexport * from './classes/HMSAudioMixerSource';\nexport * from './classes/HMSTrackSettingsInitState';\nexport * from './classes/HMSLogSettings';\nexport * from './classes/HMSLogAlarmManager';\nexport * from './classes/HMSPIPListenerActions';\nexport * from './classes/HMSLayer';\nexport * from './classes/HMSSimulcastLayerDefinition';\nexport * from './classes/HMSQualityLimitationReasons';\nexport * from './classes/HMSQualityLimitationReason';\nexport * from './classes/HMSCameraControl';\nexport * from './classes/HMSIOSAudioMode';\nexport type {\n HMSSessionStore,\n HMSSessionStoreValue,\n} from './classes/HMSSessionStore';\nexport type {\n HmsViewComponent as HMSView,\n HmsComponentProps as HMSViewProps,\n} from './classes/HmsView';\nexport type { HMSPIPConfig } from './classes/HMSPIPConfig';\n\nimport { HMSSDK as HmsManager } from './classes/HMSSDK';\n\n// 100ms React Native Native Module\nexport { default as HMSManagerModule } from './modules/HMSManagerModule';\n\n// 100ms Components\nexport * from './components/HMSHLSPlayer';\n\n// 100ms Hooks\nexport * from './hooks/useHMSPeerUpdates';\nexport { useHmsViewsResolutionsState } from './hooks/hmsviews';\n\n// 100ms Utilities\nexport type { NotificationResult } from './utils/notification';\nexport { checkNotifications } from './utils/notification';\n\n// 100ms types\nexport * from './types';\nexport * from './stores/types';\n\nexport default HmsManager;\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,oCAAoC;AAClD,cAAc,sBAAsB;AACpC,cAAc,iCAAiC;AAC/C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,oBAAoB;AAClC,cAAc,wBAAwB;AACtC,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,gCAAgC;AAC9C,cAAc,qCAAqC;AACnD,cAAc,kBAAkB;AAChC,cAAc,mBAAmB;AACjC,cAAc,gCAAgC;AAC9C,cAAc,mBAAmB;AACjC,cAAc,+BAA+B;AAC7C,cAAc,yBAAyB;AACvC,cAAc,+BAA+B;AAC7C,cAAc,8BAA8B;AAC5C,cAAc,0BAA0B;AACxC,cAAc,mBAAmB;AACjC,cAAc,8BAA8B;AAC5C,cAAc,wBAAwB;AACtC,cAAc,8BAA8B;AAC5C,cAAc,qBAAqB;AACnC,cAAc,sBAAsB;AACpC,cAAc,iCAAiC;AAC/C,cAAc,yBAAyB;AACvC,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;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EA,SAASC,kBAAkB,QAAQ,sBAAsB;;AAEzD;AACA,cAAc,SAAS;AACvB,cAAc,gBAAgB;AAE9B,eAAeJ,UAAU"}
@@ -0,0 +1,5 @@
1
+ import HMSManager from '../modules/HMSManagerModule';
2
+ export const checkNotifications = async () => {
3
+ return HMSManager.checkNotifications();
4
+ };
5
+ //# sourceMappingURL=notification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["HMSManager","checkNotifications"],"sources":["notification.ts"],"sourcesContent":["import HMSManager from '../modules/HMSManagerModule';\n\nexport type NotificationResult = {\n status: 'granted' | 'blocked';\n settings: {};\n};\n\nexport const checkNotifications = async (): Promise<NotificationResult> => {\n return HMSManager.checkNotifications();\n};\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,6BAA6B;AAOpD,OAAO,MAAMC,kBAAkB,GAAG,MAAAA,CAAA,KAAyC;EACzE,OAAOD,UAAU,CAACC,kBAAkB,CAAC,CAAC;AACxC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { HMSTrackType } from './HMSTrackType';
3
2
  import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
3
+ import type { HMSTrackType } from './HMSTrackType';
4
4
  import type { HmsComponentProps } from './HmsView';
5
5
  import type { HMSConfig } from './HMSConfig';
6
6
  import type { HMSLocalPeer } from './HMSLocalPeer';
@@ -24,7 +24,6 @@ import type { HMSPIPConfig } from './HMSPIPConfig';
24
24
  type HmsViewProps = Omit<HmsComponentProps, 'id'>;
25
25
  export declare class HMSSDK {
26
26
  id: string;
27
- private muteStatus;
28
27
  private appStateSubscription?;
29
28
  private onPreviewDelegate?;
30
29
  private onJoinDelegate?;
@@ -84,10 +84,12 @@ export type { HMSSessionStore, HMSSessionStoreValue, } from './classes/HMSSessio
84
84
  export type { HmsViewComponent as HMSView, HmsComponentProps as HMSViewProps, } from './classes/HmsView';
85
85
  export type { HMSPIPConfig } from './classes/HMSPIPConfig';
86
86
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
87
- export { default as HMSManagerModule } from './classes/HMSManagerModule';
87
+ export { default as HMSManagerModule } from './modules/HMSManagerModule';
88
88
  export * from './components/HMSHLSPlayer';
89
89
  export * from './hooks/useHMSPeerUpdates';
90
90
  export { useHmsViewsResolutionsState } from './hooks/hmsviews';
91
+ export type { NotificationResult } from './utils/notification';
92
+ export { checkNotifications } from './utils/notification';
91
93
  export * from './types';
92
94
  export * from './stores/types';
93
95
  export default HmsManager;
@@ -0,0 +1,5 @@
1
+ export type NotificationResult = {
2
+ status: 'granted' | 'blocked';
3
+ settings: {};
4
+ };
5
+ export declare const checkNotifications: () => Promise<NotificationResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@100mslive/react-native-hms",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "Integrate Real Time Audio and Video conferencing, Interactive Live Streaming, and Chat in your apps with 100ms React Native SDK. With support for HLS and RTMP Live Streaming and Recording, Picture-in-Picture (PiP), one-to-one Video Call Modes, Audio Rooms, Video Player and much more, add immersive real-time communications to your apps.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/sdk-versions.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "ios": "1.2.0",
2
+ "ios": "1.3.0",
3
3
  "iOSBroadcastExtension": "0.0.9",
4
4
  "iOSHMSHLSPlayer": "0.0.2",
5
- "android": "2.8.0"
5
+ "android": "2.8.1"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import { HMSConstants } from './HMSConstants';
2
2
 
3
- import HMSManager from './HMSManagerModule';
3
+ import HMSManager from '../modules/HMSManagerModule';
4
4
 
5
5
  export class HMSCameraControl {
6
6
  /**
@@ -1,4 +1,4 @@
1
- import HMSManager from './HMSManagerModule';
1
+ import HMSManager from '../modules/HMSManagerModule';
2
2
 
3
3
  import { HMSTrack } from './HMSTrack';
4
4
  import { HMSAudioTrack } from './HMSAudioTrack';
@@ -1,4 +1,4 @@
1
- import HMSManager from './HMSManagerModule';
1
+ import HMSManager from '../modules/HMSManagerModule';
2
2
  import { HMSNativeEventEmitter } from './HMSNativeEventEmitter';
3
3
 
4
4
  export type { HMSEventSubscription as HMSNativeEventSubscription } from './HMSNativeEventEmitter';
@@ -1,6 +1,6 @@
1
1
  // import type { HMSException } from "./HMSException";
2
2
  import type { HMSPeer } from './HMSPeer';
3
- import HMSManagerModule from './HMSManagerModule';
3
+ import HMSManagerModule from '../modules/HMSManagerModule';
4
4
  import { HMSEncoder, logger } from '@100mslive/react-native-hms';
5
5
  import { HMSConstants } from './HMSConstants';
6
6
  import { getHmsPeersCache } from './HMSPeersCache';
@@ -34,10 +34,12 @@ export class HMSPeerListIterator {
34
34
  async next(): Promise<HMSPeer[]> {
35
35
  logger?.verbose('#Function HMSPeerListIterator#next', this.uniqueId);
36
36
  try {
37
- const { totalCount, peers } = await HMSManagerModule.peerListIteratorNext({
38
- id: HMSConstants.DEFAULT_SDK_ID,
39
- uniqueId: this.uniqueId,
40
- });
37
+ const { totalCount, peers } = await HMSManagerModule.peerListIteratorNext(
38
+ {
39
+ id: HMSConstants.DEFAULT_SDK_ID,
40
+ uniqueId: this.uniqueId,
41
+ }
42
+ );
41
43
 
42
44
  this._totalCount = totalCount;
43
45
 
@@ -45,7 +47,7 @@ export class HMSPeerListIterator {
45
47
  const hmsPeersCache = getHmsPeersCache();
46
48
 
47
49
  if (hmsPeersCache) {
48
- peers.forEach(peer => {
50
+ peers.forEach((peer) => {
49
51
  hmsPeersCache.updatePeerCache(peer.peerID, peer);
50
52
  });
51
53
  }
@@ -1,4 +1,4 @@
1
- import HMSManager from './HMSManagerModule';
1
+ import HMSManager from '../modules/HMSManagerModule';
2
2
 
3
3
  import { HMSEncoder } from './HMSEncoder';
4
4
  import { HMSPeerUpdate } from './HMSPeerUpdate';
@@ -1,4 +1,4 @@
1
- import HMSManager from './HMSManagerModule';
1
+ import HMSManager from '../modules/HMSManagerModule';
2
2
 
3
3
  import type { HMSRoom } from './HMSRoom';
4
4
  import { HMSEncoder } from './HMSEncoder';
@@ -3,13 +3,13 @@ import { Platform } from 'react-native';
3
3
  import { HMSEncoder } from './HMSEncoder';
4
4
  import { HMSHelper } from './HMSHelper';
5
5
  import { getLogger, logger, setLogger } from './HMSLogger';
6
- import { HMSTrackType } from './HMSTrackType';
7
6
  import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
8
7
  import { HmsViewComponent } from './HmsView';
9
- import type { HmsComponentProps } from './HmsView';
10
8
 
11
- import HMSManager from './HMSManagerModule';
9
+ import HMSManager from '../modules/HMSManagerModule';
12
10
 
11
+ import type { HMSTrackType } from './HMSTrackType';
12
+ import type { HmsComponentProps } from './HmsView';
13
13
  import type { HMSConfig } from './HMSConfig';
14
14
  import type { HMSLocalPeer } from './HMSLocalPeer';
15
15
  import type { HMSRemotePeer } from './HMSRemotePeer';
@@ -55,7 +55,6 @@ let HmsSdk: HMSSDK | undefined;
55
55
 
56
56
  export class HMSSDK {
57
57
  id: string;
58
- private muteStatus: boolean | undefined;
59
58
  private appStateSubscription?: any;
60
59
  private onPreviewDelegate?: any;
61
60
  private onJoinDelegate?: any;
@@ -239,7 +238,6 @@ export class HMSSDK {
239
238
  });
240
239
 
241
240
  roomLeaveCleanup = () => {
242
- this.muteStatus = undefined;
243
241
  this?.appStateSubscription?.remove();
244
242
  clearHmsPeersCache();
245
243
  clearHmsRoomCache();
@@ -698,7 +696,6 @@ export class HMSSDK {
698
696
  */
699
697
  setPlaybackForAllAudio = (mute: boolean) => {
700
698
  logger?.verbose('#Function setPlaybackForAllAudio', { mute, id: this.id });
701
- this.muteStatus = mute;
702
699
  HMSManager.setPlaybackForAllAudio({ mute, id: this.id });
703
700
  };
704
701
 
@@ -1182,13 +1179,16 @@ export class HMSSDK {
1182
1179
 
1183
1180
  const uniqueId = Math.random().toString(16).slice(2);
1184
1181
 
1185
- const data: null | { sucess: boolean; uniqueId: string; totalCount: number; } =
1186
- HMSManager.getPeerListIterator({
1187
- id: this.id,
1188
- ...options,
1189
- limit: options?.limit ?? 10,
1190
- uniqueId,
1191
- });
1182
+ const data: null | {
1183
+ sucess: boolean;
1184
+ uniqueId: string;
1185
+ totalCount: number;
1186
+ } = HMSManager.getPeerListIterator({
1187
+ id: this.id,
1188
+ ...options,
1189
+ limit: options?.limit ?? 10,
1190
+ uniqueId,
1191
+ });
1192
1192
 
1193
1193
  if (!data) {
1194
1194
  throw new Error('Unable to create PeerListIterator');
@@ -1632,15 +1632,19 @@ export class HMSSDK {
1632
1632
  if (Platform.OS === 'android') {
1633
1633
  // Checking if we already have ON_PIP_MODE_CHANGED subscription
1634
1634
  if (
1635
- !this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_MODE_CHANGED]
1635
+ !this.emitterSubscriptions[
1636
+ HMSPIPListenerActions.ON_PIP_MODE_CHANGED
1637
+ ]
1636
1638
  ) {
1637
- const pipModeChangedSubscription = HMSNativeEventListener.addListener(
1638
- this.id,
1639
- HMSPIPListenerActions.ON_PIP_MODE_CHANGED,
1640
- this.onPIPModeChangedListener
1641
- );
1642
- this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_MODE_CHANGED] =
1643
- pipModeChangedSubscription;
1639
+ const pipModeChangedSubscription =
1640
+ HMSNativeEventListener.addListener(
1641
+ this.id,
1642
+ HMSPIPListenerActions.ON_PIP_MODE_CHANGED,
1643
+ this.onPIPModeChangedListener
1644
+ );
1645
+ this.emitterSubscriptions[
1646
+ HMSPIPListenerActions.ON_PIP_MODE_CHANGED
1647
+ ] = pipModeChangedSubscription;
1644
1648
  }
1645
1649
  // Adding PIP mode changed Delegate listener
1646
1650
  this.onPIPModeChangedDelegate = callback;
@@ -1989,13 +1993,16 @@ export class HMSSDK {
1989
1993
  case HMSPIPListenerActions.ON_PIP_MODE_CHANGED: {
1990
1994
  if (Platform.OS === 'android') {
1991
1995
  const subscription =
1992
- this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_MODE_CHANGED];
1996
+ this.emitterSubscriptions[
1997
+ HMSPIPListenerActions.ON_PIP_MODE_CHANGED
1998
+ ];
1993
1999
  // Removing ON_PIP_MODE_CHANGED native listener
1994
2000
  if (subscription) {
1995
2001
  subscription.remove();
1996
2002
 
1997
- this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_MODE_CHANGED] =
1998
- undefined;
2003
+ this.emitterSubscriptions[
2004
+ HMSPIPListenerActions.ON_PIP_MODE_CHANGED
2005
+ ] = undefined;
1999
2006
  }
2000
2007
  // Removing App Delegate listener
2001
2008
  this.onPIPModeChangedDelegate = null;
@@ -2140,13 +2147,13 @@ export class HMSSDK {
2140
2147
  });
2141
2148
  this.onPeerDelegate({ peer, type });
2142
2149
  }
2143
- }
2150
+ };
2144
2151
 
2145
2152
  private sendPeerUpdateWhenPeerLeaves = (data: any, peer: any, type: any) => {
2146
2153
  this.sendPeerUpdate(peer, type);
2147
2154
 
2148
2155
  getHmsPeersCache()?.updatePeerCache(data.peer.peerID, data.peer, type);
2149
- }
2156
+ };
2150
2157
 
2151
2158
  onPeerListUpdatedListener = (data: any) => {
2152
2159
  if (data.id !== this.id) {
@@ -2178,14 +2185,6 @@ export class HMSSDK {
2178
2185
 
2179
2186
  getHmsPeersCache()?.updatePeerCache(data.peer.peerID, { track }, data.type);
2180
2187
 
2181
- if (
2182
- this.muteStatus &&
2183
- data?.type === 'TRACK_ADDED' &&
2184
- track.type === HMSTrackType.AUDIO
2185
- ) {
2186
- this.setPlaybackForAllAudio(this.muteStatus);
2187
- }
2188
-
2189
2188
  if (this.onTrackDelegate) {
2190
2189
  logger?.verbose('#Listener ON_TRACK_LISTENER_CALL', {
2191
2190
  peer,
@@ -2472,7 +2471,7 @@ export class HMSSDK {
2472
2471
 
2473
2472
  this.onPIPModeChangedDelegate(data);
2474
2473
  }
2475
- }
2474
+ };
2476
2475
 
2477
2476
  async isPipModeSupported(): Promise<undefined | boolean> {
2478
2477
  return HMSManager.handlePipActions('isPipModeSupported', { id: this.id });
@@ -1,7 +1,7 @@
1
1
  import { DeviceEventEmitter } from 'react-native';
2
2
  import type { EmitterSubscription as RNEmitterSubscription } from 'react-native';
3
3
 
4
- import HMSManager from './HMSManagerModule';
4
+ import HMSManager from '../modules/HMSManagerModule';
5
5
 
6
6
  import { HMSConstants } from './HMSConstants';
7
7
  import { getLogger } from './HMSLogger';
package/src/index.ts CHANGED
@@ -93,7 +93,7 @@ export type { HMSPIPConfig } from './classes/HMSPIPConfig';
93
93
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
94
94
 
95
95
  // 100ms React Native Native Module
96
- export { default as HMSManagerModule } from './classes/HMSManagerModule';
96
+ export { default as HMSManagerModule } from './modules/HMSManagerModule';
97
97
 
98
98
  // 100ms Components
99
99
  export * from './components/HMSHLSPlayer';
@@ -102,6 +102,10 @@ export * from './components/HMSHLSPlayer';
102
102
  export * from './hooks/useHMSPeerUpdates';
103
103
  export { useHmsViewsResolutionsState } from './hooks/hmsviews';
104
104
 
105
+ // 100ms Utilities
106
+ export type { NotificationResult } from './utils/notification';
107
+ export { checkNotifications } from './utils/notification';
108
+
105
109
  // 100ms types
106
110
  export * from './types';
107
111
  export * from './stores/types';
@@ -0,0 +1,10 @@
1
+ import HMSManager from '../modules/HMSManagerModule';
2
+
3
+ export type NotificationResult = {
4
+ status: 'granted' | 'blocked';
5
+ settings: {};
6
+ };
7
+
8
+ export const checkNotifications = async (): Promise<NotificationResult> => {
9
+ return HMSManager.checkNotifications();
10
+ };
File without changes