@amplitude/plugin-engagement-react-native 3.6.0 → 3.8.0

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.
@@ -68,6 +68,8 @@ class PluginEngagementReactNativeModule(val reactContext: ReactApplicationContex
68
68
  val serverUrl = if (options?.hasKey("serverUrl") == true) options.getString("serverUrl") else null
69
69
  val cdnUrl = if (options?.hasKey("cdnUrl") == true) options.getString("cdnUrl") else null
70
70
  val mediaUrl = if (options?.hasKey("mediaUrl") == true) options.getString("mediaUrl") else null
71
+ val autoRefreshInterval =
72
+ if (options?.hasKey("autoRefreshInterval") == true) options.getInt("autoRefreshInterval") else null
71
73
 
72
74
  var initOptions =
73
75
  AmplitudeInitOptions(
@@ -90,6 +92,10 @@ class PluginEngagementReactNativeModule(val reactContext: ReactApplicationContex
90
92
  initOptions = initOptions.copy(ignoreAnalyticsAutomaticScreenTracking = ignoreAnalyticsAutomaticScreenTracking)
91
93
  }
92
94
 
95
+ if (autoRefreshInterval != null) {
96
+ initOptions = initOptions.copy(autoRefreshInterval = autoRefreshInterval)
97
+ }
98
+
93
99
  val platformVersion = options?.getString("platformVersion") ?: ""
94
100
 
95
101
  Log.d("PluginEngagementReactNativeModule", "newInstance apiKey=$apiKey, options=$options, initOptions=$initOptions")
@@ -87,6 +87,7 @@ var _id = 0
87
87
  let serverUrl = options?["serverUrl"] as? String
88
88
  let cdnUrl = options?["cdnUrl"] as? String
89
89
  let mediaUrl = options?["mediaUrl"] as? String
90
+ let autoRefreshInterval = options?["autoRefreshInterval"] as? Int
90
91
 
91
92
  let initOptions = AmplitudeInitOptions(
92
93
  serverZone: serverZone,
@@ -95,7 +96,8 @@ var _id = 0
95
96
  serverUrl: serverUrl,
96
97
  cdnUrl: cdnUrl,
97
98
  mediaUrl: mediaUrl,
98
- ignoreAnalyticsAutomaticScreenTracking: ignoreAnalyticsAutomaticScreenTracking
99
+ ignoreAnalyticsAutomaticScreenTracking: ignoreAnalyticsAutomaticScreenTracking,
100
+ autoRefreshInterval: autoRefreshInterval
99
101
  )
100
102
 
101
103
  AmplitudeEngagementAdapter.logger.debug(
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "3.6.0"
2
+ "version": "3.8.0"
3
3
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "3.6.0"
2
+ "version": "3.8.0"
3
3
  }
@@ -1 +1 @@
1
- {"version":"3.6.0"}
1
+ {"version":"3.8.0"}
@@ -14,6 +14,8 @@ export type AmplitudeInitOptions = {
14
14
  logLevel?: AmplitudeLogLevel;
15
15
  locale?: string;
16
16
  ignoreAnalyticsAutomaticScreenTracking?: boolean;
17
+ /** Auto-refresh interval in seconds. If not specified, 0, or negative, auto-refresh is disabled. Must be >= 60 seconds if enabled. */
18
+ autoRefreshInterval?: number;
17
19
  };
18
20
  export type AmplitudeEndUser = {
19
21
  user_id?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,YAAY,CAAC;AAE5D,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEhF,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM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E,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,gBAAgB,CAAC;IACvB,YAAY,EAAE,CAAC,CACb,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,KACpC,IAAI,CAAC,EAAE,CAAC;CACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amplitude/plugin-engagement-react-native",
3
- "version": "3.6.0",
3
+ "version": "3.8.0",
4
4
  "description": "Amplitude Engagement plugin for React Native",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "3.6.0"
2
+ "version": "3.8.0"
3
3
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "3.6.0"
2
+ "version": "3.8.0"
3
3
  }
package/src/types.ts CHANGED
@@ -18,6 +18,8 @@ export type AmplitudeInitOptions = {
18
18
  logLevel?: AmplitudeLogLevel;
19
19
  locale?: string;
20
20
  ignoreAnalyticsAutomaticScreenTracking?: boolean;
21
+ /** Auto-refresh interval in seconds. If not specified, 0, or negative, auto-refresh is disabled. Must be >= 60 seconds if enabled. */
22
+ autoRefreshInterval?: number;
21
23
  };
22
24
 
23
25
  export type AmplitudeEndUser = {