zmp-sdk 2.15.0-rc.1 → 2.15.0-rc.2

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.
@@ -36793,7 +36793,7 @@
36793
36793
  }
36794
36794
  };
36795
36795
 
36796
- var version = "2.15.0-rc.1";
36796
+ var version = "2.15.0-rc.2";
36797
36797
 
36798
36798
  class Basics {
36799
36799
  /**
@@ -38693,21 +38693,33 @@
38693
38693
  if (!resData || resData.err !== 0) {
38694
38694
  throw apiResponse.error.cannotGetShareInfo();
38695
38695
  }
38696
- reqData = {
38697
- data: {
38698
- ZInstantAPIInfo: {
38699
- url: `${resData.data.zinstantApi}`,
38700
- zinstantdata_id: `templateId=11412&appId=${this.getAppId()}&shareId=${resData.data.shareId}`
38701
- },
38702
- previewMsgText: {
38703
- msg: {
38704
- en: description.en,
38705
- vi: description.vi
38706
- }
38707
- },
38708
- enableReactions: 1
38709
- }
38710
- };
38696
+ const zaloVersion = getZaloVersion();
38697
+ const platform = checkPlatform();
38698
+ if ((platform.isAndroid && zaloVersion % 100000 <= 593) ||
38699
+ (platform.isIOS && zaloVersion <= 424)) {
38700
+ reqData = {
38701
+ link: `${resData.data.shareUrl}`,
38702
+ chatOnly: object.data.chatOnly ? 1 : 0
38703
+ };
38704
+ object.type = 'link';
38705
+ }
38706
+ else {
38707
+ reqData = {
38708
+ data: {
38709
+ ZInstantAPIInfo: {
38710
+ url: `${resData.data.zinstantApi}`,
38711
+ zinstantdata_id: `templateId=11412&appId=${this.getAppId()}&shareId=${resData.data.shareId}`
38712
+ },
38713
+ previewMsgText: {
38714
+ msg: {
38715
+ en: description.en,
38716
+ vi: description.vi
38717
+ }
38718
+ },
38719
+ enableReactions: 1
38720
+ }
38721
+ };
38722
+ }
38711
38723
  }
38712
38724
  return yield this.callNative(ACTION.OPEN_SHARESHEET.name, Object.assign(Object.assign({ type: ShareSheetType[object.type] }, reqData), { zapp: this.getZAppId() }), {
38713
38725
  haveTimeout: false
package/dist/index.es.js CHANGED
@@ -36790,7 +36790,7 @@ const apiResponse = {
36790
36790
  }
36791
36791
  };
36792
36792
 
36793
- var version = "2.15.0-rc.1";
36793
+ var version = "2.15.0-rc.2";
36794
36794
 
36795
36795
  class Basics {
36796
36796
  /**
@@ -38690,21 +38690,33 @@ class Zalo {
38690
38690
  if (!resData || resData.err !== 0) {
38691
38691
  throw apiResponse.error.cannotGetShareInfo();
38692
38692
  }
38693
- reqData = {
38694
- data: {
38695
- ZInstantAPIInfo: {
38696
- url: `${resData.data.zinstantApi}`,
38697
- zinstantdata_id: `templateId=11412&appId=${this.getAppId()}&shareId=${resData.data.shareId}`
38698
- },
38699
- previewMsgText: {
38700
- msg: {
38701
- en: description.en,
38702
- vi: description.vi
38703
- }
38704
- },
38705
- enableReactions: 1
38706
- }
38707
- };
38693
+ const zaloVersion = getZaloVersion();
38694
+ const platform = checkPlatform();
38695
+ if ((platform.isAndroid && zaloVersion % 100000 <= 593) ||
38696
+ (platform.isIOS && zaloVersion <= 424)) {
38697
+ reqData = {
38698
+ link: `${resData.data.shareUrl}`,
38699
+ chatOnly: object.data.chatOnly ? 1 : 0
38700
+ };
38701
+ object.type = 'link';
38702
+ }
38703
+ else {
38704
+ reqData = {
38705
+ data: {
38706
+ ZInstantAPIInfo: {
38707
+ url: `${resData.data.zinstantApi}`,
38708
+ zinstantdata_id: `templateId=11412&appId=${this.getAppId()}&shareId=${resData.data.shareId}`
38709
+ },
38710
+ previewMsgText: {
38711
+ msg: {
38712
+ en: description.en,
38713
+ vi: description.vi
38714
+ }
38715
+ },
38716
+ enableReactions: 1
38717
+ }
38718
+ };
38719
+ }
38708
38720
  }
38709
38721
  return yield this.callNative(ACTION.OPEN_SHARESHEET.name, Object.assign(Object.assign({ type: ShareSheetType[object.type] }, reqData), { zapp: this.getZAppId() }), {
38710
38722
  haveTimeout: false