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

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@messenger-box/platform-mobile",
3
- "version": "0.0.1-alpha.381",
3
+ "version": "0.0.1-alpha.383",
4
4
  "description": "Sample core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -19,8 +19,8 @@
19
19
  "watch": "yarn build:lib:watch"
20
20
  },
21
21
  "dependencies": {
22
- "@messenger-box/core": "0.0.1-alpha.381",
23
- "@messenger-box/platform-client": "0.0.1-alpha.381",
22
+ "@messenger-box/core": "0.0.1-alpha.383",
23
+ "@messenger-box/platform-client": "0.0.1-alpha.383",
24
24
  "base-64": "1.0.0",
25
25
  "react-native-gifted-chat": "1.0.4"
26
26
  },
@@ -40,5 +40,5 @@
40
40
  "typescript": {
41
41
  "definition": "lib/index.d.ts"
42
42
  },
43
- "gitHead": "a29575188273c7ba6f998bff5ea2a3234faaeb72"
43
+ "gitHead": "8d946ce0bd5226581ae012e90fd0ee614a06c77f"
44
44
  }
@@ -524,6 +524,13 @@ const ConversationViewComponent = ({ channelId, role }: any) => {
524
524
  if (!channelId) return;
525
525
  if (!message && message != ' ' && images.length == 0) return;
526
526
 
527
+ const notificationData: IExpoNotificationData = {
528
+ url: config.INBOX_MESSEGE_PATH,
529
+ params: { channelId, hideTabBar: true },
530
+ screen: 'DialogMessages',
531
+ other: { sound: Platform.OS === 'android' ? undefined || null : 'default' },
532
+ };
533
+
527
534
  if (images && images.length > 0) {
528
535
  const postId: any = mongooseObjectId?.getNewMongooseObjectId;
529
536
  setLoading(true);
@@ -555,6 +562,7 @@ const ConversationViewComponent = ({ channelId, role }: any) => {
555
562
  channelId,
556
563
  content: message,
557
564
  files,
565
+ notificationParams: notificationData,
558
566
  },
559
567
  update: (cache, { data, errors }: any) => {
560
568
  if (!data || errors) {
@@ -576,7 +584,7 @@ const ConversationViewComponent = ({ channelId, role }: any) => {
576
584
  setLoading(false);
577
585
  setMsg('');
578
586
  const msg = message == '' ? 'Send a file' : message;
579
- sendPushNotification(data?.sendMessage, channelId);
587
+ //sendPushNotification(data?.sendMessage, channelId);
580
588
  },
581
589
  });
582
590
  }
@@ -586,6 +594,7 @@ const ConversationViewComponent = ({ channelId, role }: any) => {
586
594
  variables: {
587
595
  channelId,
588
596
  content: message,
597
+ notificationParams: notificationData,
589
598
  },
590
599
  update: (cache, { data, errors }: any) => {
591
600
  if (!data || errors) {
@@ -597,7 +606,7 @@ const ConversationViewComponent = ({ channelId, role }: any) => {
597
606
  setChannelToTop(channelToTop + 1);
598
607
  setLoading(false);
599
608
  setMsg('');
600
- sendPushNotification(data?.sendMessage, channelId);
609
+ // sendPushNotification(data?.sendMessage, channelId);
601
610
  },
602
611
  });
603
612
  }
@@ -605,21 +614,21 @@ const ConversationViewComponent = ({ channelId, role }: any) => {
605
614
  [mongooseObjectId, setChannelMessages, channelId, images, channelToTop, expoTokens],
606
615
  );
607
616
 
608
- const sendPushNotification = async (post: IPost, channelId: string) => {
609
- const notificationData: IExpoNotificationData = {
610
- url: config.INBOX_MESSEGE_PATH,
611
- params: { channelId, hideTabBar: true },
612
- screen: 'DialogMessages',
613
- other: { sound: Platform.OS === 'android' ? undefined || null : 'default' },
614
- };
615
-
616
- await sendExpoNotificationOnPostMutation({
617
- variables: {
618
- postId: post?.id?.toString(),
619
- notificationData,
620
- },
621
- });
622
- };
617
+ // const sendPushNotification = async (post: IPost, channelId: string) => {
618
+ // const notificationData: IExpoNotificationData = {
619
+ // url: config.INBOX_MESSEGE_PATH,
620
+ // params: { channelId, hideTabBar: true },
621
+ // screen: 'DialogMessages',
622
+ // other: { sound: Platform.OS === 'android' ? undefined || null : 'default' },
623
+ // };
624
+
625
+ // await sendExpoNotificationOnPostMutation({
626
+ // variables: {
627
+ // postId: post?.id?.toString(),
628
+ // notificationData,
629
+ // },
630
+ // });
631
+ // };
623
632
 
624
633
  // const fetchTokenAndSendPushNotification = (message: any, channelId: any) => {
625
634
  // const givenName = auth?.profile?.given_name ?? '';