Commit 3e30c371 authored by Lê Hoàng Dương's avatar Lê Hoàng Dương

.

parent f5580a97
require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
pod 'RNPermissions', :path => '../node_modules/react-native-permissions' pod 'RNPermissions', :path => '../node_modules/react-native-permissions'
def node_require(script) # Resolve react_native_pods.rb with node to allow for hoisting
# Resolve script with node to allow for hoisting require Pod::Executable.execute_command('node', ['-p',
require Pod::Executable.execute_command('node', ['-p', 'require.resolve(
"require.resolve( "react-native/scripts/react_native_pods.rb",
'#{script}',
{paths: [process.argv[1]]}, {paths: [process.argv[1]]},
)", __dir__]).strip )', __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 platform :ios, min_ios_version_supported
prepare_react_native_project! prepare_react_native_project!
setup_permissions([ # flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
# 'AppTrackingTransparency',
# 'Bluetooth',
# 'Calendars',
# 'CalendarsWriteOnly',
# 'Camera',
# 'Contacts',
# 'FaceID',
'LocationAccuracy',
'LocationAlways',
'LocationWhenInUse',
# 'MediaLibrary',
# 'Microphone',
# 'Motion',
# 'Notifications',
# 'PhotoLibrary',
# 'PhotoLibraryAddOnly',
# 'Reminders',
# 'Siri',
# 'SpeechRecognition',
# 'StoreKit',
])
linkage = ENV['USE_FRAMEWORKS'] linkage = ENV['USE_FRAMEWORKS']
if linkage != nil if linkage != nil
...@@ -49,22 +24,14 @@ end ...@@ -49,22 +24,14 @@ end
target 'anawork_mobile' do target 'anawork_mobile' do
config = use_native_modules! config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags() flags = get_default_flags()
use_react_native!( use_react_native!(
:path => config[:reactNativePath], :path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false. # An absolute path to your application root.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => flags[:hermes_enabled], :hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled], :fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
# :flipper_configuration => flipper_config, # :flipper_configuration => flipper_config,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.." :app_path => "#{Pod::Config.instance.installation_root}/.."
) )
...@@ -74,13 +41,13 @@ target 'anawork_mobile' do ...@@ -74,13 +41,13 @@ target 'anawork_mobile' do
end end
post_install do |installer| post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install( react_native_post_install(
installer, installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches config[:reactNativePath],
# necessary for Mac Catalyst builds :mac_catalyst_enabled => false,
:mac_catalyst_enabled => false # :ccache_enabled => true
) )
# __apply_Xcode_12_5_M1_post_install_workaround(installer)
end end
end end
...@@ -90,4 +57,3 @@ def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path) ...@@ -90,4 +57,3 @@ def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
puts "Stripping bitcode: #{command}" puts "Stripping bitcode: #{command}"
system(command) system(command)
end end
...@@ -1647,7 +1647,7 @@ PODS: ...@@ -1647,7 +1647,7 @@ PODS:
- ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core - ReactCommon/turbomodule/core
- Yoga - Yoga
- RNPermissions (5.2.6): - RNPermissions (5.3.0):
- React-Core - React-Core
- RNReanimated (3.17.1): - RNReanimated (3.17.1):
- DoubleConversion - DoubleConversion
...@@ -2140,7 +2140,7 @@ SPEC CHECKSUMS: ...@@ -2140,7 +2140,7 @@ SPEC CHECKSUMS:
RNDateTimePicker: 29264364ea7b8cc0fb355b3843cf276a4ff78966 RNDateTimePicker: 29264364ea7b8cc0fb355b3843cf276a4ff78966
RNFastImage: 462a183c4b0b6b26fdfd639e1ed6ba37536c3b87 RNFastImage: 462a183c4b0b6b26fdfd639e1ed6ba37536c3b87
RNGestureHandler: fc491c834d09b0538618a3f328ab75fe8f90f5b4 RNGestureHandler: fc491c834d09b0538618a3f328ab75fe8f90f5b4
RNPermissions: c5077df5505247042c113d42b17f96b047f41441 RNPermissions: 5017380d9fe1f63f0d1403139bc8d630fe0b7a19
RNReanimated: 109749f3d76b07f13b0b4dec7f0d7d768032393f RNReanimated: 109749f3d76b07f13b0b4dec7f0d7d768032393f
RNScreens: 631b8768411a16e356f7934058d2139d0cc75157 RNScreens: 631b8768411a16e356f7934058d2139d0cc75157
RNSVG: 7d403633772d39f695b8a1ccb64db8499e807dac RNSVG: 7d403633772d39f695b8a1ccb64db8499e807dac
...@@ -2149,6 +2149,6 @@ SPEC CHECKSUMS: ...@@ -2149,6 +2149,6 @@ SPEC CHECKSUMS:
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
Yoga: 4ef80d96a5534f0e01b3055f17d1e19a9fc61b63 Yoga: 4ef80d96a5534f0e01b3055f17d1e19a9fc61b63
PODFILE CHECKSUM: d0348f0af80e441951e4160be2e7b02572b91a0b PODFILE CHECKSUM: 313d38a7780c27dcf25e928fcbd0a903a53a37cc
COCOAPODS: 1.16.2 COCOAPODS: 1.16.2
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
<dict> <dict>
<key>NSAllowsArbitraryLoads</key> <key>NSAllowsArbitraryLoads</key>
<false/> <true/>
<key>NSAllowsLocalNetworking</key> <key>NSAllowsLocalNetworking</key>
<true/> <true/>
</dict> </dict>
......
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); const path = require("path");
const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");
const defaultConfig = getDefaultConfig(__dirname); const defaultConfig = getDefaultConfig(__dirname);
const {assetExts, sourceExts} = defaultConfig.resolver; const { resolver: { sourceExts, assetExts } } = defaultConfig;
/** /**
* Metro configuration * Metro configuration
* https://reactnative.dev/docs/metro * https://facebook.github.io/metro/docs/configuration
* *
* @type {import('metro-config').MetroConfig} * @type {import('metro-config').MetroConfig}
*/ */
const config = { const config = {
transformer: { transformer: {
babelTransformerPath: require.resolve( babelTransformerPath: require.resolve("react-native-svg-transformer"),
'react-native-svg-transformer/react-native',
),
}, },
resolver: { resolver: {
assetExts: assetExts.filter(ext => ext !== 'svg'), assetExts: assetExts.filter((ext) => ext !== "svg"),
sourceExts: [...sourceExts, 'svg'], sourceExts: [...sourceExts, "svg"],
// resolverMainFields: ["sbmodern", "react-native", "browser", "main"],
}, },
watchFolders: [path.resolve(__dirname, "../")],
}; };
module.exports = mergeConfig(defaultConfig, config); module.exports = mergeConfig(defaultConfig, config);
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment