Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit ecce14c

Browse files
bsneedBrandon Sneedprayansh
authored
fix(ios): fixes for building for newer rn (segmentio#206)
* fix(ios): fixes for building for newer rn * fix(ci): allow lockfile to be updated * fix(ci): removed another yarn lock * fix(ci): removed yet another lockfile freeze * update lockfile & add frozen-lockfile back to CI * update node Co-authored-by: Brandon Sneed <[email protected]> Co-authored-by: Prayansh Srivastava <[email protected]>
1 parent c71a6cf commit ecce14c

File tree

18 files changed

+2038
-714
lines changed

18 files changed

+2038
-714
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defaults:
1010
nodeJob: &nodeJob
1111
<<: *job
1212
docker:
13-
- image: circleci/node:8
13+
- image: circleci/node:12.18
1414

1515
version: 2
1616
jobs:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"npm-run-all": "^4.1.3",
7171
"prettier": "^1.14.2",
7272
"react": "16.8.3",
73-
"react-native": "0.59.2",
73+
"react-native": "0.62.2",
7474
"rimraf": "^2.6.2"
7575
}
7676
}

packages/core/RNAnalytics.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Pod::Spec.new do |s|
1616
s.author = { 'Segment' => '[email protected]' }
1717
s.source = { :git => 'https://github.com/segmentio/analytics-react-native.git', :tag => s.version.to_s }
1818

19-
s.platform = :ios, '10.0'
19+
s.platform = :ios, '11.0'
2020
s.source_files = 'ios/**/*.{m,h}'
2121
s.static_framework = true
2222

23-
s.dependency 'Analytics'
23+
s.dependency 'Analytics', '~> 4.0.4'
2424
s.dependency 'React'
2525
end
2626

packages/integrations/applyPatches.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,13 @@ cp "./patches/@segment/analytics-react-native-appsflyer/ios/main.m" "./build/@se
3434
# applied to the Android file, IntegrationModule.kt
3535

3636
cp "./patches/@segment/analytics-react-native-adjust/android/src/main/java/com/segment/analytics/reactnative/integration/adjust/IntegrationModule.kt" "./build/@segment/analytics-react-native-adjust/android/src/main/java/com/segment/analytics/reactnative/integration/adjust/IntegrationModule.kt"
37+
38+
### Facebook App Events patch
39+
#
40+
# Q: Why?
41+
#
42+
# A: RN 0.62 changes how imports end up getting spit out and opts for static lib pods, which
43+
# Xcode then uses the directory name for rather than the module name, and thus it breaks. :(
44+
45+
cp "./patches/@segment/analytics-react-native-facebook-app-events-ios/ios/main.m" "./build/@segment/analytics-react-native-facebook-app-events-ios/ios/main.m"
46+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// main.m
3+
// RNAnalyticsIntegration
4+
//
5+
// Created by fathy on 05/08/2018.
6+
// Copyright © 2020 Segment.io, Inc. All rights reserved.
7+
//
8+
9+
#import <React/RCTBridgeModule.h>
10+
#import <RNAnalytics/RNAnalytics.h>
11+
#if defined(__has_include) && __has_include(<Segment_FacebookAppEvents/SEGFacebookAppEventsIntegrationFactory.h>)
12+
#import <Segment_FacebookAppEvents/SEGFacebookAppEventsIntegrationFactory.h>
13+
#elif defined(__has_include) && __has_include(<Segment-Facebook-App-Events/SEGFacebookAppEventsIntegrationFactory.h>)
14+
#import <Segment-Facebook-App-Events/SEGFacebookAppEventsIntegrationFactory.h>
15+
#else
16+
#import <Segment-FacebookAppEvents/SEGFacebookAppEventsIntegrationFactory.h>
17+
#endif
18+
19+
@interface RNAnalyticsIntegration_Facebook_App_Events: NSObject<RCTBridgeModule>
20+
@end
21+
22+
@implementation RNAnalyticsIntegration_Facebook_App_Events
23+
24+
RCT_EXPORT_MODULE()
25+
26+
RCT_EXPORT_METHOD(setup) {
27+
[RNAnalytics addIntegration:SEGFacebookAppEventsIntegrationFactory.instance];
28+
}
29+
30+
@end

packages/integrations/template/Pod.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
1818
s.source = { :git => "https://github.com/segmentio/analytics-react-native.git", :tag => s.version.to_s }
1919
s.social_media_url = 'https://twitter.com/segment'
2020

21-
s.platform = :ios, "9.0"
21+
s.platform = :ios, "11.0"
2222
s.source_files = 'ios/main.m'
2323
s.static_framework = true
2424

