Skip to content

Commit 9a1e16d

Browse files
committed
refactor: update podspec for Iterable-React-Native-SDK to support Swift and iOS SDK dependency
1 parent f7be0fa commit 9a1e16d

File tree

2 files changed

+53
-65
lines changed

2 files changed

+53
-65
lines changed

Iterable-React-Native-SDK.podspec

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
require "json"
22

33
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4-
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
54

65
Pod::Spec.new do |s|
76
s.name = "Iterable-React-Native-SDK"
@@ -14,31 +13,20 @@ Pod::Spec.new do |s|
1413
s.platforms = { :ios => min_ios_version_supported }
1514
s.source = { :git => "https://github.com/Iterable/react-native-sdk.git", :tag => "#{s.version}" }
1615

17-
s.source_files = "ios/**/*.{h,m,mm,swift}"
18-
19-
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
20-
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
21-
if respond_to?(:install_modules_dependencies, true)
22-
install_modules_dependencies(s)
23-
else
24-
s.dependency "React-Core"
25-
26-
# Don't install the dependencies when we run `pod install` in the old architecture.
27-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
28-
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
29-
s.pod_target_xcconfig = {
30-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
31-
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
32-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
33-
}
34-
s.dependency "React-Codegen"
35-
s.dependency "RCT-Folly"
36-
s.dependency "RCTRequired"
37-
s.dependency "RCTTypeSafety"
38-
s.dependency "ReactCommon/turbomodule/core"
39-
end
40-
end
16+
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
17+
s.private_header_files = "ios/**/*.h"
4118

19+
# Load Iterables iOS SDK as a dependency
4220
s.dependency "Iterable-iOS-SDK", "6.5.4"
43-
21+
22+
# Basic Swift support
23+
s.pod_target_xcconfig = {
24+
'DEFINES_MODULE' => 'YES',
25+
'CLANG_ENABLE_MODULES' => 'YES',
26+
'SWIFT_VERSION' => '5.0',
27+
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
28+
}
29+
30+
install_modules_dependencies(s)
31+
4432
end

example/ios/ReactNativeSdkExample.xcodeproj/project.pbxproj

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
00E356F31AD99517003FC87E /* ReactNativeSdkExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ReactNativeSdkExampleTests.m */; };
1111
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
1212
779227342DFA3FB500D69EC0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 779227332DFA3FB500D69EC0 /* AppDelegate.swift */; };
13+
77F63EC390061314C0718D51 /* libPods-ReactNativeSdkExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F395BEFC7809290D1773C84F /* libPods-ReactNativeSdkExample.a */; };
1314
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
1415
A3A40C20801B8F02005FA4C0 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 1FC6B09E65A7BD9F6864C5D8 /* PrivacyInfo.xcprivacy */; };
15-
A6C0695C2CEB3E991B349B28 /* libPods-ReactNativeSdkExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5750A1B5F0DE8C0CA5F46AD7 /* libPods-ReactNativeSdkExample.a */; };
1616
/* End PBXBuildFile section */
1717

1818
/* Begin PBXContainerItemProxy section */
@@ -34,14 +34,14 @@
3434
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ReactNativeSdkExample/Info.plist; sourceTree = "<group>"; };
3535
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = ReactNativeSdkExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
3636
1FC6B09E65A7BD9F6864C5D8 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = ReactNativeSdkExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
37-
489E9B1B73890306BCD7B250 /* Pods-ReactNativeSdkExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeSdkExample.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeSdkExample/Pods-ReactNativeSdkExample.release.xcconfig"; sourceTree = "<group>"; };
38-
5750A1B5F0DE8C0CA5F46AD7 /* libPods-ReactNativeSdkExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ReactNativeSdkExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
39-
67C6240790C3DAF138EB4ADB /* Pods-ReactNativeSdkExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeSdkExample.debug.xcconfig"; path = "Target Support Files/Pods-ReactNativeSdkExample/Pods-ReactNativeSdkExample.debug.xcconfig"; sourceTree = "<group>"; };
37+
627A5082522E8122626A42E9 /* Pods-ReactNativeSdkExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeSdkExample.debug.xcconfig"; path = "Target Support Files/Pods-ReactNativeSdkExample/Pods-ReactNativeSdkExample.debug.xcconfig"; sourceTree = "<group>"; };
4038
779227312DFA3FB500D69EC0 /* ReactNativeSdkExample-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ReactNativeSdkExample-Bridging-Header.h"; sourceTree = "<group>"; };
4139
779227322DFA3FB500D69EC0 /* ReactNativeSdkExampleTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ReactNativeSdkExampleTests-Bridging-Header.h"; sourceTree = "<group>"; };
4240
779227332DFA3FB500D69EC0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = ReactNativeSdkExample/AppDelegate.swift; sourceTree = "<group>"; };
4341
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = ReactNativeSdkExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
42+
C37A515B34C484F156F48110 /* Pods-ReactNativeSdkExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeSdkExample.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeSdkExample/Pods-ReactNativeSdkExample.release.xcconfig"; sourceTree = "<group>"; };
4443
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
44+
F395BEFC7809290D1773C84F /* libPods-ReactNativeSdkExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ReactNativeSdkExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4545
/* End PBXFileReference section */
4646

