rampkit-expo-dev 0.0.87 → 0.0.88

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.
@@ -2032,7 +2032,13 @@ function Overlay(props) {
2032
2032
  // 3) A page requested an in-app review prompt
2033
2033
  if ((data === null || data === void 0 ? void 0 : data.type) === "rampkit:request-review" ||
2034
2034
  (data === null || data === void 0 ? void 0 : data.type) === "rampkit:review") {
2035
- const executeReview = async () => {
2035
+ // Only process from active screen (on-open actions are handled by SDK in activateScreen)
2036
+ if (!isScreenActive(i)) {
2037
+ if (__DEV__)
2038
+ console.log(`[Rampkit] Ignoring review request from inactive screen ${i} (SDK handles on-open)`);
2039
+ return;
2040
+ }
2041
+ (async () => {
2036
2042
  try {
2037
2043
  const available = await RampKitNative_1.StoreReview.isAvailableAsync();
2038
2044
  if (available) {
@@ -2040,36 +2046,22 @@ function Overlay(props) {
2040
2046
  }
2041
2047
  }
2042
2048
  catch (_) { }
2043
- };
2044
- // Only execute if screen is active, otherwise queue for later
2045
- if (isScreenActive(i)) {
2046
- executeReview();
2047
- }
2048
- else {
2049
- if (__DEV__)
2050
- console.log(`[Rampkit] Queuing review request from inactive screen ${i}`);
2051
- queueAction(i, executeReview);
2052
- }
2049
+ })();
2053
2050
  return;
2054
2051
  }
2055
2052
  // 4) A page requested notification permission
2056
2053
  if ((data === null || data === void 0 ? void 0 : data.type) === "rampkit:request-notification-permission") {
2057
- const executeNotification = () => {
2058
- handleNotificationPermissionRequest({
2059
- ios: data === null || data === void 0 ? void 0 : data.ios,
2060
- android: data === null || data === void 0 ? void 0 : data.android,
2061
- behavior: data === null || data === void 0 ? void 0 : data.behavior,
2062
- });
2063
- };
2064
- // Only execute if screen is active, otherwise queue for later
2065
- if (isScreenActive(i)) {
2066
- executeNotification();
2067
- }
2068
- else {
2054
+ // Only process from active screen (on-open actions are handled by SDK in activateScreen)
2055
+ if (!isScreenActive(i)) {
2069
2056
  if (__DEV__)
2070
- console.log(`[Rampkit] Queuing notification request from inactive screen ${i}`);
2071
- queueAction(i, executeNotification);
2057
+ console.log(`[Rampkit] Ignoring notification request from inactive screen ${i} (SDK handles on-open)`);
2058
+ return;
2072
2059
  }
2060
+ handleNotificationPermissionRequest({
2061
+ ios: data === null || data === void 0 ? void 0 : data.ios,
2062
+ android: data === null || data === void 0 ? void 0 : data.android,
2063
+ behavior: data === null || data === void 0 ? void 0 : data.behavior,
2064
+ });
2073
2065
  return;
2074
2066
  }
2075
2067
  // 5) Onboarding finished event from page
@@ -2180,7 +2172,13 @@ function Overlay(props) {
2180
2172
  return;
2181
2173
  }
2182
2174
  if (raw === "rampkit:request-review" || raw === "rampkit:review") {
2183
- const executeReview = async () => {
2175
+ // Only process from active screen (on-open actions are handled by SDK in activateScreen)
2176
+ if (!isScreenActive(i)) {
2177
+ if (__DEV__)
2178
+ console.log(`[Rampkit] Ignoring review request (raw) from inactive screen ${i} (SDK handles on-open)`);
2179
+ return;
2180
+ }
2181
+ (async () => {
2184
2182
  try {
2185
2183
  const available = await RampKitNative_1.StoreReview.isAvailableAsync();
2186
2184
  if (available) {
@@ -2188,29 +2186,17 @@ function Overlay(props) {
2188
2186
  }
2189
2187
  }
2190
2188
  catch (_) { }
2191
- };
2192
- // Only execute if screen is active, otherwise queue for later
2193
- if (isScreenActive(i)) {
2194
- executeReview();
2195
- }
2196
- else {
2197
- if (__DEV__)
2198
- console.log(`[Rampkit] Queuing review request (raw) from inactive screen ${i}`);
2199
- queueAction(i, executeReview);
2200
- }
2189
+ })();
2201
2190
  return;
2202
2191
  }
2203
2192
  if (raw === "rampkit:request-notification-permission") {
2204
- const executeNotification = () => handleNotificationPermissionRequest(undefined);
2205
- // Only execute if screen is active, otherwise queue for later
2206
- if (isScreenActive(i)) {
2207
- executeNotification();
2208
- }
2209
- else {
2193
+ // Only process from active screen (on-open actions are handled by SDK in activateScreen)
2194
+ if (!isScreenActive(i)) {
2210
2195
  if (__DEV__)
2211
- console.log(`[Rampkit] Queuing notification request (raw) from inactive screen ${i}`);
2212
- queueAction(i, executeNotification);
2196
+ console.log(`[Rampkit] Ignoring notification request (raw) from inactive screen ${i} (SDK handles on-open)`);
2197
+ return;
2213
2198
  }
2199
+ handleNotificationPermissionRequest(undefined);
2214
2200
  return;
2215
2201
  }
2216
2202
  if (raw === "rampkit:onboarding-finished") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rampkit-expo-dev",
3
- "version": "0.0.87",
3
+ "version": "0.0.88",
4
4
  "description": "The Expo SDK for RampKit. Build, test, and personalize app onboardings with instant updates.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",