Skip to content

Commit 16cd5c9

Browse files
committed
1 parent 66c4d8a commit 16cd5c9

File tree

7 files changed

+232
-345
lines changed

7 files changed

+232
-345
lines changed

ios/Campus.xcodeproj/project.pbxproj

Lines changed: 175 additions & 179 deletions
Large diffs are not rendered by default.

ios/Campus/AppDelegate.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

ios/Campus/AppDelegate.m

Lines changed: 0 additions & 103 deletions
This file was deleted.

ios/Campus/AppDelegate.swift

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import UIKit
2+
import React
3+
import React_RCTAppDelegate
4+
import ReactAppDependencyProvider
5+
6+
@main
7+
class AppDelegate: UIResponder, UIApplicationDelegate {
8+
var window: UIWindow?
9+
10+
var reactNativeDelegate: ReactNativeDelegate?
11+
var reactNativeFactory: RCTReactNativeFactory?
12+
13+
func application(
14+
_ application: UIApplication,
15+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
16+
) -> Bool {
17+
let delegate = ReactNativeDelegate()
18+
let factory = RCTReactNativeFactory(delegate: delegate)
19+
delegate.dependencyProvider = RCTAppDependencyProvider()
20+
21+
reactNativeDelegate = delegate
22+
reactNativeFactory = factory
23+
24+
window = UIWindow(frame: UIScreen.main.bounds)
25+
26+
factory.startReactNative(
27+
withModuleName: "Campus",
28+
in: window,
29+
launchOptions: launchOptions
30+
)
31+
32+
return true
33+
}
34+
}
35+
36+
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
37+
override func sourceURL(for bridge: RCTBridge) -> URL? {
38+
self.bundleURL()
39+
}
40+
41+
override func bundleURL() -> URL? {
42+
#if DEBUG
43+
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
44+
#else
45+
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
46+
#endif
47+
}
48+
}

ios/Campus/Info.plist

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,11 @@
4141
<true />
4242
<key>NSAppTransportSecurity</key>
4343
<dict>
44+
<!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
4445
<key>NSAllowsArbitraryLoads</key>
45-
<true />
46-
<key>NSExceptionDomains</key>
47-
<dict>
48-
<key>localhost</key>
49-
<dict>
50-
<key>NSExceptionAllowsInsecureHTTPLoads</key>
51-
<true />
52-
</dict>
53-
</dict>
46+
<false/>
47+
<key>NSAllowsLocalNetworking</key>
48+
<true/>
5449
</dict>
5550
<key>UIAppFonts</key>
5651
<array>
@@ -60,7 +55,7 @@
6055
<string>Launch Screen</string>
6156
<key>UIRequiredDeviceCapabilities</key>
6257
<array>
63-
<string>armv7</string>
58+
<string>arm64</string>
6459
</array>
6560
<key>UIRequiresFullScreen</key>
6661
<true />

ios/Campus/PrivacyInfo.xcprivacy

Whitespace-only changes.

ios/Podfile

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,63 +8,28 @@ require Pod::Executable.execute_command('node', ['-p',
88
platform :ios, min_ios_version_supported
99
prepare_react_native_project!
1010

11-
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
12-
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
13-
#
14-
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
15-
# ```js
16-
# module.exports = {
17-
# dependencies: {
18-
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
19-
# ```
20-
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
21-
2211
linkage = ENV['USE_FRAMEWORKS']
2312
if linkage != nil
2413
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
2514
use_frameworks! :linkage => linkage.to_sym
2615
end
2716

28-
target 'Campus' do
17+
target 'campus' do
2918
config = use_native_modules!
3019

31-
# Flags change depending on the env values.
32-
flags = get_default_flags()
33-
3420
use_react_native!(
3521
:path => config[:reactNativePath],
36-
# Hermes is now enabled by default. Disable by setting this flag to false.
37-
:hermes_enabled => flags[:hermes_enabled],
38-
:fabric_enabled => flags[:fabric_enabled],
39-
# Enables Flipper.
40-
#
41-
# Note that if you have use_frameworks! enabled, Flipper will not work and
42-
# you should disable the next line.
43-
:flipper_configuration => flipper_config,
4422
# An absolute path to your application root.
4523
:app_path => "#{Pod::Config.instance.installation_root}/.."
4624
)
4725

48-
49-
# Permissions
50-
permissions_path = '../node_modules/react-native-permissions/ios'
51-
52-
pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
53-
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
54-
55-
# Enables Flipper.
56-
#
57-
# Note that if you have use_frameworks! enabled, Flipper will not work and
58-
# you should disable the next line.
59-
# use_flipper!()
60-
61-
post_install do |installer|
26+
post_install do |installer|
6227
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
6328
react_native_post_install(
6429
installer,
6530
config[:reactNativePath],
66-
:mac_catalyst_enabled => false
31+
:mac_catalyst_enabled => false,
32+
# :ccache_enabled => true
6733
)
68-
__apply_Xcode_12_5_M1_post_install_workaround(installer)
6934
end
7035
end

0 commit comments

Comments
 (0)