@trycourier/courier-react-native 5.7.0 → 5.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.
Files changed (28) hide show
  1. package/README.md +2 -2
  2. package/android/build.gradle +9 -8
  3. package/android/gradle.properties +5 -5
  4. package/android/src/main/java/com/courierreactnative/CourierClientModule.kt +2 -6
  5. package/android/src/main/java/com/courierreactnative/CourierInboxViewManager.kt +2 -0
  6. package/android/src/main/java/com/courierreactnative/CourierPreferencesViewManager.kt +4 -2
  7. package/android/src/main/java/com/courierreactnative/CourierSystemModule.kt +6 -8
  8. package/android/src/main/java/com/courierreactnative/ReactNativeModule.kt +2 -6
  9. package/android/src/main/java/com/courierreactnative/Utils.kt +1 -1
  10. package/courier-react-native.podspec +1 -1
  11. package/ios/CourierInboxReactNativeManager.swift +8 -0
  12. package/ios/CourierPreferencesReactNativeManager.swift +8 -0
  13. package/ios/CourierReactNativeDelegate.m +1 -1
  14. package/ios/CourierReactNativeEventEmitter.swift +1 -1
  15. package/lib/commonjs/Modules.js +6 -5
  16. package/lib/commonjs/Modules.js.map +1 -1
  17. package/lib/module/Modules.js +7 -6
  18. package/lib/module/Modules.js.map +1 -1
  19. package/lib/typescript/src/Modules.d.ts +1 -1
  20. package/lib/typescript/src/Modules.d.ts.map +1 -1
  21. package/lib/typescript/src/models/CourierInboxTheme.d.ts +1 -0
  22. package/lib/typescript/src/models/CourierInboxTheme.d.ts.map +1 -1
  23. package/lib/typescript/src/models/CourierPreferencesTheme.d.ts +1 -0
  24. package/lib/typescript/src/models/CourierPreferencesTheme.d.ts.map +1 -1
  25. package/package.json +13 -8
  26. package/src/Modules.tsx +14 -3
  27. package/src/models/CourierInboxTheme.tsx +1 -0
  28. package/src/models/CourierPreferencesTheme.tsx +1 -0
package/README.md CHANGED
@@ -161,8 +161,8 @@ Starter projects using this SDK.
161
161
  <tbody>
162
162
  <tr width="1000px">
163
163
  <td align="left">
164
- <a href="https://github.com/trycourier/courier-react-native/tree/master/example">
165
- <code>Example</code>
164
+ <a href="https://github.com/trycourier/courier-react-native/tree/master/example-085">
165
+ <code>Example (React Native 0.85+, New Architecture)</code>
166
166
  </a>
167
167
  </td>
168
168
  </tr>
@@ -21,13 +21,16 @@ def isNewArchitectureEnabled() {
21
21
  apply plugin: "com.android.library"
22
22
  apply plugin: "kotlin-android"
23
23
 
24
-
25
24
  def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
26
25
 
27
26
  if (isNewArchitectureEnabled()) {
28
27
  apply plugin: "com.facebook.react"
29
28
  }
30
29
 
30
+ def safeExtGet(prop, fallback) {
31
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
32
+ }
33
+
31
34
  def getExtOrDefault(name) {
32
35
  return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["CourierReactNative_" + name]
33
36
  }
@@ -61,15 +64,15 @@ android {
61
64
  }
62
65
  }
63
66
 
64
- compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
67
+ compileSdkVersion safeExtGet("compileSdkVersion", getExtOrIntegerDefault("compileSdkVersion"))
65
68
 
66
69
  buildFeatures {
67
70
  buildConfig true
68
71
  }
69
72
 
70
73
  defaultConfig {
71
- minSdkVersion getExtOrIntegerDefault("minSdkVersion")
72
- targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
74
+ minSdkVersion safeExtGet("minSdkVersion", getExtOrIntegerDefault("minSdkVersion"))
75
+ targetSdkVersion safeExtGet("targetSdkVersion", getExtOrIntegerDefault("targetSdkVersion"))
73
76
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
74
77
  }
75
78
 
@@ -100,17 +103,15 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
100
103
 
101
104
  dependencies {
102
105
 
103
- // For < 0.71, this will be from the local maven repo
104
- // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
105
106
  //noinspection GradleDynamicVersion
106
- implementation "com.facebook.react:react-android:0.73.7"
107
+ implementation "com.facebook.react:react-android:+"
107
108
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
108
109
 
109
110
  // For converting to json
110
111
  implementation 'com.google.code.gson:gson:2.11.0'
111
112
 
112
113
  // Courier Core SDK
113
- api 'com.github.trycourier:courier-android:5.3.0'
114
+ api 'com.github.trycourier:courier-android:5.3.1'
114
115
  api 'androidx.recyclerview:recyclerview:1.3.2'
115
116
 
116
117
  }
