I have updated Firestore to follows. Now, I can't use it anymore. I removed, reinstalled several times. But there is no change. I am losing my mind. The issue is:
"Use of unresolved identifier 'SetOptions'".
db.collection("").document("").setData([ "p1answered":false, "p1OutofTime": false ], options: SetOptions.merge())
Bolts (1.9.0)
Using BoringSSL (10.0.2)
Using FBSDKCoreKit (4.33.0)
Using FBSDKLoginKit (4.33.0)
Using Firebase (5.0.1)
Using FirebaseAnalytics (5.0.0)
Using FirebaseAuth (5.0.0)
Using FirebaseCore (5.0.1)
Using FirebaseFirestore (0.12.1)
Using FirebaseInstanceID (3.0.0)
Using FirebaseUI (5.0.0)
Using GTMOAuth2 (1.1.6)
Using GTMSessionFetcher (1.1.15)
Using Google-Mobile-Ads-SDK (7.31.0)
Using GoogleSignIn (4.1.2)
Using GoogleToolboxForMac (2.1.4)
Using Protobuf (3.5.0)
Using SwiftySound (1.0.0)
Using TwitterCore (3.1.0)
Using TwitterKit (3.3.0)
Using gRPC (1.12.0)
Using gRPC-Core (1.12.0)
Using gRPC-ProtoRPC (1.12.0)
Using gRPC-RxLibrary (1.12.0)
Using leveldb-library (1.20)
Using nanopb (0.3.8)
//Pod File
Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'Tahmin Et' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for My App
pod 'SwiftySound'
pod 'FirebaseUI/Google'
pod 'FirebaseUI/Facebook'
pod 'Google-Mobile-Ads-SDK'
pod 'FirebaseUI/Twitter'
pod 'FirebaseCore'
pod 'FirebaseAuth'
pod 'FirebaseFirestore'
end
Your code is okay, you just need to import FirebaseFirestore in your class.
Edit: After discussion
pod 'FirebaseFirestore' is also not correct. It should be pod 'Firebase/Firestore'. Have a look at Firebase getting started guide choose iOS tab under Set up your development environment.
Edit: 2
In latest documentation it is like:
db.collection("cities").document("BJ").setData([ "capital": true ], merge: true)
Related
I'm trying to add Push Notifications to my iOS app in Xcode but getting the No such module 'FirebaseMessaging' error when I try to import FirebaseMessaging (FYI: import Firebase working just fine).
Running pod installs in Terminal shows that the FirebaseMessaging package was installed:
Downloading dependencies
Installing Firebase (10.5.0)
Installing FirebaseAnalytics (10.5.0)
Installing FirebaseCore (10.5.0)
Installing FirebaseCoreInternal (10.5.0)
Installing FirebaseInstallations (10.5.0)
Installing FirebaseMessaging (10.5.0)
Installing GoogleAppMeasurement (10.5.0)
Installing GoogleDataTransport (9.2.1)
Installing GoogleUtilities (7.11.0)
Installing PromisesObjC (2.1.1)
Installing nanopb (2.30909.0)
Generating Pods project
Integrating client project
And, here's my pod file:
platform :ios, '11.0'
target 'AppName' do
use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'FirebaseMessaging'
end
Any suggestions for how to fix this error?
I tried installing Firebase Messaging but it's not working in Xcode.
So, this question is not about how to fix something, but about how it is working this way.
I want to use FirebaseMessage in my app for push notifications, which have a dependency FirebaseCore. I started just adding FirebaseMessage to my Podfile
pod 'Firebase/Messaging'
I got installed:
Installing Firebase (5.4.1)
Installing FirebaseCore (5.0.6)
Installing FirebaseInstanceID (3.1.1)
Installing FirebaseMessaging (3.0.3)
Installing GoogleToolboxForMac (2.1.4)
Installing Protobuf (3.6.0)
Okey, problem here is that I get a warning when building the project, because FirebaseAnalytics is missing. No problem, I can add:
pod 'Firebase/Messaging'
pod 'Firebase/Core'
and get:
Installing Firebase (5.4.1)
Installing FirebaseAnalytics (5.0.1)
Installing FirebaseCore (5.0.6)
Installing FirebaseInstanceID (3.1.1)
Installing FirebaseMessaging (3.0.3)
Installing GoogleToolboxForMac (2.1.4)
Installing Protobuf (3.6.0)
Installing nanopb (0.3.8)
...and I get nanopb and FirebaseAnalytics extra.
Why is this happening? Looking at the podspecs, FirebaseCore has no dependencies related to FirebaseAnalytics:
https://github.com/CocoaPods/Specs/blob/master/Specs/8/b/d/FirebaseCore/5.0.6/FirebaseCore.podspec.json
I would like to find what tells cocoapods to install the FirebaseAnalytics pod, and why it only happens when I specifically install FirebaseCore.
Firebase/Core is the Core subspec of the Firebase pod. See details in the Firebase podspec.
While the FirebaseCore pod does not depend on FirebaseAnalytics, the Core subspec of the Firebase pod does.
It is unfortunate that "Core" is overloaded in Firebase terminology, but would tricky to change at this point without breaking a lot of apps.
I am trying to create a firebase dynamic link, but I get error use of unresolved identifier FIRDynamicLinkComponents. The frameworks I import in this viewcontroller are: Firebase and UIKit.
FIRbaseDynamicLinks.framework screenshot attached below.
What have I tried I tried?
pod repo remove master
pod setup
pod install
Pod version: 1.5.2
Xcode Version 8.3.3
Swift 3
Terminal log when I run pod install
Analyzing dependencies
Downloading dependencies
Using Firebase (3.9.0)
Using FirebaseAnalytics (3.5.1)
Using FirebaseAuth (3.0.6)
Using FirebaseCore (3.4.4)
Using FirebaseDatabase (3.1.0)
Using FirebaseDynamicLinks (1.3.1)
Using FirebaseInstanceID (1.0.9)
Using FirebaseStorage (1.0.4)
Using FrameAccessor (1.3.2)
Using GTMSessionFetcher (1.1.15)
Using GoogleInterchangeUtilities (1.2.2)
Using GoogleSymbolUtilities (1.1.2)
Using GoogleToolboxForMac (2.1.4)
Generating Pods project
Integrating client project
Sending stats
In Swift, the names are slightly different! To be more Swift-y, we alias the names for Swift without the "FIR" prefix. So FIRDynamicLinkComponents becomes DynamicLinkComponents. This can be a bit confusing at time, though hopefully more readable overall!
To make life a little easier, we've now split our reference docs into Swift and Objective-C versions, and generally have Swift and Objective-C tabs for all snippets in our guides.
Import that pod file in Bridge header file of your project.
I've just included the Google Analytics Pod as described in their iOS developer guide with:
pod 'Google/Analytics'
When running
pod install
it installs the following dependencies:
Installing FirebaseAnalytics (3.2.0)
Installing FirebaseInstanceID (1.0.6)
Installing Google (3.0.3)
Installing GoogleAnalytics (3.14.0)
Installing GoogleInterchangeUtilities (1.2.1)
Installing GoogleSymbolUtilities (1.1.1)
Installing GoogleUtilities (1.3.1)
Since I don't use Firebase, I would like to get rid of the FirebaseAnalytics and FirebaseInstanceID (as well as all pods that are not needed by the framework itself).
Installing unused dependencies only bloats up my app size. I would like to only install the absolute minimum amount of pods to get GoogleAnalytics running.
Any ideas on how to kick the unused Pods out?
As seen in this answer, you can use:
pod 'GoogleAnalytics'
…to avoid installing the dependencies. Note that you'll need to change your Objective-C imports in your bridging header file; I needed at least:
#import <GoogleAnalytics/GAI.h>
#import <GoogleAnalytics/GAIFields.h>
#import <GoogleAnalytics/GAIDictionaryBuilder.h>
My podfile has:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'CoChat' do
pod 'Firebase', '>= 2.5.0'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FBSDKLoginKit'
pod 'AFNetworking', '~> 3.0'
#pod 'MobileDeepLinking-iOS'
end
I run pod install and get:
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Using AFNetworking (3.0.4)
Using Bolts (1.6.0)
Using FBSDKCoreKit (4.10.0)
Using FBSDKLoginKit (4.10.0)
Using FBSDKShareKit (4.10.0)
Using Firebase (2.5.1)
Installing FirebaseUI (0.3.2)
Installing Google (1.3.2)
Installing GoogleAppUtilities (1.0.0)
Installing GoogleAuthUtilities (1.0.1)
Installing GoogleInterchangeUtilities (1.1.0)
Installing GoogleNetworkingUtilities (1.0.0)
Installing GoogleSignIn (2.4.0)
Installing GoogleSymbolUtilities (1.0.3)
Installing GoogleUtilities (1.1.0)
[!] The 'Pods-CoChat' target has transitive dependencies that include static binaries: (/Users/Nathan/Library/Mobile Documents/com~apple~CloudDocs/Desktop/CoChat/Pods/Google/Libraries/libGGLCore.a and /Users/Nathan/Library/Mobile Documents/com~apple~CloudDocs/Desktop/CoChat/Pods/Google/Libraries/libGGLSignIn.a)
When you open the XCWorkspace, nothing has changed. The FirebaseUI pod/framework is not there. Not a clue why this isn't installing.
I'm facing the same problem. The problem is with FirebaseUI/Auth and Google Sign in.
Solution
comment out use_frameworks!
Use bridging headers files by creating
a cocoa touch file, remember to check the box for 'Create a bridging
header file' and then after creation only deleting the .m .h files
as you want the bridging header file. Manually call out the headers
files from there.
If you read the posts on https://github.com/firebase/FirebaseUI-iOS/issues?q=is%3Aissue+is%3Aclosed, some seem to have similar issue. One possible fix is to get the 0.2.6 version of FirebaseUI by including '~>0.2.6' beside the firebaseUI pod
Hope this helps and hopefully this bug is fixed.