Firebase errors, adding using SPM - swift

I have installed Firebase SDK using SPM and i got this, what should i do?
IMAGE!
import UIKit
import Firebase
#main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
FirebaseApp.configure()
return true
}

The Firebase team is actively working with the gRPC team on this issue and expect to resolve it in the next month or two. It's being tracked at https://github.com/firebase/firebase-ios-sdk/issues/9790.
In the meantime, the gRPC warnings do not affect Firebase functionality and can safely be ignored.

Related

How would you fix Xcode Firebase Integration With SwiftUI saying: format:#"`[FIRApp configure];` (`FirebaseApp.configure()` in Swift) could not find "

I am clueless as to what I need to fix this problem.
I have Firebase running in my workspace in Xcode and I followed the Firebase instructions which are:
import UIKit
import Firebase
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions:
[UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
return true
}
}
But the issue is when I run the project the simulation is white. And goes to FirApp.m and says the following code.
if (!options) {
[NSException raise:kFirebaseCoreErrorDomain
format:#"`[FIRApp configure];` (`FirebaseApp.configure()` in Swift) could not find "
#"a valid GoogleService-Info.plist in your project. Please download one "
#"from %#.",
kPlistURL];
I was following CodingWithChris with this tutorial --> https://youtu.be/1HN7usMROt8?t=2363
You must make sure the GoogleService-Info.plist does not have a look like this GoogleService-Info.plist(5) when you download it again or it will not work.
To deal with black screen the error was the following:
Failed to instantiate the default view controller for UIMainStoryboardFile 'MainStoryboard' - perhaps the designated entry point is not set?
In the storyboard, make sure to uncheck the "Is initial View Controller" because it might be getting confused with multiple view controllers.
In the app go to app target and press the Info tab. There is minus or add in the value of "Main storyboard file base name" you need to use the minus to make it go away. Then on the "General tab" clear do the same thing for "Main Interface".

Disable IQKeyboardManager in ViewController in Swift

To disable IQKeyboardManager in a viewcontroller in Swift, you apparently need to get a reference to the instance and then disable it. However, I cannot figure out a way to reference it. I originally import the library in the appDelegate which is written in Objective-C as
import IQKeyboardManagerSwift
Give me the error:
No Such Module IQKeyboardManagerSwift
If I merely try to put the lines below in viewDid Load:
IQKeyboardManager.shared().isEnabled = false
IQKeyboardManager.shared().isEnableAutoToolbar = false
Then I get error
IQKeyboardManager not found.
How do you disable IQKeyboardManager for a specific view controller in Swift?
The documentation mentions a possible solution: (the syntax may be a bit different depending on the version of the framework you're using)
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
IQKeyboardManager.shared().isEnabled = true
IQKeyboardManager.shared().enabledDistanceHandlingClasses.append(EnabledViewController.self)
IQKeyboardManager.shared().disabledDistanceHandlingClasses.append(DisabledViewController.self)
return true
}
if you need the toolbar disabled/enabled as well
IQKeyboardManager.shared().enabledToolbarClasses.append(ToolbarEnabledViewController.self)
IQKeyboardManager.shared().disabledToolbarClasses.append(ToolbarDisabledViewController.self)

Xcode didn't do anything signal SIGABRT

I've just installed Xcode and tried to run an empty app.It shows this bug, even though I didn't even touch it!
The code:
import UIKit
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
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.
}
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.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
The way to fix this was to add at least something in your app.It doesn't matter what!For me, I just added a variable and it worked.

iOS Application with Firebase doesn't start with a slow internet connection

Since I upgraded to the new Firebase, my application doesn't start with a slow internet connection. It does when it is has a good connection and also when it hasn't got any connection at all. I think that I've set up everything properly since it wouldn't work at all if I made a mistake with the setup.
Here's my AppDelegate code:
import UIKit
import Firebase
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptionslaunchOptions: [NSObject: AnyObject]?) -> Bool {
UITabBar.appearance().tintColor = UIColor.redColor()
FIRApp.configure()
FIRDatabase.database().persistenceEnabled = true
return true
}
}
iOS includes a mechanism called watchdog, which will terminate any application that fails to launch in a certain time window. Any blocking task you do in application(_:didFinishLaunchingWithOptions:) has the potential to cause your app to be terminated if it takes too long. You should consider performing such tasks asynchronously.
You can put breakpoints or print statements in your code to determine which line is taking too long.

Parse+Facebook SDK Issues - Use of Unresolved Identifier 'PFFacebookUtils'

I understand that there have been similar posts about this issue, but nothing seems to be working.
I'm trying to enable my users to sign-up/in with Facebook, but I am having trouble getting the Facebook SDK working.
I have added the 'FBSDKCoreKit.Framework' framework as the Facebook guide says to do, as well as the 'ParseFacebookUtils.framework'. When I try and initialize facebook in my AppDelegate.swift, here..
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
Parse.setApplicationId("", clientKey: "")
PFFacebookUtils.initialize()
return true
I get the error that says "Use of unresolved identifier 'PFFacebookUtils'". I followed all the steps under 'Setup' in the Parse Docs.
This is all in Swift, and so here is my Bridging Header File...
// Use this file to import your target's public headers that you would like to expose to Swift
#import <Parse/Parse.h>
#import <ParseUI/ParseUI.h>
#import <Bolts/BFTask.h>
#import <ParseFacebookUtils/PFFacebookUtils.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
What am I doing wrong? Very frustrated, but I will eventually figure it out.
Try this:
import Bolts
import ParseFacebookUtilsV4
import FBSDKCoreKit
import FBSDKLoginKit
From what I think, you might have used ParseFacebookUtilsV4.Framework (which is the latest support for Swift I am assuming) instead of ParseFacebookUtils.Framework (old or may be the one that requires objective C bridging headed).
So if you want your app to work as per the code you have, use the ParseFacebookUtils.Framework and avoid ParseFacebookUtilsV4.Framework. But if you want to use ParseFacebookUtilsV4.Framework, you have to do some changes in your swift Appdelegate:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
}
func applicationDidBecomeActive(application: UIApplication) {
FBSDKAppEvents.activateApp()
}
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
return FBSDKApplicationDelegate.sharedInstance() .application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}
Bridging header changes:
#import <FBSDKCoreKit/FBSDKCoreKit.h>
Not sure about the Utils import, but if needed, replace the old import code #import ParseFacebookUtils/PFFacebookUtils.h in your bridging header with this one
#import <ParseFacebookUtilsV4/PFFacebookUtils.h>
Notice the small change with addition of V4.
I hope I may have helped you in someway.
Make sure you've set your bridging header correctly.
If you click your project in the "Project Navigator", then click your target, click Build Settings, and scroll down to "Swift Compiler - Code Generation", you should see a row for Objective-C Briding Header.
In this row, you need to enter your bridging header:
ProjectName/Your-Bridging-Header.h
This happened to me when I enabled frameworks in cocoapods (use_frameworks!) -- once I added "import ParseFacebookUtilsV4" Xcode was able to find PFFacebookUtils.