@@ -1,5 +1,5 @@
1
- CourierReactNative_kotlinVersion=1.7.0
2
- CourierReactNative_minSdkVersion=23
3
- CourierReactNative_targetSdkVersion=31
4
- CourierReactNative_compileSdkVersion=31
5
- CourierReactNative_ndkversion=21.4.7075529
1
+ CourierReactNative_kotlinVersion=1.9.24
2
+ CourierReactNative_minSdkVersion=24
3
+ CourierReactNative_targetSdkVersion=34
4
+ CourierReactNative_compileSdkVersion=34
5
+ CourierReactNative_ndkversion=26.1.10909125
@@ -77,11 +77,7 @@ class CourierClientModule(
77
77
  return@launch
78
78
  }
79
79
 
80
- if (reactActivity == null) {
81
- promise.rejectMissingContext()
82
- return@launch
83
- }
84
-
80
+ val context = reactApplicationContext
85
81
  val courierDevice = device?.let {
86
82
  CourierDevice(
87
83
  appId = it.getString("appId"),
@@ -97,7 +93,7 @@ class CourierClientModule(
97
93
  client.tokens.putUserToken(
98
94
  token = token,
99
95
  provider = provider,
100
- device = courierDevice ?: CourierDevice.current(reactActivity!!)
96
+ device = courierDevice ?: CourierDevice.current(context)
101
97
  )
102
98
  promise.resolve(null)
103
99
  } catch (e: Exception) {
@@ -119,6 +119,7 @@ class CourierInboxViewManager : SimpleViewManager<CourierInbox>() {
119
119
  val dividerItemDecoration = android?.getString("dividerItemDecoration")
120
120
 
121
121
  val brandId = getString("brandId")
122
+ val backgroundColor = getString("backgroundColor")
122
123
 
123
124
  val tabIndicatorColor = getString("tabIndicatorColor")
124
125
  val tabStyle = getMap("tabStyle")
@@ -139,6 +140,7 @@ class CourierInboxViewManager : SimpleViewManager<CourierInbox>() {
139
140
 
140
141
  return CourierInboxTheme(
141
142
  brandId = brandId,
143
+ backgroundColor = backgroundColor?.toColor(),
142
144
  tabIndicatorColor = tabIndicatorColor?.toColor(),
143
145
  tabStyle = tabStyle?.toTabStyle(context) ?: CourierStyles.Inbox.TabStyle(
144
146
  selected = CourierStyles.Inbox.TabItemStyle(
@@ -43,8 +43,8 @@ class CourierPreferencesViewManager : SimpleViewManager<CourierPreferences>() {
43
43
 
44
44
  override fun createViewInstance(reactContext: ThemedReactContext): CourierPreferences {
45
45
  themedReactContext = reactContext
46
- val activity = reactContext.currentActivity as FragmentActivity
47
- return CourierReactNativePreferencesView(activity)
46
+ val context = (reactContext.currentActivity as? FragmentActivity) ?: reactContext
47
+ return CourierReactNativePreferencesView(context)
48
48
  }
49
49
 
50
50
  @ReactProp(name = "onScrollPreferences")
@@ -102,6 +102,7 @@ class CourierPreferencesViewManager : SimpleViewManager<CourierPreferences>() {
102
102
  private fun ReadableMap.toTheme(view: CourierPreferences): CourierPreferencesTheme {
103
103
 
104
104
  val brandId = getString("brandId")
105
+ val backgroundColor = getString("backgroundColor")
105
106
  val loadingIndicatorColor = getString("loadingIndicatorColor")
106
107
  val sectionTitleFont = getMap("sectionTitleFont")
107
108
  val topicTitleFont = getMap("topicTitleFont")
@@ -118,6 +119,7 @@ class CourierPreferencesViewManager : SimpleViewManager<CourierPreferences>() {
118
119
 
119
120
  return CourierPreferencesTheme(
120
121
  brandId = brandId,
122
+ backgroundColor = backgroundColor?.toColor(),
121
123
  loadingIndicatorColor = loadingIndicatorColor?.toColor(),
122
124
  sectionTitleFont = sectionTitleFont?.toFont(context) ?: defaultTheme.sectionTitleFont,
123
125
  topicDividerItemDecoration = topicDividerItemDecoration?.toDivider(context),
@@ -22,7 +22,6 @@ class CourierSystemModule(reactContext: ReactApplicationContext): ReactNativeMod
22
22
 
23
23
  init {
24
24
 
25
- // Listen to push notification events
26
25
  Courier.shared.onPushNotificationEvent { event ->
27
26
  when (event.trackingEvent) {
28
27
  CLICKED -> postPushNotificationJavascriptEvent(CourierEvents.Push.CLICKED_EVENT, event.remoteMessage)
@@ -45,8 +44,8 @@ class CourierSystemModule(reactContext: ReactApplicationContext): ReactNativeMod
45
44
 
46
45
  @ReactMethod
47
46
  fun registerPushNotificationClickedOnKilledState() {
48
- reactActivity?.let { activity ->
49
- checkIntentForPushNotificationClick(activity.intent)
47
+ activity?.let { act ->
48
+ checkIntentForPushNotificationClick(act.intent)
50
49
  }
51
50
  }
52
51
 
@@ -66,8 +65,8 @@ class CourierSystemModule(reactContext: ReactApplicationContext): ReactNativeMod
66
65
  @ReactMethod
67
66
  fun requestNotificationPermission(promise: Promise) {
68
67
 
69
- reactActivity?.let { activity ->
70
- Courier.shared.requestNotificationPermission(activity)
68
+ activity?.let { act ->
69
+ Courier.shared.requestNotificationPermission(act)
71
70
  }
72
71
 
73
72
  promise.resolve("unknown")
@@ -77,9 +76,9 @@ class CourierSystemModule(reactContext: ReactApplicationContext): ReactNativeMod
77
76
  @ReactMethod
78
77
  fun getNotificationPermissionStatus(promise: Promise) {
79
78
 
80
- reactActivity?.let { context ->
79
+ activity?.let { act ->
81
80
 
82
- val isGranted = Courier.shared.isPushPermissionGranted(context)
81
+ val isGranted = Courier.shared.isPushPermissionGranted(act)
83
82
  val status = if (isGranted) "authorized" else "denied"
84
83
  promise.resolve(status)
85
84
  return
@@ -92,7 +91,6 @@ class CourierSystemModule(reactContext: ReactApplicationContext): ReactNativeMod
92
91
 
93
92
  @ReactMethod(isBlockingSynchronousMethod = true)
94
93
  fun openSettingsForApp(): String? {
95
- // TODO: Move this to the native package in the future
96
94
  val context = reactApplicationContext
97
95
  try {
98
96
  val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
@@ -1,7 +1,7 @@
1
1
  package com.courierreactnative
2
2
 
3
+ import android.app.Activity
3
4
  import com.courier.android.Courier
4
- import com.facebook.react.ReactActivity
5
5
  import com.facebook.react.bridge.Promise
6
6
  import com.facebook.react.bridge.ReactApplicationContext
7
7
  import com.facebook.react.bridge.ReactContextBaseJavaModule
@@ -10,14 +10,10 @@ abstract class ReactNativeModule(val tag: String, private val name: String, reac
10
10
 
11
11
  override fun getName() = name
12
12
 
13
- val reactActivity: ReactActivity? get() = currentActivity as? ReactActivity
13
+ val activity: Activity? get() = reactApplicationContext.currentActivity
14
14
 
15
15
  init {
16
-
17
- // User Agent is used to ensure we know the SDK
18
- // the requests come from
19
16
  Courier.agent = Utils.COURIER_AGENT
20
-
21
17
  }
22
18
 
23
19
  internal fun Promise.rejectMissingContext() {
@@ -15,7 +15,7 @@ import com.facebook.react.modules.core.DeviceEventManagerModule
15
15
  import com.google.gson.GsonBuilder
16
16
 
17
17
  internal object Utils {
18
- val COURIER_AGENT = CourierAgent.ReactNativeAndroid(version = "5.7.0")
18
+ val COURIER_AGENT = CourierAgent.ReactNativeAndroid(version = "5.8.0")
19
19
  }
20
20
 
21
21
  internal fun ReactContext.sendEvent(eventName: String, value: Any?) {
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
17
17
  s.source_files = "ios/**/*.{h,m,mm,swift}"
18
18
 
19
19
  # Courier Core Dependency
20
- s.dependency "Courier_iOS", "5.8.0"
20
+ s.dependency "Courier_iOS", "5.8.1"
21
21
 
22
22
  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
23
23
  # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
@@ -46,6 +46,14 @@ class CourierInboxView : UIView {
46
46
  let lightTheme = theme?["light"] as? NSDictionary
47
47
  let darkTheme = theme?["dark"] as? NSDictionary
48
48
 
49
+ let lightBgColor = (lightTheme?["backgroundColor"] as? String)?.toColor()
50
+ let darkBgColor = (darkTheme?["backgroundColor"] as? String)?.toColor()
51
+ if let bgColor = traitCollection.userInterfaceStyle == .dark ? darkBgColor ?? lightBgColor : lightBgColor ?? darkBgColor {
52
+ self.backgroundColor = bgColor
53
+ } else {
54
+ self.backgroundColor = nil
55
+ }
56
+
49
57
  let courierInbox = CourierInbox(
50
58
  canSwipePages: self.canSwipePages,
51
59
  lightTheme: lightTheme?.toInboxTheme() ?? .defaultLight,
@@ -44,6 +44,14 @@ class CourierPreferencesView : UIView {
44
44
  let lightTheme = theme?["light"] as? NSDictionary
45
45
  let darkTheme = theme?["dark"] as? NSDictionary
46
46
 
47
+ let lightBgColor = (lightTheme?["backgroundColor"] as? String)?.toColor()
48
+ let darkBgColor = (darkTheme?["backgroundColor"] as? String)?.toColor()
49
+ if let bgColor = traitCollection.userInterfaceStyle == .dark ? darkBgColor ?? lightBgColor : lightBgColor ?? darkBgColor {
50
+ self.backgroundColor = bgColor
51
+ } else {
52
+ self.backgroundColor = nil
53
+ }
54
+
47
55
  let courierPreferences = CourierPreferences(
48
56
  mode: mode?.toMode() ?? .channels(CourierUserPreferencesChannel.allCases),
49
57
  lightTheme: lightTheme?.toPreferencesTheme() ?? .defaultLight,
@@ -33,7 +33,7 @@ static NSString *const CourierForegroundOptionsDidChangeNotification = @"iosFore
33
33
  if (self) {
34
34
 
35
35
  // Set the user agent
36
- Courier.agent = [CourierAgent reactNativeIOS:@"5.7.0"];
36
+ Courier.agent = [CourierAgent reactNativeIOS:@"5.8.0"];
37
37
 
38
38
  // Register for remote notifications
39
39
  UIApplication *app = [UIApplication sharedApplication];
@@ -14,7 +14,7 @@ internal class CourierReactNativeEventEmitter: RCTEventEmitter {
14
14
 
15
15
  // Set the user agent
16
16
  // Used to know the platform performing requests
17
- Courier.agent = CourierAgent.reactNativeIOS("5.7.0")
17
+ Courier.agent = CourierAgent.reactNativeIOS("5.8.0")
18
18
 
19
19
  }
20
20
 
@@ -10,11 +10,12 @@ class Modules {
10
10
  ios: "- You have run 'pod install'\n",
11
11
  default: ''
12
12
  }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
13
- static Client = Modules.getNativeModule(_reactNative.NativeModules.CourierClientModule);
14
- static Shared = Modules.getNativeModule(_reactNative.NativeModules.CourierSharedModule);
15
- static System = Modules.getNativeModule(_reactNative.NativeModules.CourierSystemModule);
16
- static getNativeModule(nativeModule) {
17
- return nativeModule ? nativeModule : new Proxy({}, {
13
+ static Client = Modules.getNativeModule('CourierClientModule', _reactNative.NativeModules.CourierClientModule);
14
+ static Shared = Modules.getNativeModule('CourierSharedModule', _reactNative.NativeModules.CourierSharedModule);
15
+ static System = Modules.getNativeModule('CourierSystemModule', _reactNative.NativeModules.CourierSystemModule);
16
+ static getNativeModule(moduleName, bridgeModule) {
17
+ const resolved = (_reactNative.TurboModuleRegistry === null || _reactNative.TurboModuleRegistry === void 0 ? void 0 : _reactNative.TurboModuleRegistry.get(moduleName)) ?? bridgeModule ?? undefined;
18
+ return resolved ? resolved : new Proxy({}, {
18
19
  get() {
19
20
  throw new Error(Modules.LINKING_ERROR);
20
21
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","Modules","LINKING_ERROR","Platform","select","ios","default","Client","getNativeModule","NativeModules","CourierClientModule","Shared","CourierSharedModule","System","CourierSystemModule","nativeModule","Proxy","get","Error","getNativeComponent","componentName","UIManager","getViewManagerConfig","requireNativeComponent","exports"],"sourceRoot":"../../src","sources":["Modules.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAOO,MAAMC,OAAO,CAAC;EACnB,OAAgBC,aAAa,GAC3B,2FAA2F,GAC3FC,qBAAQ,CAACC,MAAM,CAAC;IAAEC,GAAG,EAAE,gCAAgC;IAAEC,OAAO,EAAE;EAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;EAEjC,OAAgBC,MAAM,GAAGN,OAAO,CAACO,eAAe,CAC9CC,0BAAa,CAACC,mBAChB,CAAC;EACD,OAAgBC,MAAM,GAAGV,OAAO,CAACO,eAAe,CAC9CC,0BAAa,CAACG,mBAChB,CAAC;EACD,OAAgBC,MAAM,GAAGZ,OAAO,CAACO,eAAe,CAC9CC,0BAAa,CAACK,mBAChB,CAAC;EAED,OAAON,eAAeA,CAAIO,YAA2B,EAAK;IACxD,OAAOA,YAAY,GACfA,YAAY,GACX,IAAIC,KAAK,CACR,CAAC,CAAC,EACF;MACEC,GAAGA,CAAA,EAAG;QACJ,MAAM,IAAIC,KAAK,CAACjB,OAAO,CAACC,aAAa,CAAC;MACxC;IACF,CACF,CAAO;EACb;EAEA,OAAOiB,kBAAkBA,CAACC,aAAqB,EAAE;IAC/C,OAAOC,sBAAS,CAACC,oBAAoB,CAACF,aAAa,CAAC,IAAI,IAAI,GACxD,IAAAG,mCAAsB,EAAMH,aAAa,CAAC,GAC1C,MAAM;MACJ,MAAM,IAAIF,KAAK,CAACjB,OAAO,CAACC,aAAa,CAAC;IACxC,CAAC;EACP;AACF;AAACsB,OAAA,CAAAvB,OAAA,GAAAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","Modules","LINKING_ERROR","Platform","select","ios","default","Client","getNativeModule","NativeModules","CourierClientModule","Shared","CourierSharedModule","System","CourierSystemModule","moduleName","bridgeModule","resolved","TurboModuleRegistry","get","undefined","Proxy","Error","getNativeComponent","componentName","UIManager","getViewManagerConfig","requireNativeComponent","exports"],"sourceRoot":"../../src","sources":["Modules.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAQO,MAAMC,OAAO,CAAC;EACnB,OAAgBC,aAAa,GAC3B,2FAA2F,GAC3FC,qBAAQ,CAACC,MAAM,CAAC;IAAEC,GAAG,EAAE,gCAAgC;IAAEC,OAAO,EAAE;EAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;EAEjC,OAAgBC,MAAM,GAAGN,OAAO,CAACO,eAAe,CAC9C,qBAAqB,EACrBC,0BAAa,CAACC,mBAChB,CAAC;EACD,OAAgBC,MAAM,GAAGV,OAAO,CAACO,eAAe,CAC9C,qBAAqB,EACrBC,0BAAa,CAACG,mBAChB,CAAC;EACD,OAAgBC,MAAM,GAAGZ,OAAO,CAACO,eAAe,CAC9C,qBAAqB,EACrBC,0BAAa,CAACK,mBAChB,CAAC;EAED,OAAON,eAAeA,CACpBO,UAAkB,EAClBC,YAA2B,EACxB;IACH,MAAMC,QAAQ,GACZ,CAACC,gCAAmB,aAAnBA,gCAAmB,uBAAnBA,gCAAmB,CAAEC,GAAG,CAACJ,UAAU,CAAC,KACrCC,YAAY,IACZI,SAAS;IACX,OAAOH,QAAQ,GACXA,QAAQ,GACP,IAAII,KAAK,CACR,CAAC,CAAC,EACF;MACEF,GAAGA,CAAA,EAAG;QACJ,MAAM,IAAIG,KAAK,CAACrB,OAAO,CAACC,aAAa,CAAC;MACxC;IACF,CACF,CAAO;EACb;EAEA,OAAOqB,kBAAkBA,CAACC,aAAqB,EAAE;IAC/C,OAAOC,sBAAS,CAACC,oBAAoB,CAACF,aAAa,CAAC,IAAI,IAAI,GACxD,IAAAG,mCAAsB,EAAMH,aAAa,CAAC,GAC1C,MAAM;MACJ,MAAM,IAAIF,KAAK,CAACrB,OAAO,CAACC,aAAa,CAAC;IACxC,CAAC;EACP;AACF;AAAC0B,OAAA,CAAA3B,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -1,14 +1,15 @@
1
- import { NativeModules, Platform, UIManager, requireNativeComponent } from 'react-native';
1
+ import { NativeModules, Platform, UIManager, TurboModuleRegistry, requireNativeComponent } from 'react-native';
2
2
  export class Modules {
3
3
  static LINKING_ERROR = `The package '@trycourier/courier-react-native' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
4
4
  ios: "- You have run 'pod install'\n",
5
5
  default: ''
6
6
  }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
7
- static Client = Modules.getNativeModule(NativeModules.CourierClientModule);
8
- static Shared = Modules.getNativeModule(NativeModules.CourierSharedModule);
9
- static System = Modules.getNativeModule(NativeModules.CourierSystemModule);
10
- static getNativeModule(nativeModule) {
11
- return nativeModule ? nativeModule : new Proxy({}, {
7
+ static Client = Modules.getNativeModule('CourierClientModule', NativeModules.CourierClientModule);
8
+ static Shared = Modules.getNativeModule('CourierSharedModule', NativeModules.CourierSharedModule);
9
+ static System = Modules.getNativeModule('CourierSystemModule', NativeModules.CourierSystemModule);
10
+ static getNativeModule(moduleName, bridgeModule) {
11
+ const resolved = (TurboModuleRegistry === null || TurboModuleRegistry === void 0 ? void 0 : TurboModuleRegistry.get(moduleName)) ?? bridgeModule ?? undefined;
12
+ return resolved ? resolved : new Proxy({}, {
12
13
  get() {
13
14
  throw new Error(Modules.LINKING_ERROR);
14
15
  }
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","Platform","UIManager","requireNativeComponent","Modules","LINKING_ERROR","select","ios","default","Client","getNativeModule","CourierClientModule","Shared","CourierSharedModule","System","CourierSystemModule","nativeModule","Proxy","get","Error","getNativeComponent","componentName","getViewManagerConfig"],"sourceRoot":"../../src","sources":["Modules.tsx"],"mappings":"AAAA,SACEA,aAAa,EACbC,QAAQ,EACRC,SAAS,EACTC,sBAAsB,QACjB,cAAc;AAErB,OAAO,MAAMC,OAAO,CAAC;EACnB,OAAgBC,aAAa,GAC3B,2FAA2F,GAC3FJ,QAAQ,CAACK,MAAM,CAAC;IAAEC,GAAG,EAAE,gCAAgC;IAAEC,OAAO,EAAE;EAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;EAEjC,OAAgBC,MAAM,GAAGL,OAAO,CAACM,eAAe,CAC9CV,aAAa,CAACW,mBAChB,CAAC;EACD,OAAgBC,MAAM,GAAGR,OAAO,CAACM,eAAe,CAC9CV,aAAa,CAACa,mBAChB,CAAC;EACD,OAAgBC,MAAM,GAAGV,OAAO,CAACM,eAAe,CAC9CV,aAAa,CAACe,mBAChB,CAAC;EAED,OAAOL,eAAeA,CAAIM,YAA2B,EAAK;IACxD,OAAOA,YAAY,GACfA,YAAY,GACX,IAAIC,KAAK,CACR,CAAC,CAAC,EACF;MACEC,GAAGA,CAAA,EAAG;QACJ,MAAM,IAAIC,KAAK,CAACf,OAAO,CAACC,aAAa,CAAC;MACxC;IACF,CACF,CAAO;EACb;EAEA,OAAOe,kBAAkBA,CAACC,aAAqB,EAAE;IAC/C,OAAOnB,SAAS,CAACoB,oBAAoB,CAACD,aAAa,CAAC,IAAI,IAAI,GACxDlB,sBAAsB,CAAMkB,aAAa,CAAC,GAC1C,MAAM;MACJ,MAAM,IAAIF,KAAK,CAACf,OAAO,CAACC,aAAa,CAAC;IACxC,CAAC;EACP;AACF","ignoreList":[]}
1
+ {"version":3,"names":["NativeModules","Platform","UIManager","TurboModuleRegistry","requireNativeComponent","Modules","LINKING_ERROR","select","ios","default","Client","getNativeModule","CourierClientModule","Shared","CourierSharedModule","System","CourierSystemModule","moduleName","bridgeModule","resolved","get","undefined","Proxy","Error","getNativeComponent","componentName","getViewManagerConfig"],"sourceRoot":"../../src","sources":["Modules.tsx"],"mappings":"AAAA,SACEA,aAAa,EACbC,QAAQ,EACRC,SAAS,EACTC,mBAAmB,EACnBC,sBAAsB,QACjB,cAAc;AAErB,OAAO,MAAMC,OAAO,CAAC;EACnB,OAAgBC,aAAa,GAC3B,2FAA2F,GAC3FL,QAAQ,CAACM,MAAM,CAAC;IAAEC,GAAG,EAAE,gCAAgC;IAAEC,OAAO,EAAE;EAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;EAEjC,OAAgBC,MAAM,GAAGL,OAAO,CAACM,eAAe,CAC9C,qBAAqB,EACrBX,aAAa,CAACY,mBAChB,CAAC;EACD,OAAgBC,MAAM,GAAGR,OAAO,CAACM,eAAe,CAC9C,qBAAqB,EACrBX,aAAa,CAACc,mBAChB,CAAC;EACD,OAAgBC,MAAM,GAAGV,OAAO,CAACM,eAAe,CAC9C,qBAAqB,EACrBX,aAAa,CAACgB,mBAChB,CAAC;EAED,OAAOL,eAAeA,CACpBM,UAAkB,EAClBC,YAA2B,EACxB;IACH,MAAMC,QAAQ,GACZ,CAAChB,mBAAmB,aAAnBA,mBAAmB,uBAAnBA,mBAAmB,CAAEiB,GAAG,CAACH,UAAU,CAAC,KACrCC,YAAY,IACZG,SAAS;IACX,OAAOF,QAAQ,GACXA,QAAQ,GACP,IAAIG,KAAK,CACR,CAAC,CAAC,EACF;MACEF,GAAGA,CAAA,EAAG;QACJ,MAAM,IAAIG,KAAK,CAAClB,OAAO,CAACC,aAAa,CAAC;MACxC;IACF,CACF,CAAO;EACb;EAEA,OAAOkB,kBAAkBA,CAACC,aAAqB,EAAE;IAC/C,OAAOvB,SAAS,CAACwB,oBAAoB,CAACD,aAAa,CAAC,IAAI,IAAI,GACxDrB,sBAAsB,CAAMqB,aAAa,CAAC,GAC1C,MAAM;MACJ,MAAM,IAAIF,KAAK,CAAClB,OAAO,CAACC,aAAa,CAAC;IACxC,CAAC;EACP;AACF","ignoreList":[]}
@@ -3,7 +3,7 @@ export declare class Modules {
3
3
  static readonly Client: any;
4
4
  static readonly Shared: any;
5
5
  static readonly System: any;
6
- static getNativeModule<T>(nativeModule: T | undefined): T;
6
+ static getNativeModule<T>(moduleName: string, bridgeModule: T | undefined): T;
7
7
  static getNativeComponent(componentName: string): import("react-native").HostComponent<any> | (() => never);
8
8
  }
9
9
  //# sourceMappingURL=Modules.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Modules.d.ts","sourceRoot":"","sources":["../../../src/Modules.tsx"],"names":[],"mappings":"AAOA,qBAAa,OAAO;IAClB,MAAM,CAAC,QAAQ,CAAC,aAAa,SAIK;IAElC,MAAM,CAAC,QAAQ,CAAC,MAAM,MAEpB;IACF,MAAM,CAAC,QAAQ,CAAC,MAAM,MAEpB;IACF,MAAM,CAAC,QAAQ,CAAC,MAAM,MAEpB;IAEF,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC;IAazD,MAAM,CAAC,kBAAkB,CAAC,aAAa,EAAE,MAAM;CAOhD"}
1
+ {"version":3,"file":"Modules.d.ts","sourceRoot":"","sources":["../../../src/Modules.tsx"],"names":[],"mappings":"AAQA,qBAAa,OAAO;IAClB,MAAM,CAAC,QAAQ,CAAC,aAAa,SAIK;IAElC,MAAM,CAAC,QAAQ,CAAC,MAAM,MAGpB;IACF,MAAM,CAAC,QAAQ,CAAC,MAAM,MAGpB;IACF,MAAM,CAAC,QAAQ,CAAC,MAAM,MAGpB;IAEF,MAAM,CAAC,eAAe,CAAC,CAAC,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,CAAC,GAAG,SAAS,GAC1B,CAAC;IAiBJ,MAAM,CAAC,kBAAkB,CAAC,aAAa,EAAE,MAAM;CAOhD"}
@@ -38,6 +38,7 @@ export interface CourierArchivingSwipeActionStyle {
38
38
  }
39
39
  export interface CourierInboxTheme {
40
40
  brandId?: string;
41
+ backgroundColor?: string;
41
42
  tabIndicatorColor?: string;
42
43
  tabStyle?: CourierInboxTabStyle;
43
44
  readingSwipeActionStyle?: CourierReadingSwipeActionStyle;
@@ -1 +1 @@
1
- {"version":3,"file":"CourierInboxTheme.d.ts","sourceRoot":"","sources":["../../../../src/models/CourierInboxTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,MAAM,WAAW,gCAAgC;IAC/C,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,6BAA6B;IAC5C,IAAI,CAAC,EA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I,CAAC,EAAE,MAAM,CAAC;gBACd,MAAM,CAAC,EAAE,MAAM,CAAC;gBAChB,KAAK,CAAC,EAAE,MAAM,CAAC;aAChB,CAAC;YACF,cAAc,CAAC,EAAE,MAAM,CAAC;YACxB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;SACvD,CAAC;KACH,CAAC;IACF,OAAO,CAAC,EAAE;QACR,qBAAqB,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;KAC7C,CAAC;CACH"}
@@ -13,6 +13,7 @@ export type CourierPreferencesMode = {
13
13
  };
14
14
  export interface CourierPreferencesTheme {
15
15
  brandId?: string;
16
+ backgroundColor?: string;
16
17
  loadingIndicatorColor?: string;
17
18
  sectionTitleFont?: CourierFont;
18
19
  topicTitleFont?: CourierFont;
@@ -1 +1 @@
1
- {"version":3,"file":"CourierPreferencesTheme.d.ts","sourceRoot":"","sources":["../../../../src/models/CourierPreferencesTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,MAAM,yBAAyB,GACjC,gBAAgB,GAChB,OAAO,GACP,MAAM,GACN,KAAK,GACL,SAAS,CAAC;AAEd,MAAM,MAAM,sBAAsB,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,yBAAyB,EAAE,CAAA;CAAE,CAAC;AAEhE,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,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jB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,yBAAyB,EAAE,CAAA;CAAE,CAAC;AAEhE,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gBAAgB,CAAC,EAAE,WAAW,CAAC;IAC/B,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,iBAAiB,CAAC,EAAE,WAAW,CAAC;IAChC,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,GAAG,CAAC,EAAE;QACJ,eAAe,CAAC,EAAE,eAAe,CAAC;QAClC,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;QACtC,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,eAAe,CAAC,EAAE,eAAe,CAAC;KACnC,CAAC;IACF,OAAO,CAAC,EAAE;QACR,0BAA0B,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;QACjD,0BAA0B,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;QACjD,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;KAC3C,CAAC;CACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/courier-react-native",
3
- "version": "5.7.0",
3
+ "version": "5.8.0",
4
4
  "description": "Inbox, Push Notifications, and Preferences for React Native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -14,7 +14,8 @@
14
14
  "ios",
15
15
  "cpp",
16
16
  "*.podspec",
17
- "!lib/typescript/example",
17
+ "!lib/typescript/example-073",
18
+ "!lib/typescript/example-085",
18
19
  "!ios/build",
19
20
  "!android/build",
20
21
  "!android/gradle",
@@ -32,11 +33,12 @@
32
33
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
33
34
  "prepack": "bob build",
34
35
  "release": "release-it",
35
- "example": "yarn --cwd example",
36
- "build:android": "cd example/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
37
- "build:ios": "cd example/ios && xcodebuild -workspace CourierReactNativeExample.xcworkspace -scheme CourierReactNativeExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO",
36
+ "example": "yarn --cwd example-085",
37
+ "example-073": "yarn --cwd example-073",
38
+ "build:android": "cd example-085/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
39
+ "build:ios": "cd example-085/ios && xcodebuild -workspace CourierReactNativeExample.xcworkspace -scheme CourierReactNativeExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO",
38
40
  "bootstrap": "yarn example && yarn install && yarn example pods",
39
- "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build",
41
+ "clean": "del-cli android/build example-085/android/build example-085/android/app/build example-085/ios/build",
40
42
  "linkPackage": "yarn link && yarn example link @trycourier/courier-react-native && yarn example setupEnv",
41
43
  "setup": "sh setup.sh"
42
44
  },
@@ -96,7 +98,9 @@
96
98
  "jest": {
97
99
  "preset": "react-native",
98
100
  "modulePathIgnorePatterns": [
99
- "<rootDir>/example/node_modules",
101
+ "<rootDir>/example-085/node_modules",
102
+ "<rootDir>/example-073/node_modules",
103
+ "<rootDir>/example-expo-55/node_modules",
100
104
  "<rootDir>/lib/"
101
105
  ]
102
106
  },
@@ -144,7 +148,8 @@
144
148
  },
145
149
  "eslintIgnore": [
146
150
  "node_modules/",
147
- "lib/"
151
+ "lib/",
152
+ "example-expo-55/"
148
153
  ],
149
154
  "prettier": {
150
155
  "quoteProps": "consistent",
package/src/Modules.tsx CHANGED
@@ -2,6 +2,7 @@ import {
2
2
  NativeModules,
3
3
  Platform,
4
4
  UIManager,
5
+ TurboModuleRegistry,
5
6
  requireNativeComponent,
6
7
  } from 'react-native';
7
8
 
@@ -13,18 +14,28 @@ export class Modules {
13
14
  '- You are not using Expo Go\n';
14
15
 
15
16
  static readonly Client = Modules.getNativeModule(
17
+ 'CourierClientModule',
16
18
  NativeModules.CourierClientModule
17
19
  );
18
20
  static readonly Shared = Modules.getNativeModule(
21
+ 'CourierSharedModule',
19
22
  NativeModules.CourierSharedModule
20
23
  );
21
24
  static readonly System = Modules.getNativeModule(
25
+ 'CourierSystemModule',
22
26
  NativeModules.CourierSystemModule
23
27
  );
24
28
 
25
- static getNativeModule<T>(nativeModule: T | undefined): T {
26
- return nativeModule
27
- ? nativeModule
29
+ static getNativeModule<T>(
30
+ moduleName: string,
31
+ bridgeModule: T | undefined
32
+ ): T {
33
+ const resolved =
34
+ (TurboModuleRegistry?.get(moduleName) as T | null) ??
35
+ bridgeModule ??
36
+ undefined;
37
+ return resolved
38
+ ? resolved
28
39
  : (new Proxy(
29
40
  {},
30
41
  {
@@ -48,6 +48,7 @@ export interface CourierArchivingSwipeActionStyle {
48
48
 
49
49
  export interface CourierInboxTheme {
50
50
  brandId?: string;
51
+ backgroundColor?: string;
51
52
  tabIndicatorColor?: string;
52
53
  tabStyle?: CourierInboxTabStyle;
53
54
  readingSwipeActionStyle?: CourierReadingSwipeActionStyle;
@@ -18,6 +18,7 @@ export type CourierPreferencesMode =
18
18
 
19
19
  export interface CourierPreferencesTheme {
20
20
  brandId?: string;
21
+ backgroundColor?: string;
21
22
  loadingIndicatorColor?: string;
22
23
  sectionTitleFont?: CourierFont;
23
24
  topicTitleFont?: CourierFont;