@sendbird/uikit-react-native 3.7.2 → 3.7.4

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 (143) hide show
  1. package/lib/commonjs/components/ChannelInput/SendInput.js +2 -1
  2. package/lib/commonjs/components/ChannelInput/SendInput.js.map +1 -1
  3. package/lib/commonjs/components/ChannelInput/VoiceMessageInput.js +33 -23
  4. package/lib/commonjs/components/ChannelInput/VoiceMessageInput.js.map +1 -1
  5. package/lib/commonjs/components/ChannelInput/index.js +11 -5
  6. package/lib/commonjs/components/ChannelInput/index.js.map +1 -1
  7. package/lib/commonjs/components/ChannelMessageList/index.js +6 -1
  8. package/lib/commonjs/components/ChannelMessageList/index.js.map +1 -1
  9. package/lib/commonjs/components/ChannelThreadMessageList/index.js +6 -1
  10. package/lib/commonjs/components/ChannelThreadMessageList/index.js.map +1 -1
  11. package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.js +2 -2
  12. package/lib/commonjs/components/GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.js.map +1 -1
  13. package/lib/commonjs/components/GroupChannelMessageRenderer/index.js +1 -1
  14. package/lib/commonjs/components/GroupChannelMessageRenderer/index.js.map +1 -1
  15. package/lib/commonjs/components/OpenChannelMessageRenderer/OpenChannelMessageDateSeparator.js +2 -2
  16. package/lib/commonjs/components/OpenChannelMessageRenderer/OpenChannelMessageDateSeparator.js.map +1 -1
  17. package/lib/commonjs/components/ReactionAddons/BottomSheetReactionAddon.js +7 -3
  18. package/lib/commonjs/components/ReactionAddons/BottomSheetReactionAddon.js.map +1 -1
  19. package/lib/commonjs/components/ReactionBottomSheets/ReactionListBottomSheet.js +7 -3
  20. package/lib/commonjs/components/ReactionBottomSheets/ReactionListBottomSheet.js.map +1 -1
  21. package/lib/commonjs/components/ThreadParentMessageRenderer/index.js +1 -1
  22. package/lib/commonjs/components/ThreadParentMessageRenderer/index.js.map +1 -1
  23. package/lib/commonjs/containers/SendbirdUIKitContainer.js +0 -1
  24. package/lib/commonjs/containers/SendbirdUIKitContainer.js.map +1 -1
  25. package/lib/commonjs/contexts/PlatformServiceCtx.js +2 -1
  26. package/lib/commonjs/contexts/PlatformServiceCtx.js.map +1 -1
  27. package/lib/commonjs/contexts/SBUHandlersCtx.js.map +1 -1
  28. package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +2 -2
  29. package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
  30. package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js +8 -4
  31. package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js.map +1 -1
  32. package/lib/commonjs/domain/groupChannelThread/component/GroupChannelThreadMessageList.js +1 -1
  33. package/lib/commonjs/domain/groupChannelThread/component/GroupChannelThreadMessageList.js.map +1 -1
  34. package/lib/commonjs/domain/groupChannelThread/component/GroupChannelThreadParentMessageInfo.js +8 -3
  35. package/lib/commonjs/domain/groupChannelThread/component/GroupChannelThreadParentMessageInfo.js.map +1 -1
  36. package/lib/commonjs/fragments/createGroupChannelFragment.js +3 -2
  37. package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
  38. package/lib/commonjs/fragments/createGroupChannelThreadFragment.js +3 -2
  39. package/lib/commonjs/fragments/createGroupChannelThreadFragment.js.map +1 -1
  40. package/lib/commonjs/hooks/useConnection.js +2 -2
  41. package/lib/commonjs/hooks/useConnection.js.map +1 -1
  42. package/lib/commonjs/hooks/usePushTokenRegistration.js +28 -7
  43. package/lib/commonjs/hooks/usePushTokenRegistration.js.map +1 -1
  44. package/lib/commonjs/localization/StringSet.en.js +2 -3
  45. package/lib/commonjs/localization/StringSet.en.js.map +1 -1
  46. package/lib/commonjs/platform/createPlayerService.expo.js +8 -2
  47. package/lib/commonjs/platform/createPlayerService.expo.js.map +1 -1
  48. package/lib/commonjs/platform/createPlayerService.native.js +9 -3
  49. package/lib/commonjs/platform/createPlayerService.native.js.map +1 -1
  50. package/lib/commonjs/platform/createRecorderService.native.js +8 -2
  51. package/lib/commonjs/platform/createRecorderService.native.js.map +1 -1
  52. package/lib/commonjs/version.js +1 -1
  53. package/lib/commonjs/version.js.map +1 -1
  54. package/lib/module/components/ChannelInput/SendInput.js +2 -1
  55. package/lib/module/components/ChannelInput/SendInput.js.map +1 -1
  56. package/lib/module/components/ChannelInput/VoiceMessageInput.js +34 -24
  57. package/lib/module/components/ChannelInput/VoiceMessageInput.js.map +1 -1
  58. package/lib/module/components/ChannelInput/index.js +12 -6
  59. package/lib/module/components/ChannelInput/index.js.map +1 -1
  60. package/lib/module/components/ChannelMessageList/index.js +6 -1
  61. package/lib/module/components/ChannelMessageList/index.js.map +1 -1
  62. package/lib/module/components/ChannelThreadMessageList/index.js +6 -1
  63. package/lib/module/components/ChannelThreadMessageList/index.js.map +1 -1
  64. package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.js +1 -1
  65. package/lib/module/components/GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.js.map +1 -1
  66. package/lib/module/components/GroupChannelMessageRenderer/index.js +1 -1
  67. package/lib/module/components/GroupChannelMessageRenderer/index.js.map +1 -1
  68. package/lib/module/components/OpenChannelMessageRenderer/OpenChannelMessageDateSeparator.js +1 -1
  69. package/lib/module/components/OpenChannelMessageRenderer/OpenChannelMessageDateSeparator.js.map +1 -1
  70. package/lib/module/components/ReactionAddons/BottomSheetReactionAddon.js +8 -4
  71. package/lib/module/components/ReactionAddons/BottomSheetReactionAddon.js.map +1 -1
  72. package/lib/module/components/ReactionBottomSheets/ReactionListBottomSheet.js +7 -3
  73. package/lib/module/components/ReactionBottomSheets/ReactionListBottomSheet.js.map +1 -1
  74. package/lib/module/components/ThreadParentMessageRenderer/index.js +1 -1
  75. package/lib/module/components/ThreadParentMessageRenderer/index.js.map +1 -1
  76. package/lib/module/containers/SendbirdUIKitContainer.js +0 -1
  77. package/lib/module/containers/SendbirdUIKitContainer.js.map +1 -1
  78. package/lib/module/contexts/PlatformServiceCtx.js +2 -1
  79. package/lib/module/contexts/PlatformServiceCtx.js.map +1 -1
  80. package/lib/module/contexts/SBUHandlersCtx.js.map +1 -1
  81. package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +2 -2
  82. package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
  83. package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js +8 -4
  84. package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js.map +1 -1
  85. package/lib/module/domain/groupChannelThread/component/GroupChannelThreadMessageList.js +1 -1
  86. package/lib/module/domain/groupChannelThread/component/GroupChannelThreadMessageList.js.map +1 -1
  87. package/lib/module/domain/groupChannelThread/component/GroupChannelThreadParentMessageInfo.js +8 -3
  88. package/lib/module/domain/groupChannelThread/component/GroupChannelThreadParentMessageInfo.js.map +1 -1
  89. package/lib/module/fragments/createGroupChannelFragment.js +3 -2
  90. package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
  91. package/lib/module/fragments/createGroupChannelThreadFragment.js +3 -2
  92. package/lib/module/fragments/createGroupChannelThreadFragment.js.map +1 -1
  93. package/lib/module/hooks/useConnection.js +2 -2
  94. package/lib/module/hooks/useConnection.js.map +1 -1
  95. package/lib/module/hooks/usePushTokenRegistration.js +28 -7
  96. package/lib/module/hooks/usePushTokenRegistration.js.map +1 -1
  97. package/lib/module/localization/StringSet.en.js +2 -2
  98. package/lib/module/localization/StringSet.en.js.map +1 -1
  99. package/lib/module/platform/createPlayerService.expo.js +9 -3
  100. package/lib/module/platform/createPlayerService.expo.js.map +1 -1
  101. package/lib/module/platform/createPlayerService.native.js +10 -4
  102. package/lib/module/platform/createPlayerService.native.js.map +1 -1
  103. package/lib/module/platform/createRecorderService.native.js +9 -3
  104. package/lib/module/platform/createRecorderService.native.js.map +1 -1
  105. package/lib/module/version.js +1 -1
  106. package/lib/module/version.js.map +1 -1
  107. package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +1 -1
  108. package/lib/typescript/src/contexts/SBUHandlersCtx.d.ts +1 -1
  109. package/lib/typescript/src/domain/groupChannel/component/GroupChannelInput.d.ts +1 -1
  110. package/lib/typescript/src/domain/groupChannel/component/GroupChannelMessageList.d.ts +1 -1
  111. package/lib/typescript/src/domain/groupChannelThread/component/GroupChannelThreadInput.d.ts +1 -1
  112. package/lib/typescript/src/domain/groupChannelThread/component/GroupChannelThreadMessageList.d.ts +1 -1
  113. package/lib/typescript/src/domain/openChannel/component/OpenChannelInput.d.ts +1 -1
  114. package/lib/typescript/src/domain/openChannel/component/OpenChannelMessageList.d.ts +1 -1
  115. package/lib/typescript/src/version.d.ts +1 -1
  116. package/package.json +6 -6
  117. package/src/components/ChannelInput/SendInput.tsx +2 -1
  118. package/src/components/ChannelInput/VoiceMessageInput.tsx +40 -24
  119. package/src/components/ChannelInput/index.tsx +16 -6
  120. package/src/components/ChannelMessageList/index.tsx +5 -1
  121. package/src/components/ChannelThreadMessageList/index.tsx +5 -1
  122. package/src/components/GroupChannelMessageRenderer/GroupChannelMessageDateSeparator.tsx +1 -1
  123. package/src/components/GroupChannelMessageRenderer/index.tsx +1 -1
  124. package/src/components/OpenChannelMessageRenderer/OpenChannelMessageDateSeparator.tsx +1 -1
  125. package/src/components/ReactionAddons/BottomSheetReactionAddon.tsx +10 -5
  126. package/src/components/ReactionBottomSheets/ReactionListBottomSheet.tsx +7 -4
  127. package/src/components/ThreadParentMessageRenderer/index.tsx +1 -1
  128. package/src/containers/SendbirdUIKitContainer.tsx +0 -1
  129. package/src/contexts/PlatformServiceCtx.tsx +2 -1
  130. package/src/contexts/SBUHandlersCtx.tsx +1 -1
  131. package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +2 -2
  132. package/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.tsx +8 -4
  133. package/src/domain/groupChannelThread/component/GroupChannelThreadMessageList.tsx +1 -1
  134. package/src/domain/groupChannelThread/component/GroupChannelThreadParentMessageInfo.tsx +7 -3
  135. package/src/fragments/createGroupChannelFragment.tsx +3 -2
  136. package/src/fragments/createGroupChannelThreadFragment.tsx +3 -2
  137. package/src/hooks/useConnection.ts +8 -2
  138. package/src/hooks/usePushTokenRegistration.ts +28 -7
  139. package/src/localization/StringSet.en.ts +2 -2
  140. package/src/platform/createPlayerService.expo.tsx +9 -3
  141. package/src/platform/createPlayerService.native.tsx +10 -4
  142. package/src/platform/createRecorderService.native.tsx +9 -3
  143. package/src/version.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare const _default: React.MemoExoticComponent<(props: Pick<import("../../../components/ChannelMessageList").ChannelMessageListProps<import("@sendbird/chat/groupChannel").GroupChannel>, "channel" | "onTopReached" | "onBottomReached" | "onScrolledAwayFromBottom" | "currentUserId" | "enableMessageGrouping" | "searchItem" | "hasNext" | "onDeleteMessage" | "onResendFailedMessage" | "onPressMediaMessage" | "renderNewMessagesButton" | "renderScrollToBottomButton" | "renderMessage" | "messages" | "newMessages" | "scrolledAwayFromBottom" | "flatListProps"> & {
2
+ declare const _default: React.MemoExoticComponent<(props: Pick<import("../../../components/ChannelMessageList").ChannelMessageListProps<import("@sendbird/chat/groupChannel").GroupChannel>, "channel" | "onBottomReached" | "onTopReached" | "onScrolledAwayFromBottom" | "currentUserId" | "enableMessageGrouping" | "searchItem" | "hasNext" | "onDeleteMessage" | "onResendFailedMessage" | "onPressMediaMessage" | "renderNewMessagesButton" | "renderScrollToBottomButton" | "renderMessage" | "messages" | "newMessages" | "scrolledAwayFromBottom" | "flatListProps"> & {
3
3
  onResetMessageList: () => Promise<void>;
4
4
  onResetMessageListWithStartingPoint: (startingPoint: number) => Promise<void>;
5
5
  onUpdateSearchItem: (searchItem?: {
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare const _default: React.MemoExoticComponent<({ inputDisabled, ...props }: import("@sendbird/uikit-utils").PickPartial<import("../../../components/ChannelInput").ChannelInputProps, "onPressUpdateUserMessage" | "shouldRenderInput" | "onPressSendUserMessage" | "onPressSendFileMessage" | "onPressUpdateFileMessage" | "SuggestedMentionList" | "AttachmentsButton", "inputDisabled">) => React.JSX.Element>;
2
+ declare const _default: React.MemoExoticComponent<({ inputDisabled, ...props }: import("@sendbird/uikit-utils").PickPartial<import("../../../components/ChannelInput").ChannelInputProps, "shouldRenderInput" | "onPressSendUserMessage" | "onPressSendFileMessage" | "onPressUpdateUserMessage" | "onPressUpdateFileMessage" | "SuggestedMentionList" | "AttachmentsButton", "inputDisabled">) => React.JSX.Element>;
3
3
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare const _default: React.MemoExoticComponent<(props: Pick<import("../../../components/ChannelThreadMessageList").ChannelThreadMessageListProps<import("@sendbird/chat/groupChannel").GroupChannel>, "channel" | "onTopReached" | "onBottomReached" | "onScrolledAwayFromBottom" | "currentUserId" | "enableMessageGrouping" | "searchItem" | "hasNext" | "onDeleteMessage" | "onResendFailedMessage" | "onPressMediaMessage" | "renderMessage" | "messages" | "newMessages" | "scrolledAwayFromBottom" | "flatListProps"> & {
2
+ declare const _default: React.MemoExoticComponent<(props: Pick<import("../../../components/ChannelThreadMessageList").ChannelThreadMessageListProps<import("@sendbird/chat/groupChannel").GroupChannel>, "channel" | "onBottomReached" | "onTopReached" | "onScrolledAwayFromBottom" | "currentUserId" | "enableMessageGrouping" | "searchItem" | "hasNext" | "onDeleteMessage" | "onResendFailedMessage" | "onPressMediaMessage" | "renderMessage" | "messages" | "newMessages" | "scrolledAwayFromBottom" | "flatListProps"> & {
3
3
  onResetMessageList: () => Promise<void>;
4
4
  onResetMessageListWithStartingPoint: (startingPoint: number) => Promise<void>;
5
5
  startingPoint?: number | undefined;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare const _default: React.MemoExoticComponent<({ inputDisabled, ...props }: import("@sendbird/uikit-utils").PickPartial<import("../../../components/ChannelInput").ChannelInputProps, "onPressUpdateUserMessage" | "shouldRenderInput" | "onPressSendUserMessage" | "onPressSendFileMessage" | "onPressUpdateFileMessage" | "AttachmentsButton", "inputDisabled">) => React.JSX.Element>;
2
+ declare const _default: React.MemoExoticComponent<({ inputDisabled, ...props }: import("@sendbird/uikit-utils").PickPartial<import("../../../components/ChannelInput").ChannelInputProps, "shouldRenderInput" | "onPressSendUserMessage" | "onPressSendFileMessage" | "onPressUpdateUserMessage" | "onPressUpdateFileMessage" | "AttachmentsButton", "inputDisabled">) => React.JSX.Element>;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- declare const _default: React.MemoExoticComponent<(props: Pick<import("../../../components/ChannelMessageList").ChannelMessageListProps<import("@sendbird/chat/openChannel").OpenChannel>, "channel" | "onTopReached" | "onBottomReached" | "onScrolledAwayFromBottom" | "currentUserId" | "enableMessageGrouping" | "hasNext" | "onDeleteMessage" | "onResendFailedMessage" | "onPressMediaMessage" | "renderNewMessagesButton" | "renderScrollToBottomButton" | "renderMessage" | "messages" | "newMessages" | "scrolledAwayFromBottom" | "flatListProps">) => React.JSX.Element>;
2
+ declare const _default: React.MemoExoticComponent<(props: Pick<import("../../../components/ChannelMessageList").ChannelMessageListProps<import("@sendbird/chat/openChannel").OpenChannel>, "channel" | "onBottomReached" | "onTopReached" | "onScrolledAwayFromBottom" | "currentUserId" | "enableMessageGrouping" | "hasNext" | "onDeleteMessage" | "onResendFailedMessage" | "onPressMediaMessage" | "renderNewMessagesButton" | "renderScrollToBottomButton" | "renderMessage" | "messages" | "newMessages" | "scrolledAwayFromBottom" | "flatListProps">) => React.JSX.Element>;
3
3
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const VERSION = "3.7.2";
1
+ declare const VERSION = "3.7.4";
2
2
  export default VERSION;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendbird/uikit-react-native",
3
- "version": "3.7.2",
3
+ "version": "3.7.4",
4
4
  "description": "Sendbird UIKit for React Native: A feature-rich and customizable chat UI kit with messaging, channel management, and user authentication.",
5
5
  "keywords": [
6
6
  "sendbird",
@@ -60,10 +60,10 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@openspacelabs/react-native-zoomable-view": "^2.1.5",
63
- "@sendbird/uikit-chat-hooks": "3.7.2",
64
- "@sendbird/uikit-react-native-foundation": "3.7.2",
63
+ "@sendbird/uikit-chat-hooks": "3.7.4",
64
+ "@sendbird/uikit-react-native-foundation": "3.7.4",
65
65
  "@sendbird/uikit-tools": "0.0.1-alpha.77",
66
- "@sendbird/uikit-utils": "3.7.2"
66
+ "@sendbird/uikit-utils": "3.7.4"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@bam.tech/react-native-image-resizer": "^3.0.4",
@@ -75,7 +75,7 @@
75
75
  "@react-native-firebase/messaging": "^14.4.0",
76
76
  "@types/react": "*",
77
77
  "@types/react-native": "*",
78
- "date-fns": "^2.28.0",
78
+ "date-fns": ">=2.28.0",
79
79
  "expo-av": "^13.2.1",
80
80
  "expo-clipboard": "^4.1.2",
81
81
  "expo-document-picker": "^11.5.3",
@@ -208,5 +208,5 @@
208
208
  ]
209
209
  ]
210
210
  },
211
- "gitHead": "b865930e985bc4e50ceab20aa9d26e73b940411c"
211
+ "gitHead": "90765f264864343d12f472b1630e70fcd8c2c5a9"
212
212
  }
@@ -216,7 +216,8 @@ const SendInput = forwardRef<RNTextInput, SendInputProps>(function SendInput(
216
216
  onClose={onClose}
217
217
  onDismiss={() => {
218
218
  onDismiss();
219
- Promise.allSettled([playerService.reset(), recorderService.reset()]);
219
+ playerService.reset().catch(() => {});
220
+ recorderService.reset().catch(() => {});
220
221
  }}
221
222
  backgroundStyle={{ justifyContent: 'flex-end' }}
222
223
  visible={voiceMessageInputVisible}
@@ -10,7 +10,7 @@ import {
10
10
  createStyleSheet,
11
11
  useUIKitTheme,
12
12
  } from '@sendbird/uikit-react-native-foundation';
13
- import { conditionChaining, millsToMMSS } from '@sendbird/uikit-utils';
13
+ import { Logger, conditionChaining, millsToMMSS } from '@sendbird/uikit-utils';
14
14
 
15
15
  import { useLocalization } from '../../hooks/useContext';
16
16
  import useVoiceMessageInput from '../../hooks/useVoiceMessageInput';
@@ -32,34 +32,50 @@ const VoiceMessageInput = ({ onClose, onSend }: VoiceMessageInputProps) => {
32
32
  const uiColors = colors.ui.voiceMessageInput.default[state.status !== 'idle' ? 'active' : 'inactive'];
33
33
 
34
34
  const onPressCancel = async () => {
35
- actions.cancel();
36
- onClose();
35
+ await actions
36
+ .cancel()
37
+ .catch((error) => {
38
+ Logger.warn('Failed to cancel voice message input', error);
39
+ })
40
+ .finally(() => {
41
+ onClose();
42
+ });
37
43
  };
38
44
 
39
45
  const onPressSend = async () => {
40
- actions.send();
41
- onClose();
46
+ await actions
47
+ .send()
48
+ .catch((error) => {
49
+ Logger.warn('Failed to send voice message', error);
50
+ })
51
+ .finally(() => {
52
+ onClose();
53
+ });
42
54
  };
43
55
 
44
- const onPressVoiceMessageAction = () => {
45
- switch (state.status) {
46
- case 'idle':
47
- actions.startRecording();
48
- break;
49
- case 'recording':
50
- if (lessThanMinimumDuration) {
51
- actions.cancel();
52
- } else {
53
- actions.stopRecording();
54
- }
55
- break;
56
- case 'recording_completed':
57
- case 'playing_paused':
58
- actions.playPlayer();
59
- break;
60
- case 'playing':
61
- actions.pausePlayer();
62
- break;
56
+ const onPressVoiceMessageAction = async () => {
57
+ try {
58
+ switch (state.status) {
59
+ case 'idle':
60
+ await actions.startRecording();
61
+ break;
62
+ case 'recording':
63
+ if (lessThanMinimumDuration) {
64
+ await actions.cancel();
65
+ } else {
66
+ await actions.stopRecording();
67
+ }
68
+ break;
69
+ case 'recording_completed':
70
+ case 'playing_paused':
71
+ await actions.playPlayer();
72
+ break;
73
+ case 'playing':
74
+ await actions.pausePlayer();
75
+ break;
76
+ }
77
+ } catch (error) {
78
+ Logger.warn('Failed to run voice message action.', state);
63
79
  }
64
80
  };
65
81
  const renderActionIcon = () => {
@@ -4,6 +4,7 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
4
 
5
5
  import { createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
6
6
  import {
7
+ Logger,
7
8
  SendbirdBaseChannel,
8
9
  SendbirdBaseMessage,
9
10
  SendbirdFileMessage,
@@ -187,12 +188,21 @@ const ChannelInput = (props: ChannelInputProps) => {
187
188
  };
188
189
 
189
190
  const useTypingTrigger = (text: string, channel: SendbirdBaseChannel) => {
190
- if (channel.isGroupChannel()) {
191
- useEffect(() => {
192
- if (text.length === 0) channel.endTyping();
193
- else channel.startTyping();
194
- }, [text]);
195
- }
191
+ useEffect(
192
+ () => {
193
+ function triggerTyping() {
194
+ if (channel.isGroupChannel()) {
195
+ const action = text.length === 0 ? channel.endTyping : channel.startTyping;
196
+ action().catch((error) => {
197
+ Logger.debug('ChannelInput: Failed to trigger typing', error);
198
+ });
199
+ }
200
+ }
201
+
202
+ triggerTyping();
203
+ },
204
+ channel.isGroupChannel() ? [text] : [],
205
+ );
196
206
  };
197
207
 
198
208
  const useTextClearOnDisabled = (setText: (val: string) => void, chatDisabled: boolean) => {
@@ -37,6 +37,7 @@ import {
37
37
  useSendbirdChat,
38
38
  useUserProfile,
39
39
  } from '../../hooks/useContext';
40
+ import SBUUtils from '../../libs/SBUUtils';
40
41
  import ChatFlatList from '../ChatFlatList';
41
42
  import { ReactionAddons } from '../ReactionAddons';
42
43
 
@@ -271,8 +272,11 @@ const useCreateMessagePressActions = <T extends SendbirdGroupChannel | SendbirdO
271
272
  const fileType = getFileType(message.type || getFileExtension(message.name));
272
273
  if (['image', 'video', 'audio'].includes(fileType)) {
273
274
  onPressMediaMessage?.(message, () => onDeleteMessage(message), getAvailableUriFromFileMessage(message));
275
+ handlers.onOpenFileURL?.(message.url);
276
+ } else {
277
+ const openFile = handlers.onOpenFileURL ?? SBUUtils.openURL;
278
+ openFile(message.url);
274
279
  }
275
- handlers.onOpenFileURL(message.url);
276
280
  }
277
281
  };
278
282
 
@@ -37,6 +37,7 @@ import {
37
37
  useSendbirdChat,
38
38
  useUserProfile,
39
39
  } from '../../hooks/useContext';
40
+ import SBUUtils from '../../libs/SBUUtils';
40
41
  import { ReactionAddons } from '../ReactionAddons';
41
42
  import ThreadChatFlatList from '../ThreadChatFlatList';
42
43
 
@@ -249,8 +250,11 @@ const useCreateMessagePressActions = <T extends SendbirdGroupChannel | SendbirdO
249
250
  const fileType = getFileType(message.type || getFileExtension(message.name));
250
251
  if (['image', 'video', 'audio'].includes(fileType)) {
251
252
  onPressMediaMessage?.(message, () => onDeleteMessage(message), getAvailableUriFromFileMessage(message));
253
+ handlers.onOpenFileURL?.(message.url);
254
+ } else {
255
+ const openFile = handlers.onOpenFileURL ?? SBUUtils.openURL;
256
+ openFile(message.url);
252
257
  }
253
- handlers.onOpenFileURL(message.url);
254
258
  }
255
259
  };
256
260
 
@@ -1,4 +1,4 @@
1
- import isSameDay from 'date-fns/isSameDay';
1
+ import { isSameDay } from 'date-fns';
2
2
  import React from 'react';
3
3
  import { View } from 'react-native';
4
4
 
@@ -279,7 +279,7 @@ const GroupChannelMessageRenderer: GroupChannelProps['Fragment']['renderMessage'
279
279
  onUnsubscribeStatus={voiceMessageStatusManager.unsubscribe}
280
280
  onUnmount={() => {
281
281
  if (isVoiceMessage(message) && playerService.uri === message.url) {
282
- resetPlayer();
282
+ resetPlayer().catch((_) => {});
283
283
  }
284
284
  }}
285
285
  {...messageProps}
@@ -1,4 +1,4 @@
1
- import isSameDay from 'date-fns/isSameDay';
1
+ import { isSameDay } from 'date-fns';
2
2
  import React from 'react';
3
3
  import { View } from 'react-native';
4
4
 
@@ -5,7 +5,7 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
5
5
  import type { BaseMessage } from '@sendbird/chat/message';
6
6
  import { useChannelHandler } from '@sendbird/uikit-chat-hooks';
7
7
  import { Icon, Image, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
8
- import { SendbirdBaseChannel, SendbirdBaseMessage, useUniqHandlerId } from '@sendbird/uikit-utils';
8
+ import { Logger, SendbirdBaseChannel, SendbirdBaseMessage, useUniqHandlerId } from '@sendbird/uikit-utils';
9
9
 
10
10
  import { UNKNOWN_USER_ID } from '../../constants';
11
11
  import { useReaction, useSendbirdChat } from '../../hooks/useContext';
@@ -46,10 +46,15 @@ const BottomSheetReactionAddon = ({ onClose, message, channel }: Props) => {
46
46
  const currentUserIdx = reactionUserIds.indexOf(currentUser?.userId ?? UNKNOWN_USER_ID);
47
47
  const reacted = currentUserIdx > -1;
48
48
 
49
- const onPress = () => {
50
- if (reacted) channel.deleteReaction(message, key);
51
- else channel.addReaction(message, key);
52
- onClose();
49
+ const onPress = async () => {
50
+ const action = reacted ? channel.deleteReaction : channel.addReaction;
51
+ await action(message, key)
52
+ .catch((error) => {
53
+ Logger.warn('Failed to reaction', error);
54
+ })
55
+ .finally(() => {
56
+ onClose();
57
+ });
53
58
  };
54
59
 
55
60
  return (
@@ -3,6 +3,7 @@ import { FlatList, Pressable, View, useWindowDimensions } from 'react-native';
3
3
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
4
 
5
5
  import { Image, Modal, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
6
+ import { Logger } from '@sendbird/uikit-utils';
6
7
 
7
8
  import { UNKNOWN_USER_ID } from '../../constants';
8
9
  import type { ReactionBottomSheetProps } from './index';
@@ -53,12 +54,14 @@ const ReactionListBottomSheet = ({ visible, onClose, onDismiss, reactionCtx, cha
53
54
  <View style={styles.emojiItem}>
54
55
  <Pressable
55
56
  key={key}
56
- onPress={() => {
57
+ onPress={async () => {
57
58
  if (message && channel) {
58
- if (reacted) channel.deleteReaction(message, key);
59
- else channel.addReaction(message, key);
59
+ const action = reacted ? channel.deleteReaction : channel.addReaction;
60
+ action(message, key).catch((error) => {
61
+ Logger.warn('Failed to reaction', error);
62
+ });
60
63
  }
61
- onClose();
64
+ await onClose();
62
65
  }}
63
66
  style={({ pressed }) => [
64
67
  styles.button,
@@ -178,7 +178,7 @@ const ThreadParentMessageRenderer = (props: ThreadParentMessageRendererProps) =>
178
178
  durationMetaArrayKey={VOICE_MESSAGE_META_ARRAY_DURATION_KEY}
179
179
  onUnmount={() => {
180
180
  if (isVoiceMessage(parentMessage) && playerService.uri === parentMessage.url) {
181
- resetPlayer();
181
+ resetPlayer().catch((_) => {});
182
182
  }
183
183
  }}
184
184
  {...messageProps}
@@ -219,7 +219,6 @@ const SendbirdUIKitContainer = (props: SendbirdUIKitContainerProps) => {
219
219
 
220
220
  const sbuHandlers: SBUHandlers = {
221
221
  onOpenURL: SBUUtils.openURL,
222
- onOpenFileURL: SBUUtils.openURL,
223
222
  ...handlers,
224
223
  };
225
224
 
@@ -31,7 +31,8 @@ export const PlatformServiceProvider = ({ children, voiceMessageConfig, ...servi
31
31
 
32
32
  useAppState('change', (state) => {
33
33
  if (state !== 'active') {
34
- Promise.allSettled([services.playerService.reset(), services.recorderService.reset()]);
34
+ services.playerService.reset().catch(() => {});
35
+ services.recorderService.reset().catch(() => {});
35
36
  }
36
37
  });
37
38
 
@@ -14,7 +14,7 @@ export interface SBUHandlers {
14
14
  * Note that this function is also called redundantly
15
15
  * when `onPressMediaMessage` handler is triggered by clicking on media messages containing images, videos, or audio.
16
16
  */
17
- onOpenFileURL: (url: string) => void;
17
+ onOpenFileURL?: (url: string) => void;
18
18
  }
19
19
 
20
20
  type Props = React.PropsWithChildren<SBUHandlers>;
@@ -40,7 +40,7 @@ const GroupChannelMessageList = (props: GroupChannelProps['MessageList']) => {
40
40
  if (focusAnimated) {
41
41
  props.onUpdateSearchItem({ startingPoint: createdAt });
42
42
  }
43
- props.onResetMessageListWithStartingPoint(createdAt);
43
+ props.onResetMessageListWithStartingPoint(createdAt).catch((_) => {});
44
44
  } else {
45
45
  return false;
46
46
  }
@@ -54,7 +54,7 @@ const GroupChannelMessageList = (props: GroupChannelProps['MessageList']) => {
54
54
  props.onUpdateSearchItem(undefined);
55
55
  props.onScrolledAwayFromBottom(false);
56
56
 
57
- await props.onResetMessageList();
57
+ await props.onResetMessageList().catch((_) => {});
58
58
  props.onScrolledAwayFromBottom(false);
59
59
  lazyScrollToBottom({ animated });
60
60
  } else {
@@ -47,10 +47,14 @@ const GroupChannelSettingsMenu = ({
47
47
  }
48
48
 
49
49
  const toggleNotification = async () => {
50
- if (channel.myPushTriggerOption === 'off') {
51
- await channel.setMyPushTriggerOption(PushTriggerOption.DEFAULT);
52
- } else {
53
- await channel.setMyPushTriggerOption(PushTriggerOption.OFF);
50
+ try {
51
+ if (channel.myPushTriggerOption === 'off') {
52
+ await channel.setMyPushTriggerOption(PushTriggerOption.DEFAULT);
53
+ } else {
54
+ await channel.setMyPushTriggerOption(PushTriggerOption.OFF);
55
+ }
56
+ } catch (error) {
57
+ Logger.warn('Failed to toggle notification', error);
54
58
  }
55
59
  };
56
60
 
@@ -33,7 +33,7 @@ const GroupChannelThreadMessageList = (props: GroupChannelThreadProps['MessageLi
33
33
  if (props.hasNext()) {
34
34
  props.onScrolledAwayFromBottom(false);
35
35
 
36
- await props.onResetMessageList();
36
+ await props.onResetMessageList().catch((_) => {});
37
37
  props.onScrolledAwayFromBottom(false);
38
38
  lazyScrollToBottom({ animated });
39
39
  } else {
@@ -31,6 +31,7 @@ import ThreadParentMessageRenderer, {
31
31
  ThreadParentMessageRendererProps,
32
32
  } from '../../../components/ThreadParentMessageRenderer';
33
33
  import { useLocalization, usePlatformService, useSBUHandlers, useSendbirdChat } from '../../../hooks/useContext';
34
+ import SBUUtils from '../../../libs/SBUUtils';
34
35
  import { GroupChannelThreadContexts } from '../module/moduleContext';
35
36
  import type { GroupChannelThreadProps } from '../types';
36
37
  import { ReactionAddons } from './../../../components/ReactionAddons';
@@ -224,9 +225,12 @@ const useCreateMessagePressActions = ({
224
225
  if (message.isFileMessage()) {
225
226
  const fileType = getFileType(message.type || getFileExtension(message.name));
226
227
  if (['image', 'video', 'audio'].includes(fileType)) {
227
- onPressMediaMessage?.(message, () => onDeleteMessage?.(message), getAvailableUriFromFileMessage(message));
228
+ onPressMediaMessage?.(message, () => onDeleteMessage(message), getAvailableUriFromFileMessage(message));
229
+ handlers.onOpenFileURL?.(message.url);
230
+ } else {
231
+ const openFile = handlers.onOpenFileURL ?? SBUUtils.openURL;
232
+ openFile(message.url);
228
233
  }
229
- handlers.onOpenFileURL(message.url);
230
234
  }
231
235
  };
232
236
 
@@ -239,7 +243,7 @@ const useCreateMessagePressActions = ({
239
243
  text: STRINGS.LABELS.CHANNEL_MESSAGE_DELETE_CONFIRM_OK,
240
244
  style: 'destructive',
241
245
  onPress: () => {
242
- onDeleteMessage?.(message).catch(onDeleteFailure);
246
+ onDeleteMessage(message).catch(onDeleteFailure);
243
247
  },
244
248
  },
245
249
  ],
@@ -116,8 +116,9 @@ const createGroupChannelFragment = (initModule?: Partial<GroupChannelModule>): G
116
116
  startingPoint: internalSearchItem?.startingPoint,
117
117
  });
118
118
 
119
- const onBlurFragment = () => {
120
- return Promise.allSettled([playerService.reset(), recorderService.reset()]);
119
+ const onBlurFragment = async () => {
120
+ await playerService.reset().catch(() => {});
121
+ await recorderService.reset().catch(() => {});
121
122
  };
122
123
  const _onPressHeaderLeft = useFreshCallback(async () => {
123
124
  voiceMessageStatusManager.clear();
@@ -103,8 +103,9 @@ const createGroupChannelThreadFragment = (
103
103
  startingPoint,
104
104
  });
105
105
 
106
- const onBlurFragment = () => {
107
- return Promise.allSettled([playerService.reset(), recorderService.reset()]);
106
+ const onBlurFragment = async () => {
107
+ await playerService.reset().catch(() => {});
108
+ await recorderService.reset().catch(() => {});
108
109
  };
109
110
  const _onPressHeaderLeft = useFreshCallback(async () => {
110
111
  await onBlurFragment();
@@ -52,7 +52,10 @@ const useConnection = () => {
52
52
  });
53
53
  }
54
54
 
55
- await Promise.allSettled([initEmoji(sdk, emojiManager), initDashboardConfigs(sdk)]);
55
+ await Promise.all([
56
+ initEmoji(sdk, emojiManager).catch(() => Logger.info('[useConnection]', 'initEmoji failure')),
57
+ initDashboardConfigs(sdk).catch(() => Logger.info('[useConnection]', 'initDashboardConfigs failure')),
58
+ ]);
56
59
 
57
60
  Logger.debug('[useConnection]', 'connected! (online)');
58
61
  setCurrentUser(user);
@@ -67,7 +70,10 @@ const useConnection = () => {
67
70
  Logger.warn('[useConnection]', 'clear cached-data');
68
71
  await sdk.clearCachedData().catch((e) => Logger.warn('[useConnection]', 'clear cached-data failure', e));
69
72
  } else if (sdk.currentUser) {
70
- await Promise.allSettled([initEmoji(sdk, emojiManager), initDashboardConfigs(sdk)]);
73
+ await Promise.all([
74
+ initEmoji(sdk, emojiManager).catch(() => Logger.info('[useConnection]', 'initEmoji failure')),
75
+ initDashboardConfigs(sdk).catch(() => Logger.info('[useConnection]', 'initDashboardConfigs failure')),
76
+ ]);
71
77
 
72
78
  Logger.debug('[useConnection]', 'connected! (offline)');
73
79
  setCurrentUser(sdk.currentUser);
@@ -38,24 +38,45 @@ const usePushTokenRegistration = () => {
38
38
  }
39
39
  }
40
40
 
41
- // Register device token
41
+ // Register token refresh listener
42
+ refreshListener.current = notificationService.onTokenRefresh(registerToken);
43
+
44
+ // Register token
42
45
  const token = await getToken();
43
46
  if (token) {
44
- Logger.log('[usePushTokenRegistration]', 'registered token:', token);
45
- registerToken(token);
47
+ try {
48
+ await registerToken(token);
49
+ Logger.log('[usePushTokenRegistration]', 'registered token:', token);
50
+ } catch (error) {
51
+ Logger.error('[usePushTokenRegistration]', 'failed to register token:', error);
52
+ }
46
53
  }
47
54
 
48
55
  // Remove listener
49
- refreshListener.current = notificationService.onTokenRefresh(registerToken);
56
+ refreshListener.current = notificationService.onTokenRefresh(async (token) => {
57
+ try {
58
+ await registerToken(token);
59
+ Logger.log('[usePushTokenRegistration]', 'registered token:', token);
60
+ } catch (error) {
61
+ Logger.error('[usePushTokenRegistration]', 'failed to register token:', error);
62
+ }
63
+ });
50
64
  });
51
65
 
52
66
  const unregisterPushTokenForCurrentUser = useFreshCallback(async () => {
67
+ // Unregister token refresh listener
68
+ refreshListener.current?.();
69
+
70
+ // Unregister token
53
71
  const token = await getToken();
54
72
  if (token) {
55
- unregisterToken(token);
56
- Logger.log('[usePushTokenRegistration]', 'unregistered token:', token);
73
+ try {
74
+ await unregisterToken(token);
75
+ Logger.log('[usePushTokenRegistration]', 'unregistered token:', token);
76
+ } catch (error) {
77
+ Logger.error('[usePushTokenRegistration]', 'failed to unregister token:', error);
78
+ }
57
79
  }
58
- refreshListener.current?.();
59
80
  });
60
81
 
61
82
  return { registerPushTokenForCurrentUser, unregisterPushTokenForCurrentUser };
@@ -1,7 +1,7 @@
1
- import dateLocale from 'date-fns/locale/en-US';
1
+ import { enUS } from 'date-fns/locale';
2
2
 
3
3
  import { createBaseStringSet } from './createBaseStringSet';
4
4
 
5
- const StringSetEn = createBaseStringSet({ dateLocale });
5
+ const StringSetEn = createBaseStringSet({ dateLocale: enUS });
6
6
 
7
7
  export default StringSetEn;
@@ -1,6 +1,6 @@
1
1
  import type * as ExpoAV from 'expo-av';
2
2
 
3
- import { matchesOneOf } from '@sendbird/uikit-utils';
3
+ import { Logger, matchesOneOf } from '@sendbird/uikit-utils';
4
4
 
5
5
  import expoPermissionGranted from '../utils/expoPermissionGranted';
6
6
  import type { PlayerServiceInterface, Unsubscribe } from './types';
@@ -28,10 +28,16 @@ const createExpoPlayerService = ({ avModule }: Modules): PlayerServiceInterface
28
28
  };
29
29
 
30
30
  private setListener = () => {
31
- sound.setProgressUpdateIntervalAsync(100);
31
+ sound.setProgressUpdateIntervalAsync(100).catch((error) => {
32
+ Logger.warn('[PlayerService.Expo] Failed to set progress update interval', error);
33
+ });
32
34
  sound.setOnPlaybackStatusUpdate((status) => {
33
35
  if (status.isLoaded) {
34
- if (status.didJustFinish) this.stop();
36
+ if (status.didJustFinish) {
37
+ this.stop().catch((error) => {
38
+ Logger.warn('[PlayerService.Expo] Failed to stop in OnPlaybackStatusUpdate', error);
39
+ });
40
+ }
35
41
  if (status.isPlaying) {
36
42
  this.playbackSubscribers.forEach((callback) => {
37
43
  callback({