Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
24
34 changes: 12 additions & 22 deletions ios/DeveloperApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AppDelegate: ReactAppProvider {
var shouldLaunchLastApp: Bool = false
var previewingSampleApp: Bool = false

override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
super.setUpProvider()
super.application(application, didFinishLaunchingWithOptions: launchOptions)
clearKeychainIfNecessary()
Expand All @@ -24,14 +24,14 @@ class AppDelegate: ReactAppProvider {
return true
}

override func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
RCTLinkingManager.application(app, open: url, options: options)
guard let appUrl = AppPreferences.appUrl, !appUrl.isEmpty, !ReactAppProvider.isReactAppActive() else {
return true
}
var launchOptions: [AnyHashable: Any] = options
launchOptions[UIApplicationLaunchOptionsKey.annotation] = options[UIApplicationOpenURLOptionsKey.annotation] ?? []
launchOptions[UIApplicationLaunchOptionsKey.url] = url
launchOptions[UIApplication.LaunchOptionsKey.annotation] = options[UIApplication.OpenURLOptionsKey.annotation] ?? []
launchOptions[UIApplication.LaunchOptionsKey.url] = url
launchMendixAppWithOptions(options: launchOptions)
return true
}
Expand Down Expand Up @@ -106,29 +106,19 @@ extension AppDelegate: UNUserNotificationCenterDelegate, MessagingDelegate {
FirebaseApp.configure()
}
//Register MiN for remote Notifications
if #available(iOS 10.0, *) {
// For iOS 10 display notification (sent via APNS)
UNUserNotificationCenter.current().delegate = self

let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(
options: authOptions,
completionHandler: {_, _ in })
} else {
let settings: UIUserNotificationSettings =
UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
application.registerUserNotificationSettings(settings)
}
// For iOS 10+ display notification (sent via APNS)
UNUserNotificationCenter.current().delegate = self

let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(
options: authOptions,
completionHandler: {_, _ in })
application.registerForRemoteNotifications()
}

//Called when a notification is delivered to a foreground app.
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
if #available(iOS 14.0, *) {
completionHandler([.sound, .badge])
} else {
completionHandler([.sound, .alert, .badge])
}
completionHandler([.sound, .badge, .banner, .list])
}

func userNotificationCenter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extension MendixReactWindow {
return true
}

open override func motionEnded(_ motion: UIEventSubtype, with event: UIEvent?) {
open override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
if (motion == .motionShake && ReactAppProvider.isReactAppActive()) {
DevHelper.showAppMenu()
}
Expand Down
2 changes: 1 addition & 1 deletion ios/DeveloperApp/Extension/RCTRootView+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import Foundation
extension RCTRootView {
override open func willMove(toWindow newWindow: UIWindow?) {
super.willMove(toWindow: newWindow)
backgroundColor = UIColor.init(white: CGFloat(0.0), alpha: CGFloat(0.0))
backgroundColor = UIColor(white: 0.0, alpha: 0.0)
}
}
6 changes: 3 additions & 3 deletions ios/DeveloperApp/Extension/Storyboard+Extension.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit

extension UIStoryboard {
static let openApp: UIStoryboard = .init(name: "OpenApp", bundle: nil)
static let launchTutorial: UIStoryboard = .init(name: "LaunchTutorial", bundle: nil)
static let launchScreen: UIStoryboard = .init(name: "LaunchScreen", bundle: nil)
static let openApp = UIStoryboard(name: "OpenApp", bundle: nil)
static let launchTutorial = UIStoryboard(name: "LaunchTutorial", bundle: nil)
static let launchScreen = UIStoryboard(name: "LaunchScreen", bundle: nil)
}
6 changes: 1 addition & 5 deletions ios/DeveloperApp/Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ func getUrlFromBundle(_ reference: String) -> String? {

func navigateTo(_ urlString: String) {
if let url = URL(string: urlString) {
if #available(iOS 10.0, *) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(url)
}
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
}

Expand Down
2 changes: 1 addition & 1 deletion ios/DeveloperApp/History/HistoryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct HistoryView: View {

ScrollView(.vertical, showsIndicators: false) {
VStack{
if historyStore.historyList.count == 0 {
if historyStore.historyList.isEmpty {
Text("No apps have been launched yet.")
.padding(.top,25)
} else {
Expand Down
2 changes: 1 addition & 1 deletion ios/DeveloperApp/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ struct HomeView: View {

func permissionDeniedAlert() -> Alert {
return Alert(title: Text("Camera"), message: Text("Camera access is required to use the QR scanner"), primaryButton: .default(Text("OK")){
UIApplication.shared.open(URL(string: UIApplicationOpenSettingsURLString)!)
UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!)
},secondaryButton: .cancel{
showPermissionDeniedAlert = false
})
Expand Down
2 changes: 1 addition & 1 deletion ios/DeveloperApp/Launch/LaunchScreenUIView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct LaunchScreenUIView: View {
}

private let animationTimer = Timer
.publish(every: 1, on: .current, in: RunLoopMode.commonModes)
.publish(every: 1, on: .current, in: RunLoop.Mode.common)
.autoconnect()

var body: some View {
Expand Down
11 changes: 5 additions & 6 deletions ios/DeveloperApp/MendixApp/MendixAppViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class MendixAppViewController: UIViewController, ReactNativeDelegate {
override func becomeFirstResponder() -> Bool {
return true
}

override var preferredStatusBarStyle: UIStatusBarStyle {
return .darkContent
}

override func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -20,12 +24,7 @@ class MendixAppViewController: UIViewController, ReactNativeDelegate {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
_ = becomeFirstResponder()

if #available(iOS 13.0, *) {
UIApplication.shared.statusBarStyle = .darkContent
} else {
UIApplication.shared.statusBarStyle = .default
}
setNeedsStatusBarAppearanceUpdate()
}

override func viewWillDisappear(_ animated: Bool) {
Expand Down
6 changes: 3 additions & 3 deletions ios/DeveloperApp/PaddingTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ class PaddingTextField: UITextField {
@IBInspectable var paddingLeft: CGFloat = 0

override func textRect(forBounds bounds: CGRect) -> CGRect {
return UIEdgeInsetsInsetRect(bounds, createPaddingInsets())
return bounds.inset(by: createPaddingInsets())
}

override func placeholderRect(forBounds bounds: CGRect) -> CGRect {
return UIEdgeInsetsInsetRect(bounds, createPaddingInsets())
return bounds.inset(by: createPaddingInsets())
}

override func editingRect(forBounds bounds: CGRect) -> CGRect {
return UIEdgeInsetsInsetRect(bounds, createPaddingInsets())
return bounds.inset(by: createPaddingInsets())
}

private func createPaddingInsets() -> UIEdgeInsets {
Expand Down
21 changes: 1 addition & 20 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,27 +76,8 @@ target 'DeveloperApp' do
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= []
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] |= ['$(inherited)', "RCT_DEV=1"]
end

# Specify 'Swift Version: 5.0' for resolving archieve errors.
if target.name == 'react-native-video' || target.name == 'MendixNative'
config.build_settings['SWIFT_VERSION'] = '5.0'
end
if target.name == 'VisionCamera'
config.build_settings['SWIFT_VERSION'] = '5.2'
end

end
end

# Ensure deployment_target is set correctly for all projects
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
end
end
project.build_configurations.each do |bc|
bc.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
end
end
end
end
Loading