Installation
- make sure the ruby system is up to date
-
$ sudo gem update --system
-
- install cocoapods
-
$ sudo gem install cocoapods
- If you get an error message about fuzzy_match, try this command instead,
-
$ sudo gem install -n /usr/local/bin cocoapods
-
- setup the pods
-
$ pod setup
-
To Test / use cocoa pods
- Create a new single view project in Xcode
- Quit Xcode
- navigate to the folder of the new project in Terminal
- create a new podfile
-
$ pod init
-
- This will create a file called “Podfile”
- Open the file for editing
- Un comment the platform line. (the second line)
- Make sure the use_frameworks! line is not commented out if you’re using swift
- after the first Pods for <project> line add a Pod file
- e.g. pod ‘Firebase/Core’
- run install command
-
$ pod install
-
- not the output about using the new xcworkspace file instead of the old project file.
To Install FireBase
- Do all of the above
- Then go to the Firebase console and register your app
- Download the google plist file and add it to your project
- Open the application.swift file
- add the following line to the top of the file
- import Firebase
- in the didFinishLaunchingWithOptions method, add the following line
- FirebaseApp.configure()
- NOTE: You have to do step 3, otherwise you’ll get and error for the line you add at 6A
Leave a Reply