apps-sdk 1.1.52 → 1.1.53

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.52",
3
+ "version": "1.1.53",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -98,6 +98,24 @@ class Facebook {
98
98
  }
99
99
  }
100
100
 
101
+ async trackStartTrial(parameters = {}) {
102
+ if (!this.isInitialized) {
103
+ console.log('Facebook is not initialized');
104
+ return;
105
+ }
106
+
107
+ try {
108
+ if (!this.devMode) {
109
+ await AppEventsLogger.logEvent('StartTrial', parameters);
110
+ config.DEBUG_MODE && console.log(`Facebook StartTrial tracked with parameters:`, parameters);
111
+ } else {
112
+ config.DEBUG_MODE && console.log(`Facebook StartTrial tracked but not send (DEV_MODE ON) with parameters:`, parameters);
113
+ }
114
+ } catch (error) {
115
+ console.error('Error tracking start trial:', error);
116
+ }
117
+ }
118
+
101
119
  async trackPushNotificationOpen(payload = {}) {
102
120
  if (!this.isInitialized) {
103
121
  console.log('Facebook is not initialized');
package/types/index.d.ts CHANGED
@@ -243,6 +243,7 @@ declare module 'apps-sdk' {
243
243
  trackEvent(eventName: string, properties?: object): Promise<void>;
244
244
  trackEventIfExist(eventKeyword: string, eventData?: object): Promise<void>;
245
245
  trackPurchase(valueToSum: number, currency: string, parameters?: object): Promise<void>;
246
+ trackStartTrial(parameters?: object): Promise<void>;
246
247
  trackPushNotificationOpen(payload?: object): Promise<void>;
247
248
  isFacebookInitialized(): boolean;
248
249
  getApplicationId(): string | null;