react-native-netmera 2.1.1-beta01 → 2.2.0-alpha02

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/README.md CHANGED
@@ -113,6 +113,41 @@ end
113
113
  $ pod install
114
114
  ```
115
115
 
116
+ #### Optional: Resolve the Netmera native SDK via Swift Package Manager
117
+
118
+ By default, RNNetmera resolves the underlying native Netmera iOS SDK via CocoaPods. If you'd
119
+ rather have it resolved via Swift Package Manager instead (e.g. to reduce CocoaPods dependency
120
+ graph friction), you can opt in — this requires **React Native >= 0.75**.
121
+
122
+ 1. Make sure your Podfile uses dynamic frameworks (required for SPM packages to link correctly
123
+ into a CocoaPods-integrated app):
124
+
125
+ ```ruby
126
+ use_frameworks! # or: use_frameworks! :linkage => :dynamic
127
+ ```
128
+
129
+ `use_frameworks! :linkage => :static` is **not supported** in SPM mode (this also means SPM
130
+ mode is not compatible with libraries that require static linkage, such as
131
+ `@react-native-firebase`'s documented CocoaPods setup).
132
+
133
+ 2. Run pod install with the opt-in flag:
134
+
135
+ ```
136
+ $ NETMERA_USE_SPM=1 pod install
137
+ ```
138
+
139
+ 3. That's it — no other Podfile changes are required as long as your Podfile's `post_install`
140
+ block already calls `react_native_post_install(...)` (included by default in every
141
+ RN-CLI-generated Podfile).
142
+
143
+ Notes:
144
+ - If you're on Xcode 15 or earlier, close and reopen your `.xcworkspace` after `pod install` so
145
+ Xcode picks up the newly added Swift Package references.
146
+ - The Media Push extension pods (`NetmeraNotificationServiceExtension`,
147
+ `NetmeraNotificationContentExtension`, see step 6 below) are **not** affected by this setting
148
+ and should still be added to your Podfile as CocoaPods pods regardless.
149
+ - To go back to CocoaPods resolution, unset `NETMERA_USE_SPM` and re-run `pod install`.
150
+
116
151
  3. Enable push notifications for your project
117
152
  1. If you have not generated a valid push notification certificate yet,
118
153
  generate one and then export by following the steps explained in [Configuring Push Notifications section of App Distribution Guide](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/establishing_a_certificate-based_connection_to_apns#2947597)
package/RNNetmera.podspec CHANGED
@@ -20,15 +20,33 @@ NETMERA is a Mobile Application Engagement Platform. We offer a series of develo
20
20
  s.public_header_files = "ios/RNNetmera.h"
21
21
 
22
22
  netmera_version = '4.23.1'
23
+ netmera_spm_git_url = 'https://github.com/Netmera/swift-sdk.git'
24
+ netmera_products = %w[
25
+ NetmeraAnalytic
26
+ NetmeraAnalyticAutotracking
27
+ NetmeraLiveActivity
28
+ NetmeraNotification
29
+ NetmeraAdvertisingId
30
+ NetmeraLocation
31
+ NetmeraGeofence
32
+ NetmeraNotificationInbox
33
+ ]
23
34
 
24
- s.dependency "NetmeraAnalytic", netmera_version
25
- s.dependency "NetmeraAnalyticAutotracking", netmera_version
26
- s.dependency "NetmeraLiveActivity", netmera_version
27
- s.dependency "NetmeraNotification", netmera_version
28
- s.dependency "NetmeraAdvertisingId", netmera_version
29
- s.dependency "NetmeraLocation", netmera_version
30
- s.dependency "NetmeraGeofence", netmera_version
31
- s.dependency "NetmeraNotificationInbox", netmera_version
35
+ # Resolve the native Netmera SDK via CocoaPods by default. Set NETMERA_USE_SPM=1 to opt into
36
+ # resolving it via Swift Package Manager instead (requires React Native >= 0.75, where the
37
+ # `spm_dependency` podspec helper is available, and a Podfile using dynamic use_frameworks!).
38
+ use_spm = ENV['NETMERA_USE_SPM'] == '1'
39
+
40
+ if use_spm && respond_to?(:spm_dependency, true)
41
+ Pod::UI.puts "[RNNetmera] NETMERA_USE_SPM=1 — resolving Netmera SDK #{netmera_version} via Swift Package Manager."
42
+ spm_dependency(s,
43
+ url: netmera_spm_git_url,
44
+ requirement: { kind: 'exactVersion', version: netmera_version },
45
+ products: netmera_products)
46
+ else
47
+ Pod::UI.warn "[RNNetmera] NETMERA_USE_SPM=1 was set, but spm_dependency is unavailable (requires React Native >= 0.75) — falling back to CocoaPods." if use_spm
48
+ netmera_products.each { |product| s.dependency product, netmera_version }
49
+ end
32
50
 
33
51
  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
34
52
  # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
@@ -21,7 +21,7 @@ object RNNetmera {
21
21
  private fun setNetmeraHeaders() {
22
22
  val headerValues = ContentValues().apply {
23
23
  put("X-netmera-framework", "react")
24
- put("X-netmera-frameworkV", "2.1.0")
24
+ put("X-netmera-frameworkV", "2.1.2")
25
25
  }
26
26
  Netmera.setNetmeraHeaders(headerValues)
27
27
  }
@@ -100,7 +100,7 @@ public class RNNetmera: NSObject {
100
100
  private static func setNetmeraHeaders() {
101
101
  Netmera.setAdditionalRequestHeaders([
102
102
  "X-netmera-framework": "react",
103
- "X-netmera-frameworkV": "2.1.0"
103
+ "X-netmera-frameworkV": "2.1.2"
104
104
  ])
105
105
  }
106
106
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-netmera",
3
- "version": "2.1.1-beta01",
3
+ "version": "2.2.0-alpha02",
4
4
  "description": "Netmera React Native SDK",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/module/index.js",