zmp-sdk 2.16.0 → 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
 
@@ -35217,7 +35217,7 @@
35217
35217
  },
35218
35218
  MP_OPEN_PROFILE_PICKER: {
35219
35219
  name: 'action.mp.open.profile.picker',
35220
- version_live: { iOS: 999 }
35220
+ version_live: { iOS: 432 }
35221
35221
  },
35222
35222
  GET_SUPPORTED_ACTIONS: {
35223
35223
  name: 'action.get.supported.actions',
@@ -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;
@@ -36707,6 +36707,11 @@
36707
36707
  const error = new NativeError(-5, `${action}: Client isn't support this action`);
36708
36708
  return reject(error);
36709
36709
  }
36710
+ else if (option === null || option === void 0 ? void 0 : option.delay) {
36711
+ setTimeout(() => {
36712
+ __classPrivateFieldGet(this, _ZJSBridgeProvider_bridge).jsCall(action, data, fn, option === null || option === void 0 ? void 0 : option.isMultiCallback, option === null || option === void 0 ? void 0 : option.nRetry, option === null || option === void 0 ? void 0 : option.haveTimeout);
36713
+ }, option.delay);
36714
+ }
36710
36715
  else {
36711
36716
  __classPrivateFieldGet(this, _ZJSBridgeProvider_bridge).jsCall(action, data, fn, option === null || option === void 0 ? void 0 : option.isMultiCallback, option === null || option === void 0 ? void 0 : option.nRetry, option === null || option === void 0 ? void 0 : option.haveTimeout);
36712
36717
  }
@@ -36715,7 +36720,7 @@
36715
36720
  }
36716
36721
  _ZJSBridgeProvider_bridge = new WeakMap();
36717
36722
 
36718
- var version = "2.16.0";
36723
+ var version = "2.16.3";
36719
36724
 
