@messenger-box/platform-mobile 0.0.1-alpha.381 → 0.0.1-alpha.382

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.0.1-alpha.382](https://github.com/CDEBase/messenger-box/compare/v0.0.1-alpha.381...v0.0.1-alpha.382) (2023-08-14)
7
+
8
+ **Note:** Version bump only for package @messenger-box/platform-mobile
9
+
6
10
  ## [0.0.1-alpha.381](https://github.com/CDEBase/messenger-box/compare/v0.0.1-alpha.380...v0.0.1-alpha.381) (2023-08-09)
7
11
 
8
12
  **Note:** Version bump only for package @messenger-box/platform-mobile
package/lib/index.js CHANGED
@@ -2060,6 +2060,12 @@ const ConversationViewComponent = ({ channelId, role }) => {
2060
2060
  return;
2061
2061
  if (!message && message != ' ' && images.length == 0)
2062
2062
  return;
2063
+ const notificationData = {
2064
+ url: config_1.config.INBOX_MESSEGE_PATH,
2065
+ params: { channelId, hideTabBar: true },
2066
+ screen: 'DialogMessages',
2067
+ other: { sound: react_native_1.Platform.OS === 'android' ? false || null : 'default' },
2068
+ };
2063
2069
  if (images && images.length > 0) {
2064
2070
  const postId = mongooseObjectId === null || mongooseObjectId === void 0 ? void 0 : mongooseObjectId.getNewMongooseObjectId;
2065
2071
  setLoading(true);
@@ -2091,6 +2097,7 @@ const ConversationViewComponent = ({ channelId, role }) => {
2091
2097
  channelId,
2092
2098
  content: message,
2093
2099
  files,
2100
+ notificationParams: notificationData,
2094
2101
  },
2095
2102
  update: (cache, { data, errors }) => {
2096
2103
  if (!data || errors) {
@@ -2112,7 +2119,7 @@ const ConversationViewComponent = ({ channelId, role }) => {
2112
2119
  setLoading(false);
2113
2120
  setMsg('');
2114
2121
  const msg = message == '' ? 'Send a file' : message;
2115
- sendPushNotification(data === null || data === void 0 ? void 0 : data.sendMessage, channelId);
2122
+ //sendPushNotification(data?.sendMessage, channelId);
2116
2123
  },
2117
2124
  });
2118
2125
  }
@@ -2123,6 +2130,7 @@ const ConversationViewComponent = ({ channelId, role }) => {
2123
2130
  variables: {
2124
2131
  channelId,
2125
2132
  content: message,
2133
+ notificationParams: notificationData,
2126
2134
  },
2127
2135
  update: (cache, { data, errors }) => {
2128
2136
  if (!data || errors) {
@@ -2134,26 +2142,25 @@ const ConversationViewComponent = ({ channelId, role }) => {
2134
2142
  setChannelToTop(channelToTop + 1);
2135
2143
  setLoading(false);
2136
2144
  setMsg('');
2137
- sendPushNotification(data === null || data === void 0 ? void 0 : data.sendMessage, channelId);
2145
+ // sendPushNotification(data?.sendMessage, channelId);
2138
2146
  },
2139
2147
  });
2140
2148
  }
2141
2149
  }, [mongooseObjectId, setChannelMessages, channelId, images, channelToTop, expoTokens]);
2142
- const sendPushNotification = async (post, channelId) => {
2143
- var _a;
2144
- const notificationData = {
2145
- url: config_1.config.INBOX_MESSEGE_PATH,
2146
- params: { channelId, hideTabBar: true },
2147
- screen: 'DialogMessages',
2148
- other: { sound: react_native_1.Platform.OS === 'android' ? false || null : 'default' },
2149
- };
2150
- await sendExpoNotificationOnPostMutation({
2151
- variables: {
2152
- postId: (_a = post === null || post === void 0 ? void 0 : post.id) === null || _a === void 0 ? void 0 : _a.toString(),
2153
- notificationData,
2154
- },
2155
- });
2156
- };
2150
+ // const sendPushNotification = async (post: IPost, channelId: string) => {
2151
+ // const notificationData: IExpoNotificationData = {
2152
+ // url: config.INBOX_MESSEGE_PATH,
2153
+ // params: { channelId, hideTabBar: true },
2154
+ // screen: 'DialogMessages',
2155
+ // other: { sound: Platform.OS === 'android' ? undefined || null : 'default' },
2156
+ // };
2157
+ // await sendExpoNotificationOnPostMutation({
2158
+ // variables: {
2159
+ // postId: post?.id?.toString(),
2160
+ // notificationData,
2161
+ // },
2162
+ // });
2163
+ // };
2157
2164
  // const fetchTokenAndSendPushNotification = (message: any, channelId: any) => {
2158
2165
  // const givenName = auth?.profile?.given_name ?? '';
2159
2166
  // const familyName = auth?.profile?.family_name ?? '';