@smoud/playable-sdk 1.0.22 → 1.0.24

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/defines.d.ts CHANGED
@@ -40,6 +40,7 @@ declare const NUC: {
40
40
  };
41
41
  };
42
42
 
43
+ declare const ScPlayableAd: { onCTAClick: () => void };
43
44
  declare const FbPlayableAd: { onCTAClick: () => void };
44
45
  declare const smxTracking: { redirect: () => void };
45
46
  declare const ExitApi: { exit: () => void };
package/dist/esm/index.js CHANGED
@@ -52,6 +52,7 @@ var MINTEGRAL = uid++;
52
52
  var TAPJOY = uid++;
53
53
  var TIKTOK = uid++;
54
54
  var SMADEX = uid++;
55
+ var SNAPCHAT = uid++;
55
56
  var actualProtocol = NONE;
56
57
  function isMraid() {
57
58
  return actualProtocol === MRAID;
@@ -80,6 +81,9 @@ function isTapjoy() {
80
81
  function isTikTok() {
81
82
  return actualProtocol === TIKTOK;
82
83
  }
84
+ function isSnapchat() {
85
+ return actualProtocol === SNAPCHAT;
86
+ }
83
87
  function ensureProtocol() {
84
88
  if ("mraid" === AD_PROTOCOL) {
85
89
  try {
@@ -93,7 +97,7 @@ function ensureProtocol() {
93
97
  actualProtocol = DAPI;
94
98
  } catch (error) {
95
99
  }
96
- } else if ("facebook" === AD_NETWORK) {
100
+ } else if ("facebook" === AD_NETWORK || "moloco" === AD_NETWORK || "mytarget" === AD_NETWORK) {
97
101
  try {
98
102
  if (FbPlayableAd) actualProtocol = FACEBOOK;
99
103
  } catch (error) {
@@ -107,13 +111,18 @@ function ensureProtocol() {
107
111
  if (window.gameReady) actualProtocol = MINTEGRAL;
108
112
  } else if ("tapjoy" === AD_NETWORK) {
109
113
  if (window.TJ_API) actualProtocol = TAPJOY;
110
- } else if ("tiktok" === AD_NETWORK) {
114
+ } else if ("tiktok" === AD_NETWORK || "pangle" === AD_NETWORK) {
111
115
  if (window.openAppStore) actualProtocol = TIKTOK;
112
116
  } else if ("smadex" === AD_NETWORK) {
113
117
  try {
114
118
  if (smxTracking) actualProtocol = SMADEX;
115
119
  } catch (error) {
116
120
  }
121
+ } else if ("snapchat" === AD_NETWORK) {
122
+ try {
123
+ if (ScPlayableAd) actualProtocol = SNAPCHAT;
124
+ } catch (error) {
125
+ }
117
126
  }
118
127
  }
119
128
 
@@ -524,8 +533,10 @@ var _sdk = class _sdk {
524
533
  dapi.openStoreUrl();
525
534
  } else if ("nucleo" === AD_PROTOCOL && isNucleo()) {
526
535
  NUC.trigger.convert(destinationUrl);
527
- } else if ("facebook" == AD_NETWORK && isFacebook()) {
536
+ } else if (("facebook" === AD_NETWORK || "moloco" === AD_NETWORK || "mytarget" === AD_NETWORK) && isFacebook()) {
528
537
  FbPlayableAd.onCTAClick();
538
+ } else if ("snapchat" == AD_NETWORK && isSnapchat()) {
539
+ ScPlayableAd.onCTAClick();
529
540
  } else if ("smadex" == AD_NETWORK && isSmadex()) {
530
541
  smxTracking.redirect();
531
542
  } else if ("vungle" == AD_NETWORK) {
@@ -536,7 +547,7 @@ var _sdk = class _sdk {
536
547
  window.install && window.install();
537
548
  } else if ("tapjoy" === AD_NETWORK && isTapjoy()) {
538
549
  window.TJ_API.click();
539
- } else if ("tiktok" === AD_NETWORK && isTikTok()) {
550
+ } else if (("tiktok" === AD_NETWORK || "pangle" === AD_NETWORK) && isTikTok()) {
540
551
  window.openAppStore();
541
552
  } else {
542
553
  window.open(destinationUrl);
@@ -642,7 +653,7 @@ var _sdk = class _sdk {
642
653
  }
643
654
  };
644
655
  /** Current version of the SDK */
645
- _sdk.version = "1.0.22";
656
+ _sdk.version = "1.0.24";
646
657
  /** Current maximum width of the playable ad container in pixels */
647
658
  _sdk.maxWidth = Math.floor(window.innerWidth);
648
659
  /** Current maximum height of the playable ad container in pixels */
@@ -54,6 +54,7 @@
54
54
  var TAPJOY = uid++;
55
55
  var TIKTOK = uid++;
56
56
  var SMADEX = uid++;
57
+ var SNAPCHAT = uid++;
57
58
  var actualProtocol = NONE;
58
59
  function isMraid() {
59
60
  return actualProtocol === MRAID;
@@ -82,6 +83,9 @@
82
83
  function isTikTok() {
83
84
  return actualProtocol === TIKTOK;
84
85
  }
86
+ function isSnapchat() {
87
+ return actualProtocol === SNAPCHAT;
88
+ }
85
89
  function ensureProtocol() {
86
90
  if ("mraid" === AD_PROTOCOL) {
87
91
  try {
@@ -95,7 +99,7 @@
95
99
  actualProtocol = DAPI;
96
100
  } catch (error) {
97
101
  }
98
- } else if ("facebook" === AD_NETWORK) {
102
+ } else if ("facebook" === AD_NETWORK || "moloco" === AD_NETWORK || "mytarget" === AD_NETWORK) {
99
103
  try {
100
104
  if (FbPlayableAd) actualProtocol = FACEBOOK;
101
105
  } catch (error) {
@@ -109,13 +113,18 @@
109
113
  if (window.gameReady) actualProtocol = MINTEGRAL;
110
114
  } else if ("tapjoy" === AD_NETWORK) {
111
115
  if (window.TJ_API) actualProtocol = TAPJOY;
112
- } else if ("tiktok" === AD_NETWORK) {
116
+ } else if ("tiktok" === AD_NETWORK || "pangle" === AD_NETWORK) {
113
117
  if (window.openAppStore) actualProtocol = TIKTOK;
114
118
  } else if ("smadex" === AD_NETWORK) {
115
119
  try {
116
120
  if (smxTracking) actualProtocol = SMADEX;
117
121
  } catch (error) {
118
122
  }
123
+ } else if ("snapchat" === AD_NETWORK) {
124
+ try {
125
+ if (ScPlayableAd) actualProtocol = SNAPCHAT;
126
+ } catch (error) {
127
+ }
119
128
  }
120
129
  }
121
130
 
@@ -526,8 +535,10 @@
526
535
  dapi.openStoreUrl();
527
536
  } else if ("nucleo" === AD_PROTOCOL && isNucleo()) {
528
537
  NUC.trigger.convert(destinationUrl);
529
- } else if ("facebook" == AD_NETWORK && isFacebook()) {
538
+ } else if (("facebook" === AD_NETWORK || "moloco" === AD_NETWORK || "mytarget" === AD_NETWORK) && isFacebook()) {
530
539
  FbPlayableAd.onCTAClick();
540
+ } else if ("snapchat" == AD_NETWORK && isSnapchat()) {
541
+ ScPlayableAd.onCTAClick();
531
542
  } else if ("smadex" == AD_NETWORK && isSmadex()) {
532
543
  smxTracking.redirect();
533
544
  } else if ("vungle" == AD_NETWORK) {
@@ -538,7 +549,7 @@
538
549
  window.install && window.install();
539
550
  } else if ("tapjoy" === AD_NETWORK && isTapjoy()) {
540
551
  window.TJ_API.click();
541
- } else if ("tiktok" === AD_NETWORK && isTikTok()) {
552
+ } else if (("tiktok" === AD_NETWORK || "pangle" === AD_NETWORK) && isTikTok()) {
542
553
  window.openAppStore();
543
554
  } else {
544
555
  window.open(destinationUrl);
@@ -644,7 +655,7 @@
644
655
  }
645
656
  };
646
657
  /** Current version of the SDK */
647
- _sdk.version = "1.0.22";
658
+ _sdk.version = "1.0.24";
648
659
  /** Current maximum width of the playable ad container in pixels */
649
660
  _sdk.maxWidth = Math.floor(window.innerWidth);
650
661
  /** Current maximum height of the playable ad container in pixels */
package/dist/index.js CHANGED
@@ -79,6 +79,7 @@ var MINTEGRAL = uid++;
79
79
  var TAPJOY = uid++;
80
80
  var TIKTOK = uid++;
81
81
  var SMADEX = uid++;
82
+ var SNAPCHAT = uid++;
82
83
  var actualProtocol = NONE;
83
84
  function isMraid() {
84
85
  return actualProtocol === MRAID;
@@ -107,6 +108,9 @@ function isTapjoy() {
107
108
  function isTikTok() {
108
109
  return actualProtocol === TIKTOK;
109
110
  }
111
+ function isSnapchat() {
112
+ return actualProtocol === SNAPCHAT;
113
+ }
110
114
  function ensureProtocol() {
111
115
  if ("mraid" === AD_PROTOCOL) {
112
116
  try {
@@ -120,7 +124,7 @@ function ensureProtocol() {
120
124
  actualProtocol = DAPI;
121
125
  } catch (error) {
122
126
  }
123
- } else if ("facebook" === AD_NETWORK) {
127
+ } else if ("facebook" === AD_NETWORK || "moloco" === AD_NETWORK || "mytarget" === AD_NETWORK) {
124
128
  try {
125
129
  if (FbPlayableAd) actualProtocol = FACEBOOK;
126
130
  } catch (error) {
@@ -134,13 +138,18 @@ function ensureProtocol() {
134
138
  if (window.gameReady) actualProtocol = MINTEGRAL;
135
139
  } else if ("tapjoy" === AD_NETWORK) {
136
140
  if (window.TJ_API) actualProtocol = TAPJOY;
137
- } else if ("tiktok" === AD_NETWORK) {
141
+ } else if ("tiktok" === AD_NETWORK || "pangle" === AD_NETWORK) {
138
142
  if (window.openAppStore) actualProtocol = TIKTOK;
139
143
  } else if ("smadex" === AD_NETWORK) {
140
144
  try {
141
145
  if (smxTracking) actualProtocol = SMADEX;
142
146
  } catch (error) {
143
147
  }
148
+ } else if ("snapchat" === AD_NETWORK) {
149
+ try {
150
+ if (ScPlayableAd) actualProtocol = SNAPCHAT;
151
+ } catch (error) {
152
+ }
144
153
  }
145
154
  }
146
155
 
@@ -551,8 +560,10 @@ var _sdk = class _sdk {
551
560
  dapi.openStoreUrl();
552
561
  } else if ("nucleo" === AD_PROTOCOL && isNucleo()) {
553
562
  NUC.trigger.convert(destinationUrl);
554
- } else if ("facebook" == AD_NETWORK && isFacebook()) {
563
+ } else if (("facebook" === AD_NETWORK || "moloco" === AD_NETWORK || "mytarget" === AD_NETWORK) && isFacebook()) {
555
564
  FbPlayableAd.onCTAClick();
565
+ } else if ("snapchat" == AD_NETWORK && isSnapchat()) {
566
+ ScPlayableAd.onCTAClick();
556
567
  } else if ("smadex" == AD_NETWORK && isSmadex()) {
557
568
  smxTracking.redirect();
558
569
  } else if ("vungle" == AD_NETWORK) {
@@ -563,7 +574,7 @@ var _sdk = class _sdk {
563
574
  window.install && window.install();
564
575
  } else if ("tapjoy" === AD_NETWORK && isTapjoy()) {
565
576
  window.TJ_API.click();
566
- } else if ("tiktok" === AD_NETWORK && isTikTok()) {
577
+ } else if (("tiktok" === AD_NETWORK || "pangle" === AD_NETWORK) && isTikTok()) {
567
578
  window.openAppStore();
568
579
  } else {
569
580
  window.open(destinationUrl);
@@ -669,7 +680,7 @@ var _sdk = class _sdk {
669
680
  }
670
681
  };
671
682
  /** Current version of the SDK */
672
- _sdk.version = "1.0.22";
683
+ _sdk.version = "1.0.24";
673
684
  /** Current maximum width of the playable ad container in pixels */
674
685
  _sdk.maxWidth = Math.floor(window.innerWidth);
675
686
  /** Current maximum height of the playable ad container in pixels */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smoud/playable-sdk",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "It's unified Playable SDK that supports MRAID, Google, Facebook, Vungle, and many more Ad Networks, simplifying playable ad development with a standardized interface for seamless cross-network compatibility.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",