I am stuck with my application, its work in a developer device and emulator too with IOS 13, but when i generate and upload the release version in the testflight, the application in the same device start the launchscreen and quickly show a black screen. I use and older iphone with IOS 12.4.2 and the same build works fine. I need help. This is the link of my testflight https://testflight.apple.com/join/maFeskwLThis is my app AppDelegate code:import UIKit
import CoreData
import CoreLocation
import GoogleMaps
import OneSignal
import GoogleMobileAds
import PianoOAuth
import SDWebImage
import Firebase
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, CLLocationManagerDelegate, ESTBeaconManagerDelegate { //, ESTBeaconManagerDelegate {
var window: UIWindow?
var beaconManager = ESTBeaconManager.init()
var locationManager: CLLocationManager = CLLocationManager()
var listUUIDs : [String] = []
var monitoreando = false
// MARK: UISceneSession Lifecycle
@available(iOS 13.0, *)
func application(_ application: UIApplication,
configurationForConnecting connectingSceneSession: UISceneSession,
options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
@available(iOS 13.0, *)
func application(_ application: UIApplication,
didDiscardSceneSessions sceneSessions: Set) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions:
[UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
MyDBhelper.init().CargarDatos()
if (RepositorioCategoria().obtenerCategorias(origen: "LA PRENSA").count == 0) {
if(Utilidades().isConnectedToNetwork()) {
RepositorioCategoria().consumirWS(origen: "LA PRENSA") { (response) in
DispatchQueue.main.async {
self.iniciar()
}
}
} else {
self.iniciar()
}
} else {
self.iniciar()
}
UIApplication.shared.registerUserNotificationSettings(
UIUserNotificationSettings(types: .alert, categories: nil))
GADMobileAds.sharedInstance().start(completionHandler: nil)
FirebaseApp.configure()
GMSServices.provideAPIKey("******")
let onesignalInitSettings = [kOSSettingsKeyAutoPrompt: false]
let notificationOpenedBlock: OSHandleNotificationActionBlock = { result in
// This block gets called when the user reacts to a notification received
//let payload: OSNotificationPayload? = result?.notification.payload
if let additionalData = result!.notification.payload!.additionalData {
let variableNoticia = RepositorioParametrizacion().obtenerParametrizacionById(IdParametrizacion: "VariableNoticia")
if variableNoticia.Id_Parametrizacion == "" {
if (additionalData["id_noticia"] != nil) {
let parametro = Parametrizacion.init(Id_Parametrizacion: "VariableNoticia", Valor: (additionalData["id_noticia"] as! String), Fecha_Valor: -4)
RepositorioParametrizacion().insertar(parametrizacion: parametro)
}
} else {
if (additionalData["id_noticia"] != nil) {
variableNoticia.Valor = additionalData["id_noticia"] as! String
variableNoticia.Fecha_Valor = -4
RepositorioParametrizacion().actualizar(IdParametrizacion: "VariableNoticia", parametrizacion: variableNoticia)
}
}
self.iniciar()
}
}
OneSignal.initWithLaunchOptions(launchOptions,
appId: "*********",
handleNotificationAction: notificationOpenedBlock,
settings: onesignalInitSettings)
OneSignal.inFocusDisplayType = OSNotificationDisplayType.notification;
let currentUser = RepositorioUsuario().obtenerUsuario()
if currentUser.Email != "" {
OneSignal.sendTag("email", value: currentUser.Email)
if currentUser.Suscriptor != "" {
OneSignal.sendTag("esSuscritor", value: "1")
} else {
OneSignal.sendTag("esSuscritor", value: "0")
}
}
// Recommend moving the below line to prompt for push after informing the user about
// how your app will use them.
OneSignal.promptForPushNotifications(userResponse: { accepted in
print("User accepted notifications: \(accepted)")
})
return true
}
func userNotificationCenter(_ center: UNUserNotificationCenter,
willPresent notification: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
if Int(notification.request.content.userInfo["idNotificacion"] as! String)! > 0 {
let resultado = notification.request.content.userInfo["idNotificacion"] as! String
print(resultado)
if resultado.count > 0 {
let sb: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let navigationView = sb.instantiateViewController(withIdentifier: "UrlBeaconNavigationController") as! UrlBeaconNavigationController
let frontVC = navigationView.topViewController as! UrlBeaconViewController
frontVC.idNotificacion = Int64(resultado)!
frontVC.fechaNotificacion = Date()
frontVC.tipoNotificacion = 2
self.window?.rootViewController = navigationView
self.window?.makeKeyAndVisible()
}
}
}
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
//FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
return true
}
// func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
// return Twitter.sharedInstance().application(app, open: url, options: options)
// }
func iniciar() {
if #available(iOS 13.0, *) {
// In iOS 13 setup is done in SceneDelegate
} else {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
var vc = storyboard.instantiateViewController(withIdentifier: "inicio") as! SWRevealViewController
self.window?.rootViewController = vc
self.window?.makeKeyAndVisible()
vc.removeFromParent()
}
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
//FBSDKAppEvents.activateApp()
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
//AppEventsLogger.activate(application)
}
func applicationDidReceiveMemoryWarning(_ application: UIApplication) {
SDImageCache.shared.clearMemory()
SDImageCache.shared.clearDisk()
URLCache.shared.removeAllCachedResponses()
// Delete any associated cookies
if let cookies = HTTPCookieStorage.shared.cookies {
for cookie in cookies {
HTTPCookieStorage.shared.deleteCookie(cookie)
}
}
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
// Saves changes in the application's managed object context before the application terminates.
self.saveContext()
}
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
return PianoID.shared.handleUrl(url, options: options)
}
// MARK: - Core Data stack
lazy var persistentContainer: NSPersistentContainer = {
/*
The persistent container for the application. This implementation
creates and returns a container, having loaded the store for the
application to it. This property is optional since there are legitimate
error conditions that could cause the creation of the store to fail.
*/
let container = NSPersistentContainer(name: "LaPrensa")
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
/*
Typical reasons for an error here include:
* The parent directory does not exist, cannot be created, or disallows writing.
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
* The device is out of space.
* The store could not be migrated to the current model version.
Check the error message to determine what the actual problem was.
*/
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()
// MARK: - Core Data Saving support
func saveContext () {
let context = persistentContainer.viewContext
if context.hasChanges {
do {
try context.save()
} catch {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
let nserror = error as NSError
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
}
}
}
}and this is the SceneDelegate file@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }
let window = UIWindow(windowScene: windowScene)
self.window = window
let mainstoryboard:UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let newViewcontroller:UIViewController = mainstoryboard.instantiateViewController(withIdentifier: "inicio") as! SWRevealViewController
window.rootViewController = newViewcontroller
window.makeKeyAndVisible()
}
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Not called under iOS 12 - See AppDelegate applicationDidBecomeActive
}
func sceneWillResignActive(_ scene: UIScene) {
// Not called under iOS 12 - See AppDelegate applicationWillResignActive
}
func sceneWillEnterForeground(_ scene: UIScene) {
// Not called under iOS 12 - See AppDelegate applicationWillEnterForeground
}
func sceneDidEnterBackground(_ scene: UIScene) {
// Not called under iOS 12 - See AppDelegate applicationDidEnterBackground
}
}This is my