customerio-expo-plugin 2.7.0 → 2.7.1

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": "customerio-expo-plugin",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "description": "Expo config plugin for the Customer IO React Native SDK",
5
5
  "main": "plugin/lib/commonjs/index",
6
6
  "module": "plugin/lib/module/index",
@@ -55,7 +55,7 @@
55
55
  "registry": "https://registry.npmjs.org/"
56
56
  },
57
57
  "peerDependencies": {
58
- "customerio-reactnative": "4.8.0"
58
+ "customerio-reactnative": "4.8.2"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@eslint/js": "^9.33.0",
@@ -1,7 +1,6 @@
1
1
  import CioDataPipelines
2
2
  import CioInternalCommon
3
3
  import CioMessagingInApp
4
- import customerio_reactnative
5
4
 
6
5
  class CustomerIOSDKInitializer {
7
6
  static func initialize() {
@@ -27,9 +26,16 @@ class CustomerIOSDKInitializer {
27
26
  CustomerIO.initialize(withConfig: builder.build())
28
27
 
29
28
  if let siteId = siteId {
30
- let inAppConfig = MessagingInAppConfigBuilder(siteId: siteId, region: region).build()
31
- MessagingInApp.initialize(withConfig: inAppConfig)
32
- MessagingInApp.shared.setEventListener(ReactInAppEventListener.shared)
29
+ let inAppConfig = MessagingInAppConfigBuilder(siteId: siteId, region: region).build()
30
+ MessagingInApp.initialize(withConfig: inAppConfig)
31
+ let logger = DIGraphShared.shared.logger
32
+ // Retrieves ReactInAppEventListener from DI graph, populated when it is accessed in React Native SDK.
33
+ if let listener: InAppEventListener? = DIGraphShared.shared.getOverriddenInstance() {
34
+ logger.debug("[Expo][InApp] React InAppEventListener found in DI graph and set")
35
+ MessagingInApp.shared.setEventListener(listener)
36
+ } else {
37
+ logger.debug("[Expo][InApp] React InAppEventListener not found in DI graph, will be set by React Native module when accessed")
38
+ }
33
39
  }
34
40
  }
35
41
 
@@ -1,7 +1,6 @@
1
1
  import CioDataPipelines
2
2
  import CioInternalCommon
3
3
  import CioMessagingInApp
4
- import customerio_reactnative
5
4
 
6
5
  class CustomerIOSDKInitializer {
7
6
  static func initialize() {
@@ -27,9 +26,16 @@ class CustomerIOSDKInitializer {
27
26
  CustomerIO.initialize(withConfig: builder.build())
28
27
 
29
28
  if let siteId = siteId {
30
- let inAppConfig = MessagingInAppConfigBuilder(siteId: siteId, region: region).build()
31
- MessagingInApp.initialize(withConfig: inAppConfig)
32
- MessagingInApp.shared.setEventListener(ReactInAppEventListener.shared)
29
+ let inAppConfig = MessagingInAppConfigBuilder(siteId: siteId, region: region).build()
30
+ MessagingInApp.initialize(withConfig: inAppConfig)
31
+ let logger = DIGraphShared.shared.logger
32
+ // Retrieves ReactInAppEventListener from DI graph, populated when it is accessed in React Native SDK.
33
+ if let listener: InAppEventListener? = DIGraphShared.shared.getOverriddenInstance() {
34
+ logger.debug("[Expo][InApp] React InAppEventListener found in DI graph and set")
35
+ MessagingInApp.shared.setEventListener(listener)
36
+ } else {
37
+ logger.debug("[Expo][InApp] React InAppEventListener not found in DI graph, will be set by React Native module when accessed")
38
+ }
33
39
  }
34
40
  }
35
41
 
@@ -1,7 +1,6 @@
1
1
  import CioDataPipelines
2
2
  import CioInternalCommon
3
3
  import CioMessagingInApp
4
- import customerio_reactnative
5
4
 
6
5
  class CustomerIOSDKInitializer {
7
6
  static func initialize() {
@@ -27,9 +26,16 @@ class CustomerIOSDKInitializer {
27
26
  CustomerIO.initialize(withConfig: builder.build())
28
27
 
29
28
  if let siteId = siteId {
30
- let inAppConfig = MessagingInAppConfigBuilder(siteId: siteId, region: region).build()
31
- MessagingInApp.initialize(withConfig: inAppConfig)
32
- MessagingInApp.shared.setEventListener(ReactInAppEventListener.shared)
29
+ let inAppConfig = MessagingInAppConfigBuilder(siteId: siteId, region: region).build()
30
+ MessagingInApp.initialize(withConfig: inAppConfig)
31
+ let logger = DIGraphShared.shared.logger
32
+ // Retrieves ReactInAppEventListener from DI graph, populated when it is accessed in React Native SDK.
33
+ if let listener: InAppEventListener? = DIGraphShared.shared.getOverriddenInstance() {
34
+ logger.debug("[Expo][InApp] React InAppEventListener found in DI graph and set")
35
+ MessagingInApp.shared.setEventListener(listener)
36
+ } else {
37
+ logger.debug("[Expo][InApp] React InAppEventListener not found in DI graph, will be set by React Native module when accessed")
38
+ }
33
39
  }
34
40
  }
35
41