36720
36725
  class Basics {
36721
36726
  /**
@@ -37133,19 +37138,19 @@
37133
37138
  const network = data.network;
37134
37139
  let networkType;
37135
37140
  switch (network) {
37136
- case CONFIG.NETWORK_TYPE.NONE:
37141
+ case config.NETWORK_TYPE.NONE:
37137
37142
  networkType = NetworkType.none;
37138
37143
  break;
37139
- case CONFIG.NETWORK_TYPE.WIFI:
37144
+ case config.NETWORK_TYPE.WIFI:
37140
37145
  networkType = NetworkType.wifi;
37141
37146
  break;
37142
- case CONFIG.NETWORK_TYPE['2G']:
37147
+ case config.NETWORK_TYPE['2G']:
37143
37148
  networkType = NetworkType.cellular;
37144
37149
  break;
37145
- case CONFIG.NETWORK_TYPE['3G']:
37150
+ case config.NETWORK_TYPE['3G']:
37146
37151
  networkType = NetworkType.cellular;
37147
37152
  break;
37148
- case CONFIG.NETWORK_TYPE['4G']:
37153
+ case config.NETWORK_TYPE['4G']:
37149
37154
  networkType = NetworkType.cellular;
37150
37155
  break;
37151
37156
  default:
@@ -37689,7 +37694,7 @@
37689
37694
  __classPrivateFieldSet(this, _LocalResourceStorage_resourceInfo, {
37690
37695
  keys: new Set(),
37691
37696
  currentSize: 0,
37692
- limitSize: CONFIG.STORAGE_LIMIT
37697
+ limitSize: config.STORAGE_LIMIT
37693
37698
  });
37694
37699
  __classPrivateFieldSet(this, _LocalResourceStorage_prefix, prefix);
37695
37700
  this.findAllCurrentDataByApp(prefix);
@@ -37752,7 +37757,7 @@
37752
37757
  currentSize: lodash.isNumber(currentSize)
37753
37758
  ? Number((currentSize / 1024).toFixed(2))
37754
37759
  : 0,
37755
- limitSize: Number((CONFIG.STORAGE_LIMIT / 1024).toFixed(2))
37760
+ limitSize: Number((config.STORAGE_LIMIT / 1024).toFixed(2))
37756
37761
  };
37757
37762
  }
37758
37763
  remove(keys) {
@@ -37798,7 +37803,7 @@
37798
37803
  __classPrivateFieldSet(this, _NativeResourceStorage_resourceInfo, {
37799
37804
  keys: new Set(),
37800
37805
  currentSize: 0,
37801
- limitSize: CONFIG.STORAGE_LIMIT
37806
+ limitSize: config.STORAGE_LIMIT
37802
37807
  });
37803
37808
  __classPrivateFieldSet(this, _NativeResourceStorage_appId, appId);
37804
37809
  }
@@ -37858,7 +37863,7 @@
37858
37863
  });
37859
37864
  return {
37860
37865
  currentSize: lodash.isNumber(currentSize) ? Number(currentSize / 1024) : 0,
37861
- limitSize: Number(CONFIG.STORAGE_LIMIT / 1024)
37866
+ limitSize: Number(config.STORAGE_LIMIT / 1024)
37862
37867
  };
37863
37868
  });
37864
37869
  }
@@ -38114,7 +38119,7 @@
38114
38119
  fields = `${fields}.type(${object === null || object === void 0 ? void 0 : object.avatarType})`;
38115
38120
  }
38116
38121
  const userInfo = yield axios
38117
- .get(CONFIG.APIS.GET_USER_INFO, {
38122
+ .get(config.APIS.GET_USER_INFO, {
38118
38123
  params: {
38119
38124
  fields: fields,
38120
38125
  access_token: accessToken
@@ -38159,7 +38164,8 @@
38159
38164
  else {
38160
38165
  return Promise.reject(error);
38161
38166
  }
38162
- }
38167
+ },
38168
+ delay: this.isIOS ? 200 : 0
38163
38169
  });
38164
38170
  });
38165
38171
  }
@@ -38197,7 +38203,7 @@
38197
38203
  })
38198
38204
  .join('&');
38199
38205
  yield this.callNative(ACTION.OPEN_MP.name, {
38200
- mpUrl: `${CONFIG.MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38206
+ mpUrl: `${config.MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38201
38207
  mpInfo: {
38202
38208
  appId: appId
38203
38209
  }
@@ -38263,7 +38269,8 @@
38263
38269
  else {
38264
38270
  return Promise.reject(error);
38265
38271
  }
38266
- }
38272
+ },
38273
+ delay: this.isIOS ? 200 : 0
38267
38274
  });
38268
38275
  });
38269
38276
  }
@@ -38563,12 +38570,12 @@
38563
38570
  * @category Zalo
38564
38571
  *
38565
38572
  */
38566
- static createShortcut(object) {
38573
+ static createShortcut(url, title, icon) {
38567
38574
  return __awaiter(this, void 0, void 0, function* () {
38568
- yield this.callNative(ACTION.CREATE_SHORTCUT.name, {
38569
- url: `${CONFIG.MINI_APP_LINK}/${this.getAppId()}/`,
38570
- title: document.title,
38571
- iconUrl: `https:${getMetaValue('og:image:url')}`
38575
+ return yield this.callNative(ACTION.CREATE_SHORTCUT.name, {
38576
+ url: url,
38577
+ title: title,
38578
+ iconUrl: icon
38572
38579
  });
38573
38580
  });
38574
38581
  }
@@ -38643,8 +38650,8 @@
38643
38650
  return __awaiter(this, void 0, void 0, function* () {
38644
38651
  const uploadSetting = {
38645
38652
  type: 0,
38646
- url: CONFIG.MEDIA_PICKER_UPLOAD_SERVER,
38647
- maxSize: CONFIG.MEDIA_PICKER_LIMIT
38653
+ url: config.MEDIA_PICKER_UPLOAD_SERVER,
38654
+ maxSize: config.MEDIA_PICKER_LIMIT
38648
38655
  };
38649
38656
  const defaultEditView = {
38650
38657
  enable: 1,
@@ -38672,6 +38679,21 @@
38672
38679
  });
38673
38680
  });
38674
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
+ }
38675
38697
  }
38676
38698
 
38677
38699
  class Routing {
@@ -38752,6 +38774,7 @@
38752
38774
  _ZaloMiniProgramSDK_tokenExpiresIn.set(this, void 0);
38753
38775
  _ZaloMiniProgramSDK_cookies.set(this, null);
38754
38776
  this.events = ZMPEEmitter.getInstance();
38777
+ this.isIOS = checkPlatform().isIOS;
38755
38778
  _ZaloMiniProgramSDK_actionBarConfig.set(this, void 0);
38756
38779
  this.getActionBarConfig = () => {
38757
38780
  return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_actionBarConfig);
@@ -38768,7 +38791,7 @@
38768
38791
  this.callNative('action.jump.login', {})
38769
38792
  .then((data) => {
38770
38793
  const cookies = (data && data.cookiesOAuthLogins) || [];
38771
- 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);
38772
38795
  if (jsToken) {
38773
38796
  this.setJSToken(jsToken.value);
38774
38797
  window.ZJSBridge.setJSToken &&
@@ -38844,6 +38867,7 @@
38844
38867
  _ZaloMiniProgramSDK_getActionsSupported.set(this, Zalo.getActionsSupported);
38845
38868
  this.connectWifi = Device.connectWifi;
38846
38869
  this.openMediaPicker = Zalo.openMediaPicker;
38870
+ this.openOutApp = Zalo.openOutApp;
38847
38871
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuth, null);
38848
38872
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuthVrf, null);
38849
38873
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, null);
@@ -38874,7 +38898,7 @@
38874
38898
  },
