mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
* Update package.json * Update AppDelegate.mm * Update Podfile * Update .gitignore * Update link-inat-model-files.sh * Add plist file to project * Update project.pbxproj * Add analytics package * Update project.pbxproj * Update PrivacyInfo.xcprivacy * Basic screen tracking * Basic button press logging to firebase * Update package-lock.json * Update Podfile.lock * Add Android setup * Update .gitignore * Add analytics mock * Ignore rubocop warning here * Create GoogleService-Info.example.plist * Create google-services.example.json * Add instructions to set up Firebase configs * Update e2e_ios.yml * Update e2e_android.yml * Better plural * Use specific XCode version in e2e CI * Update GoogleService-Info.example.plist * Revert "Update GoogleService-Info.example.plist" This reverts commit0bc0ed4862. * We need an actual real app id or we get a crash during app start * My bad, we do need both files for building * Also set API key * Add comments * Add comment * Update Podfile.lock * Revert "Use specific XCode version in e2e CI" This reverts commitcbd63d1b5d.
110 lines
3.4 KiB
Ruby
110 lines
3.4 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
# setup instructions from https://www.npmjs.com/package/react-native-permissions
|
|
def node_require( script )
|
|
# Resolve script with node to allow for hoisting
|
|
require Pod::Executable.execute_command(
|
|
"node",
|
|
[
|
|
"-p", "require.resolve('#{script}', {paths: [process.argv[1]]})",
|
|
__dir__
|
|
]
|
|
).strip
|
|
end
|
|
|
|
node_require( "react-native/scripts/react_native_pods.rb" )
|
|
node_require( "react-native-permissions/scripts/setup.rb" )
|
|
|
|
platform :ios, min_ios_version_supported
|
|
prepare_react_native_project!
|
|
|
|
# ⬇️ uncomment wanted permissions
|
|
setup_permissions(
|
|
[
|
|
# 'AppTrackingTransparency',
|
|
# 'BluetoothPeripheral',
|
|
# 'Calendars',
|
|
"Camera",
|
|
# 'Contacts',
|
|
# 'FaceID',
|
|
"LocationAccuracy",
|
|
# "LocationAlways",
|
|
"LocationWhenInUse",
|
|
"MediaLibrary",
|
|
"Microphone",
|
|
# 'Motion',
|
|
# 'Notifications',
|
|
"PhotoLibraryAddOnly",
|
|
"PhotoLibrary"
|
|
# 'Reminders',
|
|
# 'Siri',
|
|
# 'SpeechRecognition',
|
|
# 'StoreKit',
|
|
]
|
|
)
|
|
|
|
use_frameworks! linkage: :static
|
|
# rubocop:disable Style/GlobalVars
|
|
# Required for react-native-firebase: https://rnfirebase.io/#configure-firebase-with-ios-credentials-react-native--077
|
|
$RNFirebaseAsStaticFramework = true
|
|
# rubocop:enable Style/GlobalVars
|
|
|
|
target "iNaturalistReactNative" do
|
|
config = use_native_modules!
|
|
|
|
use_react_native!(
|
|
path: config[:reactNativePath],
|
|
# An absolute path to your application root.
|
|
app_path: "#{Pod::Config.instance.installation_root}/.."
|
|
)
|
|
|
|
pod "react-native-config", path: "../node_modules/react-native-config"
|
|
|
|
envfiles = {
|
|
"Debug" => "$(PODS_ROOT)/../../.env.staging",
|
|
"Release" => "$(PODS_ROOT)/../../.env"
|
|
}.freeze
|
|
|
|
post_install do | installer |
|
|
# use different .env files for staging and production
|
|
# https://github.com/luggit/react-native-config#ios-1
|
|
installer.pods_project.targets.each do | target |
|
|
target.build_configurations.each do | build_config |
|
|
if target.name == "react-native-config"
|
|
build_config.build_settings["ENVFILE"] = envfiles[build_config.name]
|
|
end
|
|
end
|
|
end
|
|
|
|
# code below appears to be necessary for building pods with XCode 14: https://github.com/facebook/react-native/issues/34673#issuecomment-1252114414
|
|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
|
|
react_native_post_install(
|
|
installer,
|
|
config[:reactNativePath],
|
|
mac_catalyst_enabled: false
|
|
# :ccache_enabled => true
|
|
)
|
|
# https://github.com/Agontuk/react-native-geolocation-service/issues/287#issuecomment-980772489
|
|
installer.pods_project.targets.each do | target |
|
|
target.build_configurations.each do | build_config |
|
|
build_config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
|
|
build_config.build_settings["APPLICATION_EXTENSION_API_ONLY"] = "NO"
|
|
build_config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "$(inherited)"
|
|
end
|
|
end
|
|
|
|
# react_native_post_install(installer)
|
|
`sed -i -e $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
|
|
end
|
|
end
|
|
|
|
target "iNaturalistReactNative-ShareExtension" do
|
|
use_react_native!(
|
|
# to enable hermes on iOS, change `false` to `true` and then install pods
|
|
hermes_enabled: true
|
|
)
|
|
|
|
pod "RNShareMenu", path: "../node_modules/react-native-share-menu"
|
|
# Manually link packages here to keep your extension bundle size minimal
|
|
end
|