react-native-netmera 2.1.2 → 2.2.0-alpha03

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
@@ -19,16 +19,35 @@ NETMERA is a Mobile Application Engagement Platform. We offer a series of develo
19
19
  s.source_files = "ios/**/*.{h,m,mm,swift}"
20
20
  s.public_header_files = "ios/RNNetmera.h"
21
21
 
22
- netmera_version = '4.23.1'
23
-
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
22
+ netmera_version = '4.23.2'
23
+
24
+ netmera_spm_git_url = 'https://github.com/Netmera/swift-sdk.git'
25
+ netmera_products = %w[
26
+ NetmeraAnalytic
27
+ NetmeraAnalyticAutotracking
28
+ NetmeraLiveActivity
29
+ NetmeraNotification
30
+ NetmeraAdvertisingId
31
+ NetmeraLocation
32
+ NetmeraGeofence
33
+ NetmeraNotificationInbox
34
+ ]
35
+
36
+ # Resolve the native Netmera SDK via CocoaPods by default. Set NETMERA_USE_SPM=1 to opt into
37
+ # resolving it via Swift Package Manager instead (requires React Native >= 0.75, where the
38
+ # `spm_dependency` podspec helper is available, and a Podfile using dynamic use_frameworks!).
39
+ use_spm = ENV['NETMERA_USE_SPM'] == '1'
40
+
41
+ if use_spm && respond_to?(:spm_dependency, true)
42
+ Pod::UI.puts "[RNNetmera] NETMERA_USE_SPM=1 — resolving Netmera SDK #{netmera_version} via Swift Package Manager."
43
+ spm_dependency(s,
44
+ url: netmera_spm_git_url,
45
+ requirement: { kind: 'exactVersion', version: netmera_version },
46
+ products: netmera_products)
47
+ else
48
+ 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
49
+ netmera_products.each { |product| s.dependency product, netmera_version }
50
+ end
32
51
 
33
52
  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
34
53
  # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-netmera",
3
- "version": "2.1.2",
3
+ "version": "2.2.0-alpha03",
4
4
  "description": "Netmera React Native SDK",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./lib/module/index.js",