zmp-sdk 2.16.2 → 2.16.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.
@@ -17892,7 +17892,7 @@
17892
17892
  var version$2 = ''; // empty string to avoid regexp issues
17893
17893
  var versions = {};
17894
17894
  var release$1 = {};
17895
- var config = {};
17895
+ var config$1 = {};
17896
17896
 
17897
17897
  function noop$1() {}
17898
17898
 
@@ -17969,7 +17969,7 @@
17969
17969
  hrtime: hrtime,
17970
17970
  platform: platform$2,
17971
17971
  release: release$1,
17972
- config: config,
17972
+ config: config$1,
17973
17973
  uptime: uptime$1
17974
17974
  };
17975
17975
 
@@ -36191,7 +36191,7 @@
36191
36191
  }
36192
36192
  }
36193
36193
 
36194
- var CONFIG = (() => {
36194
+ var config = (() => {
36195
36195
  const Byte = 1;
36196
36196
  const KB = 1024 * Byte;
36197
36197
  const MB = 1024 * KB;
@@ -36720,7 +36720,7 @@
36720
36720
  }
36721
36721
  _ZJSBridgeProvider_bridge = new WeakMap();
36722
36722
 
36723
- var version = "2.16.2";
36723
+ var version = "2.16.3";
36724
36724
 
36725
36725
  class Basics {
36726
36726
  /**
@@ -37138,19 +37138,19 @@
37138
37138
  const network = data.network;
37139
37139
  let networkType;
37140
37140
  switch (network) {
37141
- case CONFIG.NETWORK_TYPE.NONE:
37141
+ case config.NETWORK_TYPE.NONE:
37142
37142
  networkType = NetworkType.none;
37143
37143
  break;
37144
- case CONFIG.NETWORK_TYPE.WIFI:
37144
+ case config.NETWORK_TYPE.WIFI:
37145
37145
  networkType = NetworkType.wifi;
37146
37146
  break;
37147
- case CONFIG.NETWORK_TYPE['2G']:
37147
+ case config.NETWORK_TYPE['2G']:
37148
37148
  networkType = NetworkType.cellular;
37149
37149
  break;
37150
- case CONFIG.NETWORK_TYPE['3G']:
37150
+ case config.NETWORK_TYPE['3G']:
37151
37151
  networkType = NetworkType.cellular;
37152
37152
  break;
37153
- case CONFIG.NETWORK_TYPE['4G']:
37153
+ case config.NETWORK_TYPE['4G']:
37154
37154
  networkType = NetworkType.cellular;
37155
37155
  break;
37156
37156
  default:
@@ -37694,7 +37694,7 @@
37694
37694
  __classPrivateFieldSet(this, _LocalResourceStorage_resourceInfo, {
37695
37695
  keys: new Set(),
37696
37696
  currentSize: 0,
37697
- limitSize: CONFIG.STORAGE_LIMIT
37697
+ limitSize: config.STORAGE_LIMIT
37698
37698
  });
37699
37699
  __classPrivateFieldSet(this, _LocalResourceStorage_prefix, prefix);
37700
37700
  this.findAllCurrentDataByApp(prefix);
@@ -37757,7 +37757,7 @@
37757
37757
  currentSize: lodash.isNumber(currentSize)
37758
37758
  ? Number((currentSize / 1024).toFixed(2))
37759
37759
  : 0,
37760
- limitSize: Number((CONFIG.STORAGE_LIMIT / 1024).toFixed(2))
37760
+ limitSize: Number((config.STORAGE_LIMIT / 1024).toFixed(2))
37761
37761
  };
37762
37762
  }
37763
37763
  remove(keys) {
@@ -37803,7 +37803,7 @@
37803
37803
  __classPrivateFieldSet(this, _NativeResourceStorage_resourceInfo, {
37804
37804
  keys: new Set(),
37805
37805
  currentSize: 0,
37806
- limitSize: CONFIG.STORAGE_LIMIT
37806
+ limitSize: config.STORAGE_LIMIT
37807
37807
  });
37808
37808
  __classPrivateFieldSet(this, _NativeResourceStorage_appId, appId);
37809
37809
  }
@@ -37863,7 +37863,7 @@
37863
37863
  });
37864
37864
  return {
37865
37865
  currentSize: lodash.isNumber(currentSize) ? Number(currentSize / 1024) : 0,
37866
- limitSize: Number(CONFIG.STORAGE_LIMIT / 1024)
37866
+ limitSize: Number(config.STORAGE_LIMIT / 1024)
37867
37867
  };
37868
37868
  });
37869
37869
  }
@@ -38119,7 +38119,7 @@
38119
38119
  fields = `${fields}.type(${object === null || object === void 0 ? void 0 : object.avatarType})`;
38120
38120
  }
38121
38121
  const userInfo = yield axios
38122
- .get(CONFIG.APIS.GET_USER_INFO, {
38122
+ .get(config.APIS.GET_USER_INFO, {
38123
38123
  params: {
38124
38124
  fields: fields,
38125
38125
  access_token: accessToken
@@ -38203,7 +38203,7 @@
38203
38203
  })
38204
38204
  .join('&');
38205
38205
  yield this.callNative(ACTION.OPEN_MP.name, {
38206
- mpUrl: `${CONFIG.MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38206
+ mpUrl: `${config.MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38207
38207
  mpInfo: {
38208
38208
  appId: appId
38209
38209
  }
@@ -38570,25 +38570,13 @@
38570
38570
  * @category Zalo
38571
38571
  *
38572
38572
  */
38573
- static createShortcut(object) {
38573
+ static createShortcut(url, title, icon) {
38574
38574
  return __awaiter(this, void 0, void 0, function* () {
38575
- const isIOS = checkPlatform().isIOS;
38576
- let iconURL = getMetaValue('og:image:url');
38577
- if (!(iconURL === null || iconURL === void 0 ? void 0 : iconURL.includes('https'))) {
38578
- iconURL = `https:${iconURL}`;
38579
- }
38580
- if (isIOS) {
38581
- const iosShortcutURL = `https://mini.zalo.me/shortcut.html?appId=${this.getAppId()}&appName=${document.title}&appIcon=${iconURL}`;
38582
- return yield this.callNative(ACTION.OPEN_OUTAPP.name, {
38583
- url: encodeURI(iosShortcutURL)
38584
- });
38585
- }
38586
- else
38587
- return yield this.callNative(ACTION.CREATE_SHORTCUT.name, {
38588
- url: `${CONFIG.MINI_APP_LINK}/${this.getAppId()}/`,
38589
- title: document.title,
38590
- iconUrl: iconURL
38591
- });
38575
+ return yield this.callNative(ACTION.CREATE_SHORTCUT.name, {
38576
+ url: url,
38577
+ title: title,
38578
+ iconUrl: icon
38579
+ });
38592
38580
  });
38593
38581
  }
38594
38582
  /**
@@ -38662,8 +38650,8 @@
38662
38650
  return __awaiter(this, void 0, void 0, function* () {
38663
38651
  const uploadSetting = {
38664
38652
  type: 0,
38665
- url: CONFIG.MEDIA_PICKER_UPLOAD_SERVER,
38666
- maxSize: CONFIG.MEDIA_PICKER_LIMIT
38653
+ url: config.MEDIA_PICKER_UPLOAD_SERVER,
38654
+ maxSize: config.MEDIA_PICKER_LIMIT
38667
38655
  };
38668
38656
  const defaultEditView = {
38669
38657
  enable: 1,
@@ -38691,6 +38679,21 @@
38691
38679
  });
38692
38680
  });
38693
38681
  }
38682
+ /**
38683
+ * Mở url out app zalo
38684
+ *
38685
+ * @async
38686
+ * @function openOutApp
38687
+ * @category Zalo
38688
+ *
38689
+ */
38690
+ static openOutApp(url) {
38691
+ return __awaiter(this, void 0, void 0, function* () {
38692
+ return yield this.callNative(ACTION.OPEN_OUTAPP.name, {
38693
+ url: url
38694
+ });
38695
+ });
38696
+ }
38694
38697
  }
38695
38698
 
38696
38699
  class Routing {
@@ -38788,7 +38791,7 @@
38788
38791
  this.callNative('action.jump.login', {})
38789
38792
  .then((data) => {
38790
38793
  const cookies = (data && data.cookiesOAuthLogins) || [];
38791
- const jsToken = cookies.find((cookie) => cookie.name === CONFIG.COOKIE_NAME.JS_TOKEN);
38794
+ const jsToken = cookies.find((cookie) => cookie.name === config.COOKIE_NAME.JS_TOKEN);
38792
38795
  if (jsToken) {
38793
38796
  this.setJSToken(jsToken.value);
38794
38797
  window.ZJSBridge.setJSToken &&
@@ -38864,6 +38867,7 @@
38864
38867
  _ZaloMiniProgramSDK_getActionsSupported.set(this, Zalo.getActionsSupported);
38865
38868
  this.connectWifi = Device.connectWifi;
38866
38869
  this.openMediaPicker = Zalo.openMediaPicker;
38870
+ this.openOutApp = Zalo.openOutApp;
38867
38871
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuth, null);
38868
38872
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuthVrf, null);
38869
38873
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, null);
@@ -38894,7 +38898,7 @@
38894
38898
  },
38895
38899
  homeConfig: {
38896
38900
  enable: showHomeButton,
38897
- url: `${CONFIG.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/${currentUrl.search}`
38901
+ url: `${config.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/${currentUrl.search}`
38898
38902
  }
38899
38903
  });
38900
38904
  }
@@ -38916,8 +38920,8 @@
38916
38920
  login(object) {
38917
38921
  return __awaiter(this, void 0, void 0, function* () {
38918
38922
  const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDK_callJump).call(this);
38919
- const zOAuthCookie = cookies.find((cookie) => cookie.name === CONFIG.COOKIE_NAME.ZOAUTH);
38920
- const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === CONFIG.COOKIE_NAME.ZOAUTH_VRF);
38923
+ const zOAuthCookie = cookies.find((cookie) => cookie.name === config.COOKIE_NAME.ZOAUTH);
38924
+ const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === config.COOKIE_NAME.ZOAUTH_VRF);
38921
38925
  if (!lodash.isUndefined(zOAuthCookie) &&
38922
38926
  !lodash.isNull(zOAuthCookie) &&
38923
38927
  lodash.isString(zOAuthCookie.value)) {
@@ -38942,10 +38946,10 @@
38942
38946
  loginZaloV3() {
38943
38947
  return __awaiter(this, void 0, void 0, function* () {
38944
38948
  return yield axios
38945
- .get(CONFIG.APIS.GET_ACCESS_TOKEN_V3, {
38949
+ .get(config.APIS.GET_ACCESS_TOKEN_V3, {
38946
38950
  params: {
38947
38951
  app_id: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zAppId),
38948
- redirect_uri: `${CONFIG.MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
38952
+ redirect_uri: `${config.MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
38949
38953
  code: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth),
38950
38954
  isSDK: true
38951
38955
  }
@@ -38979,13 +38983,13 @@
38979
38983
  inputData.append('grant_type', 'refresh_token');
38980
38984
  inputData.append('refresh_token', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_refreshToken) || '');
38981
38985
  }
38982
- const config = {
38986
+ const config$1 = {
38983
38987
  headers: {
38984
38988
  'Content-Type': 'application/x-www-form-urlencoded'
38985
38989
  }
38986
38990
  };
38987
38991
  return yield axios
38988
- .post(CONFIG.APIS.GET_ACCESS_TOKEN, inputData, config)
38992
+ .post(config.APIS.GET_ACCESS_TOKEN, inputData, config$1)
38989
38993
  .then((response) => {
38990
38994
  const resData = response.data;
38991
38995
  if (resData.refresh_token) {
@@ -39330,6 +39334,10 @@
39330
39334
  console.warn('This api only works on zalo app');
39331
39335
  return Promise.resolve();
39332
39336
  };
39337
+ this.openOutApp = (url) => {
39338
+ location.href = url;
39339
+ return Promise.resolve();
39340
+ };
39333
39341
  }
39334
39342
  on(event, fn, context) {
39335
39343
  throw new Error('Method not implemented.');
@@ -40823,7 +40831,23 @@
40823
40831
  }
40824
40832
  createShortcut(object) {
40825
40833
  return __awaiter(this, void 0, void 0, function* () {
40826
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).createShortcut(object);
40834
+ const isIOS = checkPlatform().isIOS;
40835
+ let iconURL = getMetaValue('og:image:url');
40836
+ console.log('iconURL', iconURL);
40837
+ if (!(iconURL === null || iconURL === void 0 ? void 0 : iconURL.includes('https'))) {
40838
+ iconURL = `https:${iconURL}`;
40839
+ }
40840
+ const title = document.title;
40841
+ const searchParams = object.params ? new URLSearchParams(object.params) : new URLSearchParams();
40842
+ if (isIOS) {
40843
+ searchParams.append('appId', APP_ID);
40844
+ searchParams.append('appName', title);
40845
+ searchParams.append('appIcon', iconURL);
40846
+ const iosShortcutURL = `https://mini.zalo.me/shortcut.html?${searchParams.toString()}`;
40847
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openOutApp(encodeURI(iosShortcutURL));
40848
+ }
40849
+ else
40850
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).createShortcut(`${config.MINI_APP_LINK}/${APP_ID}/?${searchParams.toString()}`, title, iconURL);
40827
40851
  });
40828
40852
  }
40829
40853
  openBioAuthentication(object) {
package/dist/index.es.js CHANGED
@@ -17889,7 +17889,7 @@ var argv = [];
17889
17889
  var version$2 = ''; // empty string to avoid regexp issues
17890
17890
  var versions = {};
17891
17891
  var release$1 = {};
17892
- var config = {};
17892
+ var config$1 = {};
17893
17893
 
17894
17894
  function noop$1() {}
17895
17895
 
@@ -17966,7 +17966,7 @@ var browser$1$1 = {
17966
17966
  hrtime: hrtime,
17967
17967
  platform: platform$2,
17968
17968
  release: release$1,
17969
- config: config,
17969
+ config: config$1,
17970
17970
  uptime: uptime$1
17971
17971
  };
17972
17972
 
@@ -36188,7 +36188,7 @@ class ZMPEEmitter extends eventemitter3 {
36188
36188
  }
36189
36189
  }
36190
36190
 
36191
- var CONFIG = (() => {
36191
+ var config = (() => {
36192
36192
  const Byte = 1;
36193
36193
  const KB = 1024 * Byte;
36194
36194
  const MB = 1024 * KB;
@@ -36717,7 +36717,7 @@ class ZJSBridgeProvider {
36717
36717
  }
36718
36718
  _ZJSBridgeProvider_bridge = new WeakMap();
36719
36719
 
36720
- var version = "2.16.2";
36720
+ var version = "2.16.3";
36721
36721
 
36722
36722
  class Basics {
36723
36723
  /**
@@ -37135,19 +37135,19 @@ class Device {
37135
37135
  const network = data.network;
37136
37136
  let networkType;
37137
37137
  switch (network) {
37138
- case CONFIG.NETWORK_TYPE.NONE:
37138
+ case config.NETWORK_TYPE.NONE:
37139
37139
  networkType = NetworkType.none;
37140
37140
  break;
37141
- case CONFIG.NETWORK_TYPE.WIFI:
37141
+ case config.NETWORK_TYPE.WIFI:
37142
37142
  networkType = NetworkType.wifi;
37143
37143
  break;
37144
- case CONFIG.NETWORK_TYPE['2G']:
37144
+ case config.NETWORK_TYPE['2G']:
37145
37145
  networkType = NetworkType.cellular;
37146
37146
  break;
37147
- case CONFIG.NETWORK_TYPE['3G']:
37147
+ case config.NETWORK_TYPE['3G']:
37148
37148
  networkType = NetworkType.cellular;
37149
37149
  break;
37150
- case CONFIG.NETWORK_TYPE['4G']:
37150
+ case config.NETWORK_TYPE['4G']:
37151
37151
  networkType = NetworkType.cellular;
37152
37152
  break;
37153
37153
  default:
@@ -37691,7 +37691,7 @@ class LocalResourceStorage {
37691
37691
  __classPrivateFieldSet(this, _LocalResourceStorage_resourceInfo, {
37692
37692
  keys: new Set(),
37693
37693
  currentSize: 0,
37694
- limitSize: CONFIG.STORAGE_LIMIT
37694
+ limitSize: config.STORAGE_LIMIT
37695
37695
  });
37696
37696
  __classPrivateFieldSet(this, _LocalResourceStorage_prefix, prefix);
37697
37697
  this.findAllCurrentDataByApp(prefix);
@@ -37754,7 +37754,7 @@ class LocalResourceStorage {
37754
37754
  currentSize: lodash.isNumber(currentSize)
37755
37755
  ? Number((currentSize / 1024).toFixed(2))
37756
37756
  : 0,
37757
- limitSize: Number((CONFIG.STORAGE_LIMIT / 1024).toFixed(2))
37757
+ limitSize: Number((config.STORAGE_LIMIT / 1024).toFixed(2))
37758
37758
  };
37759
37759
  }
37760
37760
  remove(keys) {
@@ -37800,7 +37800,7 @@ class NativeResourceStorage extends ZJSBridgeProvider {
37800
37800
  __classPrivateFieldSet(this, _NativeResourceStorage_resourceInfo, {
37801
37801
  keys: new Set(),
37802
37802
  currentSize: 0,
37803
- limitSize: CONFIG.STORAGE_LIMIT
37803
+ limitSize: config.STORAGE_LIMIT
37804
37804
  });
37805
37805
  __classPrivateFieldSet(this, _NativeResourceStorage_appId, appId);
37806
37806
  }
@@ -37860,7 +37860,7 @@ class NativeResourceStorage extends ZJSBridgeProvider {
37860
37860
  });
37861
37861
  return {
37862
37862
  currentSize: lodash.isNumber(currentSize) ? Number(currentSize / 1024) : 0,
37863
- limitSize: Number(CONFIG.STORAGE_LIMIT / 1024)
37863
+ limitSize: Number(config.STORAGE_LIMIT / 1024)
37864
37864
  };
37865
37865
  });
37866
37866
  }
@@ -38116,7 +38116,7 @@ class OpenApi {
38116
38116
  fields = `${fields}.type(${object === null || object === void 0 ? void 0 : object.avatarType})`;
38117
38117
  }
38118
38118
  const userInfo = yield axios
38119
- .get(CONFIG.APIS.GET_USER_INFO, {
38119
+ .get(config.APIS.GET_USER_INFO, {
38120
38120
  params: {
38121
38121
  fields: fields,
38122
38122
  access_token: accessToken
@@ -38200,7 +38200,7 @@ class Window {
38200
38200
  })
38201
38201
  .join('&');
38202
38202
  yield this.callNative(ACTION.OPEN_MP.name, {
38203
- mpUrl: `${CONFIG.MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38203
+ mpUrl: `${config.MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38204
38204
  mpInfo: {
38205
38205
  appId: appId
38206
38206
  }
@@ -38567,25 +38567,13 @@ class Zalo {
38567
38567
  * @category Zalo
38568
38568
  *
38569
38569
  */
38570
- static createShortcut(object) {
38570
+ static createShortcut(url, title, icon) {
38571
38571
  return __awaiter(this, void 0, void 0, function* () {
38572
- const isIOS = checkPlatform().isIOS;
38573
- let iconURL = getMetaValue('og:image:url');
38574
- if (!(iconURL === null || iconURL === void 0 ? void 0 : iconURL.includes('https'))) {
38575
- iconURL = `https:${iconURL}`;
38576
- }
38577
- if (isIOS) {
38578
- const iosShortcutURL = `https://mini.zalo.me/shortcut.html?appId=${this.getAppId()}&appName=${document.title}&appIcon=${iconURL}`;
38579
- return yield this.callNative(ACTION.OPEN_OUTAPP.name, {
38580
- url: encodeURI(iosShortcutURL)
38581
- });
38582
- }
38583
- else
38584
- return yield this.callNative(ACTION.CREATE_SHORTCUT.name, {
38585
- url: `${CONFIG.MINI_APP_LINK}/${this.getAppId()}/`,
38586
- title: document.title,
38587
- iconUrl: iconURL
38588
- });
38572
+ return yield this.callNative(ACTION.CREATE_SHORTCUT.name, {
38573
+ url: url,
38574
+ title: title,
38575
+ iconUrl: icon
38576
+ });
38589
38577
  });
38590
38578
  }
38591
38579
  /**
@@ -38659,8 +38647,8 @@ class Zalo {
38659
38647
  return __awaiter(this, void 0, void 0, function* () {
38660
38648
  const uploadSetting = {
38661
38649
  type: 0,
38662
- url: CONFIG.MEDIA_PICKER_UPLOAD_SERVER,
38663
- maxSize: CONFIG.MEDIA_PICKER_LIMIT
38650
+ url: config.MEDIA_PICKER_UPLOAD_SERVER,
38651
+ maxSize: config.MEDIA_PICKER_LIMIT
38664
38652
  };
38665
38653
  const defaultEditView = {
38666
38654
  enable: 1,
@@ -38688,6 +38676,21 @@ class Zalo {
38688
38676
  });
38689
38677
  });
38690
38678
  }
38679
+ /**
38680
+ * Mở url out app zalo
38681
+ *
38682
+ * @async
38683
+ * @function openOutApp
38684
+ * @category Zalo
38685
+ *
38686
+ */
38687
+ static openOutApp(url) {
38688
+ return __awaiter(this, void 0, void 0, function* () {
38689
+ return yield this.callNative(ACTION.OPEN_OUTAPP.name, {
38690
+ url: url
38691
+ });
38692
+ });
38693
+ }
38691
38694
  }
38692
38695
 
38693
38696
  class Routing {
@@ -38785,7 +38788,7 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38785
38788
  this.callNative('action.jump.login', {})
38786
38789
  .then((data) => {
38787
38790
  const cookies = (data && data.cookiesOAuthLogins) || [];
38788
- const jsToken = cookies.find((cookie) => cookie.name === CONFIG.COOKIE_NAME.JS_TOKEN);
38791
+ const jsToken = cookies.find((cookie) => cookie.name === config.COOKIE_NAME.JS_TOKEN);
38789
38792
  if (jsToken) {
38790
38793
  this.setJSToken(jsToken.value);
38791
38794
  window.ZJSBridge.setJSToken &&
@@ -38861,6 +38864,7 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38861
38864
  _ZaloMiniProgramSDK_getActionsSupported.set(this, Zalo.getActionsSupported);
38862
38865
  this.connectWifi = Device.connectWifi;
38863
38866
  this.openMediaPicker = Zalo.openMediaPicker;
38867
+ this.openOutApp = Zalo.openOutApp;
38864
38868
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuth, null);
38865
38869
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuthVrf, null);
38866
38870
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, null);
@@ -38891,7 +38895,7 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38891
38895
  },
38892
38896
  homeConfig: {
38893
38897
  enable: showHomeButton,
38894
- url: `${CONFIG.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/${currentUrl.search}`
38898
+ url: `${config.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/${currentUrl.search}`
38895
38899
  }
38896
38900
  });
38897
38901
  }
@@ -38913,8 +38917,8 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38913
38917
  login(object) {
38914
38918
  return __awaiter(this, void 0, void 0, function* () {
38915
38919
  const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDK_callJump).call(this);
38916
- const zOAuthCookie = cookies.find((cookie) => cookie.name === CONFIG.COOKIE_NAME.ZOAUTH);
38917
- const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === CONFIG.COOKIE_NAME.ZOAUTH_VRF);
38920
+ const zOAuthCookie = cookies.find((cookie) => cookie.name === config.COOKIE_NAME.ZOAUTH);
38921
+ const zOAuthVrfCookie = cookies.find((cookie) => cookie.name === config.COOKIE_NAME.ZOAUTH_VRF);
38918
38922
  if (!lodash.isUndefined(zOAuthCookie) &&
38919
38923
  !lodash.isNull(zOAuthCookie) &&
38920
38924
  lodash.isString(zOAuthCookie.value)) {
@@ -38939,10 +38943,10 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38939
38943
  loginZaloV3() {
38940
38944
  return __awaiter(this, void 0, void 0, function* () {
38941
38945
  return yield axios
38942
- .get(CONFIG.APIS.GET_ACCESS_TOKEN_V3, {
38946
+ .get(config.APIS.GET_ACCESS_TOKEN_V3, {
38943
38947
  params: {
38944
38948
  app_id: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zAppId),
38945
- redirect_uri: `${CONFIG.MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
38949
+ redirect_uri: `${config.MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
38946
38950
  code: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth),
38947
38951
  isSDK: true
38948
38952
  }
@@ -38976,13 +38980,13 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38976
38980
  inputData.append('grant_type', 'refresh_token');
38977
38981
  inputData.append('refresh_token', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_refreshToken) || '');
38978
38982
  }
38979
- const config = {
38983
+ const config$1 = {
38980
38984
  headers: {
38981
38985
  'Content-Type': 'application/x-www-form-urlencoded'
38982
38986
  }
38983
38987
  };
38984
38988
  return yield axios
38985
- .post(CONFIG.APIS.GET_ACCESS_TOKEN, inputData, config)
38989
+ .post(config.APIS.GET_ACCESS_TOKEN, inputData, config$1)
38986
38990
  .then((response) => {
38987
38991
  const resData = response.data;
38988
38992
  if (resData.refresh_token) {
@@ -39327,6 +39331,10 @@ class MockSDK {
39327
39331
  console.warn('This api only works on zalo app');
39328
39332
  return Promise.resolve();
39329
39333
  };
39334
+ this.openOutApp = (url) => {
39335
+ location.href = url;
39336
+ return Promise.resolve();
39337
+ };
39330
39338
  }
39331
39339
  on(event, fn, context) {
39332
39340
  throw new Error('Method not implemented.');
@@ -40820,7 +40828,23 @@ class SDKCreator {
40820
40828
  }
40821
40829
  createShortcut(object) {
40822
40830
  return __awaiter(this, void 0, void 0, function* () {
40823
- yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).createShortcut(object);
40831
+ const isIOS = checkPlatform().isIOS;
40832
+ let iconURL = getMetaValue('og:image:url');
40833
+ console.log('iconURL', iconURL);
40834
+ if (!(iconURL === null || iconURL === void 0 ? void 0 : iconURL.includes('https'))) {
40835
+ iconURL = `https:${iconURL}`;
40836
+ }
40837
+ const title = document.title;
40838
+ const searchParams = object.params ? new URLSearchParams(object.params) : new URLSearchParams();
40839
+ if (isIOS) {
40840
+ searchParams.append('appId', APP_ID);
40841
+ searchParams.append('appName', title);
40842
+ searchParams.append('appIcon', iconURL);
40843
+ const iosShortcutURL = `https://mini.zalo.me/shortcut.html?${searchParams.toString()}`;
40844
+ return yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).openOutApp(encodeURI(iosShortcutURL));
40845
+ }
40846
+ else
40847
+ yield __classPrivateFieldGet(this, _SDKCreator_sdkManager).createShortcut(`${config.MINI_APP_LINK}/${APP_ID}/?${searchParams.toString()}`, title, iconURL);
40824
40848
  });
40825
40849
  }
40826
40850
  openBioAuthentication(object) {