amirrajan / rubymotion-applied

RubyMotion documentation provided by the community. Submit a pull request to the docs for a free one year indie subscription.
Apache License 2.0
49 stars 10 forks source link

Sample app showing how to use Firebase Firestore #84

Open amirrajan opened 6 years ago

amirrajan commented 6 years ago

http://community.rubymotion.com/t/firebase-firestore/2255

bwalton commented 6 years ago

Alright, I don't have a sample app, but I'd like to share my Firebase adventure...

My app makes heavy use of Firebase (Database and Cloud Firestore) so while keeping those pods correctly installed wasn't a huge deal, it was always a risk to make any big changes in my setup. Unsurprisingly, when I upgraded to High Sierra and rebuilt my app, Firebase wasn't happy. It seemed that libraries required by Firebase (gRPC in particular) didn't like the order they were loaded in as I was getting "Undefined symbols" when the symbols were in fact defined, just later on in the compile process. Anyhow, here's how part of my Rakefile looks for a successful compile:

  app.pods do
    pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => '4.13.0'
    pod 'FirebaseDatabase', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => '4.13.0'
    pod 'FirebaseAuth', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => '4.13.0'
    pod 'FirebaseStorage', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => '4.13.0'
    pod 'FirebaseFirestore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => '4.13.0'
  end

  app.vendor_project('vendor/BoringSSL.framework', :static, :products => ['BoringSSL'], :headers_dir => 'Headers')  

Why does it matter to pull the pods from source as opposed to Cocoapods itself? Why do I have to vendor BoringSSL even after it's loaded by the pods themselves? Who knows! Someone smarter than myself can explain, I'm just elated that it's working. Hopefully this helps someone.