38875
38899
  homeConfig: {
38876
38900
  enable: showHomeButton,
38877
- url: `${CONFIG.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/${currentUrl.search}`
38901
+ url: `${config.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/${currentUrl.search}`
38878
38902
  }
38879
38903
  });
38880
38904
  }
@@ -38896,8 +38920,8 @@
38896
38920
  login(object) {
38897
38921
  return __awaiter(this, void 0, void 0, function* () {
38898
38922
  const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDK_callJump).call(this);
38899
- const zOAuthCookie = cookies.find((cookie) => cookie.name === CONFIG.COOKIE_NAME.ZOAUTH);
38900
- 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);
38901
38925
  if (!lodash.isUndefined(zOAuthCookie) &&
38902
38926
  !lodash.isNull(zOAuthCookie) &&
38903
38927
  lodash.isString(zOAuthCookie.value)) {
@@ -38922,10 +38946,10 @@
38922
38946
  loginZaloV3() {
38923
38947
  return __awaiter(this, void 0, void 0, function* () {
38924
38948
  return yield axios
38925
- .get(CONFIG.APIS.GET_ACCESS_TOKEN_V3, {
38949
+ .get(config.APIS.GET_ACCESS_TOKEN_V3, {
38926
38950
  params: {
38927
38951
  app_id: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zAppId),
38928
- redirect_uri: `${CONFIG.MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
38952
+ redirect_uri: `${config.MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
38929
38953
  code: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth),
38930
38954
  isSDK: true
38931
38955
  }
@@ -38959,13 +38983,13 @@
38959
38983
  inputData.append('grant_type', 'refresh_token');
38960
38984
  inputData.append('refresh_token', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_refreshToken) || '');
38961
38985
  }
38962
- const config = {
38986
+ const config$1 = {
38963
38987
  headers: {
38964
38988
  'Content-Type': 'application/x-www-form-urlencoded'
38965
38989
  }
38966
38990
  };
38967
38991
  return yield axios
38968
- .post(CONFIG.APIS.GET_ACCESS_TOKEN, inputData, config)
38992
+ .post(config.APIS.GET_ACCESS_TOKEN, inputData, config$1)
38969
38993
  .then((response) => {
38970
38994
  const resData = response.data;
38971
38995
  if (resData.refresh_token) {
@@ -39310,6 +39334,10 @@
39310
39334
  console.warn('This api only works on zalo app');
39311
39335
  return Promise.resolve();
39312
39336
  };
39337
+ this.openOutApp = (url) => {
39338
+ location.href = url;
39339
+ return Promise.resolve();
39340
+ };
39313
39341
  }
39314
39342
  on(event, fn, context) {
39315
39343
  throw new Error('Method not implemented.');
@@ -40803,7 +40831,23 @@
40803
40831
  }
40804
40832
  createShortcut(object) {
40805
40833
  return __awaiter(this, void 0, void 0, function* () {
40806
- 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);
40807
40851
  });
40808
40852
  }
40809
40853
  openBioAuthentication(object) {
@@ -41311,6 +41355,7 @@
41311
41355
  __decorate([
41312
41356
  handleError,
41313
41357
  validate,
41358
+ __param(0, required(['SSID'])),
41314
41359
  __param(0, checkType('object', {
41315
41360
  SSID: checkData('string'),
41316
41361
  'password?': checkData('string'),
@@ -41338,12 +41383,9 @@
41338
41383
  title: checkData('string', { maxLength: 100 }),
41339
41384
  'thumbnail?': checkData('url'),
41340
41385
  'path?': checkData('url'),
41341
- description: checkData(['string'], { maxLength: 400 }),
41386
+ description: checkData(['string'], { maxLength: 400 })
41342
41387
  }, {
41343
- description: {
41344
- vi: '',
41345
- en: ''
41346
- }
41388
+ description: ''
41347
41389
  }))
41348
41390
  ], SDKCreator.prototype, "getShareableLink", null);
41349
41391
  class ZaloMiniAppSDKCreator extends SDKCreator {
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
 
@@ -35214,7 +35214,7 @@ const ACTION = {
35214
35214
  },
35215
35215
  MP_OPEN_PROFILE_PICKER: {
35216
35216
  name: 'action.mp.open.profile.picker',
35217
- version_live: { iOS: 999 }
35217
+ version_live: { iOS: 432 }
35218
35218
  },
35219
35219
  GET_SUPPORTED_ACTIONS: {
35220
35220
  name: 'action.get.supported.actions',
@@ -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;
@@ -36704,6 +36704,11 @@ class ZJSBridgeProvider {
36704
36704
  const error = new NativeError(-5, `${action}: Client isn't support this action`);
36705
36705
  return reject(error);
36706
36706
  }
36707
+ else if (option === null || option === void 0 ? void 0 : option.delay) {
36708
+ setTimeout(() => {
36709
+ __classPrivateFieldGet(this, _ZJSBridgeProvider_bridge).jsCall(action, data, fn, option === null || option === void 0 ? void 0 : option.isMultiCallback, option === null || option === void 0 ? void 0 : option.nRetry, option === null || option === void 0 ? void 0 : option.haveTimeout);
36710
+ }, option.delay);
36711
+ }
36707
36712
  else {
36708
36713
  __classPrivateFieldGet(this, _ZJSBridgeProvider_bridge).jsCall(action, data, fn, option === null || option === void 0 ? void 0 : option.isMultiCallback, option === null || option === void 0 ? void 0 : option.nRetry, option === null || option === void 0 ? void 0 : option.haveTimeout);
36709
36714
  }
@@ -36712,7 +36717,7 @@ class ZJSBridgeProvider {
36712
36717
  }
36713
36718
  _ZJSBridgeProvider_bridge = new WeakMap();
36714
36719
 
36715
- var version = "2.16.0";
36720
+ var version = "2.16.3";
36716
36721
 
36717
36722
  class Basics {
36718
36723
  /**
@@ -37130,19 +37135,19 @@ class Device {
37130
37135
  const network = data.network;
37131
37136
  let networkType;
37132
37137
  switch (network) {
37133
- case CONFIG.NETWORK_TYPE.NONE:
37138
+ case config.NETWORK_TYPE.NONE:
37134
37139
  networkType = NetworkType.none;
37135
37140
  break;
37136
- case CONFIG.NETWORK_TYPE.WIFI:
37141
+ case config.NETWORK_TYPE.WIFI:
37137
37142
  networkType = NetworkType.wifi;
37138
37143
  break;
37139
- case CONFIG.NETWORK_TYPE['2G']:
37144
+ case config.NETWORK_TYPE['2G']:
37140
37145
  networkType = NetworkType.cellular;
37141
37146
  break;
37142
- case CONFIG.NETWORK_TYPE['3G']:
37147
+ case config.NETWORK_TYPE['3G']:
37143
37148
  networkType = NetworkType.cellular;
37144
37149
  break;
37145
- case CONFIG.NETWORK_TYPE['4G']:
37150
+ case config.NETWORK_TYPE['4G']:
37146
37151
  networkType = NetworkType.cellular;
37147
37152
  break;
37148
37153
  default:
@@ -37686,7 +37691,7 @@ class LocalResourceStorage {
37686
37691
  __classPrivateFieldSet(this, _LocalResourceStorage_resourceInfo, {
37687
37692
  keys: new Set(),
37688
37693
  currentSize: 0,
37689
- limitSize: CONFIG.STORAGE_LIMIT
37694
+ limitSize: config.STORAGE_LIMIT
37690
37695
  });
37691
37696
  __classPrivateFieldSet(this, _LocalResourceStorage_prefix, prefix);
37692
37697
  this.findAllCurrentDataByApp(prefix);
@@ -37749,7 +37754,7 @@ class LocalResourceStorage {
37749
37754
  currentSize: lodash.isNumber(currentSize)
37750
37755
  ? Number((currentSize / 1024).toFixed(2))
37751
37756
  : 0,
37752
- limitSize: Number((CONFIG.STORAGE_LIMIT / 1024).toFixed(2))
37757
+ limitSize: Number((config.STORAGE_LIMIT / 1024).toFixed(2))
37753
37758
  };
37754
37759
  }
37755
37760
  remove(keys) {
@@ -37795,7 +37800,7 @@ class NativeResourceStorage extends ZJSBridgeProvider {
37795
37800
  __classPrivateFieldSet(this, _NativeResourceStorage_resourceInfo, {
37796
37801
  keys: new Set(),
37797
37802
  currentSize: 0,
37798
- limitSize: CONFIG.STORAGE_LIMIT
37803
+ limitSize: config.STORAGE_LIMIT
37799
37804
  });
37800
37805
  __classPrivateFieldSet(this, _NativeResourceStorage_appId, appId);
37801
37806
  }
@@ -37855,7 +37860,7 @@ class NativeResourceStorage extends ZJSBridgeProvider {
37855
37860
  });
37856
37861
  return {
37857
37862
  currentSize: lodash.isNumber(currentSize) ? Number(currentSize / 1024) : 0,
37858
- limitSize: Number(CONFIG.STORAGE_LIMIT / 1024)
37863
+ limitSize: Number(config.STORAGE_LIMIT / 1024)
37859
37864
  };
37860
37865
  });
37861
37866
  }
@@ -38111,7 +38116,7 @@ class OpenApi {
38111
38116
  fields = `${fields}.type(${object === null || object === void 0 ? void 0 : object.avatarType})`;
38112
38117
  }
38113
38118
  const userInfo = yield axios
38114
- .get(CONFIG.APIS.GET_USER_INFO, {
38119
+ .get(config.APIS.GET_USER_INFO, {
38115
38120
  params: {
38116
38121
  fields: fields,
38117
38122
  access_token: accessToken
@@ -38156,7 +38161,8 @@ class OpenApi {
38156
38161
  else {
38157
38162
  return Promise.reject(error);
38158
38163
  }
38159
- }
38164
+ },
38165
+ delay: this.isIOS ? 200 : 0
38160
38166
  });
38161
38167
  });
38162
38168
  }
@@ -38194,7 +38200,7 @@ class Window {
38194
38200
  })
38195
38201
  .join('&');
38196
38202
  yield this.callNative(ACTION.OPEN_MP.name, {
38197
- mpUrl: `${CONFIG.MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38203
+ mpUrl: `${config.MINI_APP_INTERNAL_LINK}/${appId}/${queryParamString.length > 0 ? '?' + queryParamString : ''}`,
38198
38204
  mpInfo: {
38199
38205
  appId: appId
38200
38206
  }
@@ -38260,7 +38266,8 @@ class Location {
38260
38266
  else {
38261
38267
  return Promise.reject(error);
38262
38268
  }
38263
- }
38269
+ },
38270
+ delay: this.isIOS ? 200 : 0
38264
38271
  });
38265
38272
  });
38266
38273
  }
@@ -38560,12 +38567,12 @@ class Zalo {
38560
38567
  * @category Zalo
38561
38568
  *
38562
38569
  */
38563
- static createShortcut(object) {
38570
+ static createShortcut(url, title, icon) {
38564
38571
  return __awaiter(this, void 0, void 0, function* () {
38565
- yield this.callNative(ACTION.CREATE_SHORTCUT.name, {
38566
- url: `${CONFIG.MINI_APP_LINK}/${this.getAppId()}/`,
38567
- title: document.title,
38568
- iconUrl: `https:${getMetaValue('og:image:url')}`
38572
+ return yield this.callNative(ACTION.CREATE_SHORTCUT.name, {
38573
+ url: url,
38574
+ title: title,
38575
+ iconUrl: icon
38569
38576
  });
38570
38577
  });
38571
38578
  }
@@ -38640,8 +38647,8 @@ class Zalo {
38640
38647
  return __awaiter(this, void 0, void 0, function* () {
38641
38648
  const uploadSetting = {
38642
38649
  type: 0,
38643
- url: CONFIG.MEDIA_PICKER_UPLOAD_SERVER,
38644
- maxSize: CONFIG.MEDIA_PICKER_LIMIT
38650
+ url: config.MEDIA_PICKER_UPLOAD_SERVER,
38651
+ maxSize: config.MEDIA_PICKER_LIMIT
38645
38652
  };
38646
38653
  const defaultEditView = {
38647
38654
  enable: 1,
@@ -38669,6 +38676,21 @@ class Zalo {
38669
38676
  });
38670
38677
  });
38671
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
+ }
38672
38694
  }
38673
38695
 
38674
38696
  class Routing {
@@ -38749,6 +38771,7 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38749
38771
  _ZaloMiniProgramSDK_tokenExpiresIn.set(this, void 0);
38750
38772
  _ZaloMiniProgramSDK_cookies.set(this, null);
38751
38773
  this.events = ZMPEEmitter.getInstance();
38774
+ this.isIOS = checkPlatform().isIOS;
38752
38775
  _ZaloMiniProgramSDK_actionBarConfig.set(this, void 0);
38753
38776
  this.getActionBarConfig = () => {
38754
38777
  return __classPrivateFieldGet(this, _ZaloMiniProgramSDK_actionBarConfig);
@@ -38765,7 +38788,7 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38765
38788
  this.callNative('action.jump.login', {})
38766
38789
  .then((data) => {
38767
38790
  const cookies = (data && data.cookiesOAuthLogins) || [];
38768
- 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);
38769
38792
  if (jsToken) {
38770
38793
  this.setJSToken(jsToken.value);
38771
38794
  window.ZJSBridge.setJSToken &&
@@ -38841,6 +38864,7 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38841
38864
  _ZaloMiniProgramSDK_getActionsSupported.set(this, Zalo.getActionsSupported);
38842
38865
  this.connectWifi = Device.connectWifi;
38843
38866
  this.openMediaPicker = Zalo.openMediaPicker;
38867
+ this.openOutApp = Zalo.openOutApp;
38844
38868
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuth, null);
38845
38869
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_zOAuthVrf, null);
38846
38870
  __classPrivateFieldSet(this, _ZaloMiniProgramSDK_accessToken, null);
@@ -38871,7 +38895,7 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38871
38895
  },
38872
38896
  homeConfig: {
38873
38897
  enable: showHomeButton,
38874
- url: `${CONFIG.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/${currentUrl.search}`
38898
+ url: `${config.MINI_APP_INTERNAL_LINK}/${this.getAppId()}/${currentUrl.search}`
38875
38899
  }
38876
38900
  });
38877
38901
  }
@@ -38893,8 +38917,8 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38893
38917
  login(object) {
38894
38918
  return __awaiter(this, void 0, void 0, function* () {
38895
38919
  const cookies = yield __classPrivateFieldGet(this, _ZaloMiniProgramSDK_callJump).call(this);
38896
- const zOAuthCookie = cookies.find((cookie) => cookie.name === CONFIG.COOKIE_NAME.ZOAUTH);
38897
- 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);
38898
38922
  if (!lodash.isUndefined(zOAuthCookie) &&
38899
38923
  !lodash.isNull(zOAuthCookie) &&
38900
38924
  lodash.isString(zOAuthCookie.value)) {
@@ -38919,10 +38943,10 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38919
38943
  loginZaloV3() {
38920
38944
  return __awaiter(this, void 0, void 0, function* () {
38921
38945
  return yield axios
38922
- .get(CONFIG.APIS.GET_ACCESS_TOKEN_V3, {
38946
+ .get(config.APIS.GET_ACCESS_TOKEN_V3, {
38923
38947
  params: {
38924
38948
  app_id: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zAppId),
38925
- redirect_uri: `${CONFIG.MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
38949
+ redirect_uri: `${config.MINI_APP_INTERNAL_LINK}/${__classPrivateFieldGet(this, _ZaloMiniProgramSDK_appId)}/`,
38926
38950
  code: __classPrivateFieldGet(this, _ZaloMiniProgramSDK_zOAuth),
38927
38951
  isSDK: true
38928
38952
  }
@@ -38956,13 +38980,13 @@ class ZaloMiniProgramSDK extends ZJSBridgeProvider {
38956
38980
  inputData.append('grant_type', 'refresh_token');
38957
38981
  inputData.append('refresh_token', __classPrivateFieldGet(this, _ZaloMiniProgramSDK_refreshToken) || '');
38958
38982
  }
38959
- const config = {
38983
+ const config$1 = {
38960
38984
  headers: {
38961
38985
  'Content-Type': 'application/x-www-form-urlencoded'
38962
38986
  }
38963
38987
  };
38964
38988
  return yield axios
38965
- .post(CONFIG.APIS.GET_ACCESS_TOKEN, inputData, config)
38989
+ .post(config.APIS.GET_ACCESS_TOKEN, inputData, config$1)
38966
38990
  .then((response) => {
38967
38991
  const resData = response.data;
38968
38992
  if (resData.refresh_token) {
@@ -39307,6 +39331,10 @@ class MockSDK {
39307
39331
  console.warn('This api only works on zalo app');
39308
39332
  return Promise.resolve();
39309
39333
  };
39334
+ this.openOutApp = (url) => {
39335
+ location.href = url;
39336
+ return Promise.resolve();
39337
+ };
39310
39338
  }
39311
39339
  on(event, fn, context) {
39312
39340
  throw new Error('Method not implemented.');
@@ -40800,7 +40828,23 @@ class SDKCreator {
40800
40828
  }
40801
40829
  createShortcut(object) {
40802
40830
  return __awaiter(this, void 0, void 0, function* () {
40803
- 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);
40804
40848
  });
40805
40849
  }
40806
40850
  openBioAuthentication(object) {
@@ -41308,6 +41352,7 @@ __decorate([
41308
41352
  __decorate([
41309
41353
  handleError,
41310
41354
  validate,
41355
+ __param(0, required(['SSID'])),
41311
41356
  __param(0, checkType('object', {
41312
41357
  SSID: checkData('string'),
41313
41358
  'password?': checkData('string'),
@@ -41335,12 +41380,9 @@ __decorate([
41335
41380
  title: checkData('string', { maxLength: 100 }),
41336
41381
  'thumbnail?': checkData('url'),
41337
41382
  'path?': checkData('url'),
41338
- description: checkData(['string'], { maxLength: 400 }),
41383
+ description: checkData(['string'], { maxLength: 400 })
41339
41384
  }, {
41340
- description: {
41341
- vi: '',
41342
- en: ''
41343
- }
41385
+ description: ''
41344
41386
  }))
41345
41387
  ], SDKCreator.prototype, "getShareableLink", null);
41346
41388
  class ZaloMiniAppSDKCreator extends SDKCreator {