packages/test-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
"binaryPath": "project/ios/build/Build/Products/Release-iphonesimulator/TestApp.app",
3434
"build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -project project/ios/TestApp.xcodeproj -scheme TestApp -configuration Release -sdk iphonesimulator -derivedDataPath project/ios/build -quiet -UseModernBuildSystem=NO",
3535
"type": "ios.simulator",
36-
"name": "iPhone X"
36+
"name": "iPhone 8"
3737
},
3838
"ios-cocoapods": {
3939
"binaryPath": "project/ios/build/Build/Products/Release-iphonesimulator/TestApp.app",
4040
"build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace project/ios/TestApp.xcworkspace -scheme TestApp -configuration Release -sdk iphonesimulator -derivedDataPath project/ios/build -quiet -UseModernBuildSystem=NO",
4141
"type": "ios.simulator",
42-
"name": "iPhone X"
42+
"name": "iPhone 8"
4343
},
4444
"android": {
4545
"binaryPath": "project/android/app/build/outputs/apk/debug/app-debug.apk",

packages/test-app/patches/Podfile

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,65 @@
11
# Uncomment the next line to define a global platform for your project
2-
# platform :ios, '9.0'
2+
platform :ios, '11.0'
33

44
target 'TestApp' do
55
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
66
# use_frameworks!
77

88
# Pods for TestApp
9-
9+
pod 'Analytics', '~> 4.0.4'
10+
pod 'RNAnalytics', :path => "../node_modules/@segment/analytics-react-native"
11+
12+
# Device Mode Integrations (iOS only of course)
13+
pod 'RNAnalyticsIntegration-Adjust', :path => "../node_modules/@segment/analytics-react-native-adjust"
14+
pod 'RNAnalyticsIntegration-Amplitude', :path => "../node_modules/@segment/analytics-react-native-amplitude"
15+
pod 'RNAnalyticsIntegration-Appboy', :path => "../node_modules/@segment/analytics-react-native-appboy"
16+
pod 'RNAnalyticsIntegration-AppsFlyer', :path => "../node_modules/@segment/analytics-react-native-appsflyer"
17+
pod 'RNAnalyticsIntegration-Branch', :path => "../node_modules/@segment/analytics-react-native-branch"
18+
pod 'RNAnalyticsIntegration-Bugsnag', :path => "../node_modules/@segment/analytics-react-native-bugsnag"
19+
pod 'RNAnalyticsIntegration-CleverTap', :path => "../node_modules/@segment/analytics-react-native-clevertap"
20+
pod 'RNAnalyticsIntegration-ComScore', :path => "../node_modules/@segment/analytics-react-native-comscore-ios"
21+
pod 'RNAnalyticsIntegration-Countly', :path => "../node_modules/@segment/analytics-react-native-countly"
22+
pod 'RNAnalyticsIntegration-Crittercism', :path => "../node_modules/@segment/analytics-react-native-crittercism"
23+
pod 'RNAnalyticsIntegration-Facebook-App-Events', :path => "../node_modules/@segment/analytics-react-native-facebook-app-events-ios"
24+
pod 'RNAnalyticsIntegration-Firebase', :path => "../node_modules/@segment/analytics-react-native-firebase"
25+
pod 'RNAnalyticsIntegration-Flurry', :path => "../node_modules/@segment/analytics-react-native-flurry"
26+
pod 'RNAnalyticsIntegration-Google-Analytics', :path => "../node_modules/@segment/analytics-react-native-google-analytics"
27+
pod 'RNAnalyticsIntegration-Intercom', :path => "../node_modules/@segment/analytics-react-native-intercom"
28+
pod 'RNAnalyticsIntegration-Localytics', :path => "../node_modules/@segment/analytics-react-native-localytics"
29+
pod 'RNAnalyticsIntegration-Mixpanel', :path => "../node_modules/@segment/analytics-react-native-mixpanel"
30+
pod 'RNAnalyticsIntegration-Taplytics', :path => "../node_modules/@segment/analytics-react-native-taplytics-ios"
31+
1032
# Your 'node_modules' directory is probably in the root of your project,
1133
# but if not, adjust the `:path` accordingly
12-
pod 'React', :path => '../node_modules/react-native', :subspecs => [
13-
'Core',
14-
'CxxBridge', # Include this for RN >= 0.47
15-
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
16-
'RCTText',
17-
'RCTNetwork',
18-
'RCTWebSocket', # Needed for debugging
19-
'RCTAnimation', # Needed for FlatList and animations running on native UI thread
20-
# Add any other subspecs you want to use in your project
21-
]
22-
# Explicitly include Yoga if you are using RN >= 0.42.0
23-
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
34+
35+
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
36+
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
37+
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
38+
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
39+
pod 'React', :path => '../node_modules/react-native/'
40+
pod 'React-Core', :path => '../node_modules/react-native/'
41+
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
42+
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
43+
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
44+
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
45+
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
46+
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
47+
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
48+
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
49+
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
50+
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
51+
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
52+
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
53+
54+
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
55+
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
56+
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
57+
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
58+
pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
59+
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
60+
61+
# Explicitly include Yoga if you are using RN >= 0.42.0
62+
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
2463

2564
# Third party deps podspec link
2665
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'

0 commit comments

Comments
 (0)