firebase-ios-sdk: I got a Domain error when post data to Cloud FireStore

when i run those code blow,i got a domain error

my code(just same as FireBase`s document),and i have the config file “GoogleService-Info.plist”,also initialzed FireBase

[FIRApp configure];
// Add a new document with a generated ID
__block FIRDocumentReference *ref =
    [[self.db collectionWithPath:@"users"] addDocumentWithData:@{
      @"first": @"Ada",
      @"last": @"Lovelace",
      @"born": @1815
    } completion:^(NSError * _Nullable error) {
      if (error != nil) {
        NSLog(@"Error adding document: %@", error);
      } else {
        NSLog(@"Document added with ID: %@", ref.documentID);
      }
    }];

what error i got

Apr 10 17:24:54  Solitaire[422] <Debug>: 4.9.0 - [Firebase/Firestore][I-FST000001] FSTWriteStream 0x15848ce0 start
Apr 10 17:24:54  Solitaire[422] <Debug>: 4.9.0 - [Firebase/Firestore][I-FST000001] Committing <FSTWriteGroup for Locally write mutations: 2 changes (365 bytes):
	  - Put [mutation: userID= batchID=49] (365 bytes)
	  - Put [document_mutation: userID= key=game_info_/8jdXb6eMIqZ9jpkbeeEM batchID=49] (0 bytes)>
Apr 10 17:24:55  Solitaire[422] <Debug>: 4.9.0 - [Firebase/Firestore][I-FST000001] FSTWriteStream 0x15848ce0 initial request: <GCFSWriteRequest 0x1583fba0>: {
	    database: "projects/solitaire-us/databases/(default)"
	}
Apr 10 17:24:55  Solitaire[422] <Debug>: 4.9.0 - [Firebase/Performance][I-PRF100009] Recording network trace: https://e.crashlytics.com/spi/v2/events
I/AudioEngine-inl.mm (359): OpenAL was initialized successfully!
V/AudioCache (311): pcm buffer was loaded successfully, total frames: 44749, total read frames: 44749, adjust frames: 0, remainingFrames: 0
Apr 10 17:24:56  Solitaire[422] <Debug>: 4.9.0 - [Firebase/Performance][I-PRF100009] Recording network trace: https://me.xdrig.com/v1/38c1feb0
Apr 10 17:24:57  Solitaire[422] <Debug>: 4.9.0 - [Firebase/Firestore][I-FST000001] FSTWriteStream 0x15848ce0 close: Error Domain=FIRFirestoreErrorDomain Code=14 "Connect Failed" UserInfo={io.grpc.TrailersKey={
	}, NSLocalizedDescription=Connect Failed}

its seems like firesbase is ready to post data to server, but client cant connect to server cause of the FIRFirestoreErrorDomain,every data is saved in local cache, so i can use

“getDocumentsWithCompletion” api to get all the data i trying to post to remote server.

Other fuction works good,just like Analytics,Crashlytics, is that mean the

FIRFirestoreErrorDomain not caused by my network environment?

I`m using xcode Version 9.2 (9C40b) and FireBase managed by Cocoapod, this is my podfile

blow

platform :ios, '8.0'
target 'my_project' do
	pod 'Adjust', '~> 4.12.1'
	#pod 'Google-Mobile-Ads-SDK'
    pod 'Firebase/Core'
    pod 'Firebase/AdMob'
    pod 'Fabric', '~> 1.7.2'
    pod 'Crashlytics', '~> 3.9.3'
    pod 'Firebase/RemoteConfig'
    pod 'Firebase/Performance'
    pod 'Firebase/Firestore'
#    pod 'Firebase/Auth'
end

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

Alternatively can you verify that when you run a REST-based get you get a response from the Firestore service?

For example, if you run this (for the same document in your log above):

curl 'https://firestore.googleapis.com/v1beta1/projects/solitaire-us/databases/(default)/documents/game_info_/8jdXb6eMIqZ9jpkbeeEM'

You should see output like this:

{
  "error": {
    "code": 404,
    "message": "Document \"projects/solitaire-us/databases/(default)/documents/game_info_/8jdXb6eMIqZ9jpkbeeEM\" not found.",
    "status": "NOT_FOUND"
  }
}