apps-sdk 1.1.60 → 1.1.62

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": "apps-sdk",
3
- "version": "1.1.60",
3
+ "version": "1.1.62",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -123,6 +123,18 @@ class Adapty {
123
123
  }
124
124
  }
125
125
 
126
+ async closePaywallFromView(paywallView) {
127
+ try {
128
+ if (paywallView) {
129
+ paywallView.dismiss();
130
+ } else {
131
+ console.warn('Error closing paywall: paywall view is null');
132
+ }
133
+ } catch (error) {
134
+ console.error('Error closing paywall:', error);
135
+ }
136
+ }
137
+
126
138
  async showPaywallPreloaded(paywallView, eventHandlers = {}) {
127
139
  try {
128
140
  if (paywallView) {
@@ -8,14 +8,45 @@ class Rating {
8
8
  if (force || (await this.requestReviewIfNeeded())) {
9
9
  if (await StoreReview.hasAction()) {
10
10
  if (await StoreReview.isAvailableAsync()) {
11
- return await StoreReview.requestReview();
11
+ await StoreReview.requestReview();
12
+ return {
13
+ success: true,
14
+ shown: true,
15
+ message: 'Review dialog shown successfully'
16
+ };
17
+ } else {
18
+ return {
19
+ success: false,
20
+ shown: false,
21
+ blocked: true,
22
+ message: 'Review dialog not available (possibly blocked by OS)'
23
+ };
12
24
  }
25
+ } else {
26
+ return {
27
+ success: false,
28
+ shown: false,
29
+ blocked: true,
30
+ message: 'Store review not supported on this device'
31
+ };
13
32
  }
14
33
  } else {
15
34
  console.log("Rating requestReviewIfNeeded not needed");
35
+ return {
36
+ success: false,
37
+ shown: false,
38
+ tooSoon: true,
39
+ message: 'Review request too soon (less than 7 days since last request)'
40
+ };
16
41
  }
17
42
  } catch (error) {
18
43
  console.log("Error en requestReview", error);
44
+ return {
45
+ success: false,
46
+ shown: false,
47
+ error: true,
48
+ message: error.message
49
+ };
19
50
  }
20
51
  }
21
52
 
package/types/index.d.ts CHANGED
@@ -242,6 +242,7 @@ declare module 'apps-sdk' {
242
242
  preloadOnboarding(placementID: string, lang: string): Promise<any>;
243
243
  closeOnboarding(): Promise<void>;
244
244
  showOnboardingPreloaded(onboardingView: any, eventHandlers?: OnboardingEventHandlers): Promise<void>;
245
+ closePaywallFromView(paywallView: any): Promise<void>;
245
246
  }
246
247
 
247
248
  export class TrackingTransparency {