react-native-netmera 2.1.2 → 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 +35 -0
- package/RNNetmera.podspec +26 -8
- package/package.json +1 -1
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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.
|