4747
/* Begin PBXFrameworksBuildPhase section */
@@ -56,7 +56,7 @@
5656
isa = PBXFrameworksBuildPhase;
5757
buildActionMask = 2147483647;
5858
files = (
59-
A6C0695C2CEB3E991B349B28 /* libPods-ReactNativeSdkExample.a in Frameworks */,
59+
77F63EC390061314C0718D51 /* libPods-ReactNativeSdkExample.a in Frameworks */,
6060
);
6161
runOnlyForDeploymentPostprocessing = 0;
6262
};
@@ -99,7 +99,7 @@
9999
isa = PBXGroup;
100100
children = (
101101
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
102-
5750A1B5F0DE8C0CA5F46AD7 /* libPods-ReactNativeSdkExample.a */,
102+
F395BEFC7809290D1773C84F /* libPods-ReactNativeSdkExample.a */,
103103
);
104104
name = Frameworks;
105105
sourceTree = "<group>";
@@ -138,8 +138,8 @@
138138
BBD78D7AC51CEA395F1C20DB /* Pods */ = {
139139
isa = PBXGroup;
140140
children = (
141-
67C6240790C3DAF138EB4ADB /* Pods-ReactNativeSdkExample.debug.xcconfig */,
142-
489E9B1B73890306BCD7B250 /* Pods-ReactNativeSdkExample.release.xcconfig */,
141+
627A5082522E8122626A42E9 /* Pods-ReactNativeSdkExample.debug.xcconfig */,
142+
C37A515B34C484F156F48110 /* Pods-ReactNativeSdkExample.release.xcconfig */,
143143
);
144144
path = Pods;
145145
sourceTree = "<group>";
@@ -169,13 +169,13 @@
169169
isa = PBXNativeTarget;
170170
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeSdkExample" */;
171171
buildPhases = (
172-
39F16507F41D7B65C4BB2AFA /* [CP] Check Pods Manifest.lock */,
172+
00A09C8D745F4A4962CFCB16 /* [CP] Check Pods Manifest.lock */,
173173
13B07F871A680F5B00A75B9A /* Sources */,
174174
13B07F8C1A680F5B00A75B9A /* Frameworks */,
175175
13B07F8E1A680F5B00A75B9A /* Resources */,
176176
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
177-
9BCDAF1ED4681299F154EB0B /* [CP] Embed Pods Frameworks */,
178-
577CB6D19BA58383681D2C91 /* [CP] Copy Pods Resources */,
177+
70E3A2A47E764F7A78602595 /* [CP] Embed Pods Frameworks */,
178+
EDF40E5EF2B0A60C77B1B71B /* [CP] Copy Pods Resources */,
179179
);
180180
buildRules = (
181181
);
@@ -244,23 +244,7 @@
244244
/* End PBXResourcesBuildPhase section */
245245

246246
/* Begin PBXShellScriptBuildPhase section */
247-
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
248-
isa = PBXShellScriptBuildPhase;
249-
buildActionMask = 2147483647;
250-
files = (
251-
);
252-
inputPaths = (
253-
"$(SRCROOT)/.xcode.env.local",
254-
"$(SRCROOT)/.xcode.env",
255-
);
256-
name = "Bundle React Native code and images";
257-
outputPaths = (
258-
);
259-
runOnlyForDeploymentPostprocessing = 0;
260-
shellPath = /bin/sh;
261-
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
262-
};
263-
39F16507F41D7B65C4BB2AFA /* [CP] Check Pods Manifest.lock */ = {
247+
00A09C8D745F4A4962CFCB16 /* [CP] Check Pods Manifest.lock */ = {
264248
isa = PBXShellScriptBuildPhase;
265249
buildActionMask = 2147483647;
266250
files = (
@@ -282,24 +266,23 @@
282266
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
283267
showEnvVarsInLog = 0;
284268
};
285-
577CB6D19BA58383681D2C91 /* [CP] Copy Pods Resources */ = {
269+
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
286270
isa = PBXShellScriptBuildPhase;
287271
buildActionMask = 2147483647;
288272
files = (
289273
);
290-
inputFileListPaths = (
291-
"${PODS_ROOT}/Target Support Files/Pods-ReactNativeSdkExample/Pods-ReactNativeSdkExample-resources-${CONFIGURATION}-input-files.xcfilelist",
274+
inputPaths = (
275+
"$(SRCROOT)/.xcode.env.local",
276+
"$(SRCROOT)/.xcode.env",
292277
);
293-
name = "[CP] Copy Pods Resources";
294-
outputFileListPaths = (
295-
"${PODS_ROOT}/Target Support Files/Pods-ReactNativeSdkExample/Pods-ReactNativeSdkExample-resources-${CONFIGURATION}-output-files.xcfilelist",
278+
name = "Bundle React Native code and images";
279+
outputPaths = (
296280
);
297281
runOnlyForDeploymentPostprocessing = 0;
298282
shellPath = /bin/sh;
299-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeSdkExample/Pods-ReactNativeSdkExample-resources.sh\"\n";
300-
showEnvVarsInLog = 0;
283+
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
301284
};
302-
9BCDAF1ED4681299F154EB0B /* [CP] Embed Pods Frameworks */ = {
285+
70E3A2A47E764F7A78602595 /* [CP] Embed Pods Frameworks */ = {
303286
isa = PBXShellScriptBuildPhase;
304287
buildActionMask = 2147483647;
305288
files = (
@@ -316,6 +299,23 @@
316299
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeSdkExample/Pods-ReactNativeSdkExample-frameworks.sh\"\n";
317300
showEnvVarsInLog = 0;
318301
};
302+
EDF40E5EF2B0A60C77B1B71B /* [CP] Copy Pods Resources */ = {
303+
isa = PBXShellScriptBuildPhase;
304+
buildActionMask = 2147483647;
305+
files = (
306+
);
307+
inputFileListPaths = (
308+
"${PODS_ROOT}/Target Support Files/Pods-ReactNativeSdkExample/Pods-ReactNativeSdkExample-resources-${CONFIGURATION}-input-files.xcfilelist",
309+
);
310+
name = "[CP] Copy Pods Resources";
311+
outputFileListPaths = (
312+
"${PODS_ROOT}/Target Support Files/Pods-ReactNativeSdkExample/Pods-ReactNativeSdkExample-resources-${CONFIGURATION}-output-files.xcfilelist",
313+
);
314+
runOnlyForDeploymentPostprocessing = 0;
315+
shellPath = /bin/sh;
316+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ReactNativeSdkExample/Pods-ReactNativeSdkExample-resources.sh\"\n";
317+
showEnvVarsInLog = 0;
318+
};
319319
/* End PBXShellScriptBuildPhase section */
320320

321321
/* Begin PBXSourcesBuildPhase section */
@@ -406,7 +406,7 @@
406406
};
407407
13B07F941A680F5B00A75B9A /* Debug */ = {
408408
isa = XCBuildConfiguration;
409-
baseConfigurationReference = 67C6240790C3DAF138EB4ADB /* Pods-ReactNativeSdkExample.debug.xcconfig */;
409+
baseConfigurationReference = 627A5082522E8122626A42E9 /* Pods-ReactNativeSdkExample.debug.xcconfig */;
410410
buildSettings = {
411411
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
412412
CLANG_ENABLE_MODULES = YES;
@@ -436,7 +436,7 @@
436436
};
437437
13B07F951A680F5B00A75B9A /* Release */ = {
438438
isa = XCBuildConfiguration;
439-
baseConfigurationReference = 489E9B1B73890306BCD7B250 /* Pods-ReactNativeSdkExample.release.xcconfig */;
439+
baseConfigurationReference = C37A515B34C484F156F48110 /* Pods-ReactNativeSdkExample.release.xcconfig */;
440440
buildSettings = {
441441
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
442442
CLANG_ENABLE_MODULES = YES;

0 commit comments

Comments
 (0)