Firebase and Admob for recommend to use cocoapods.
This contains 4 separate steps:
-Link with firebase
– Update cocoapods
– init Firebase in app.
- Link with Firebase:
This is just creating a connection Firebase with Admob app. From the consoleâ€™s top right menu , there is a button to connection with firebase.
Console link : https://console.firebase.google.com/?pli=1
- Download plist file :
It’s free and just takes a few minutes. When asked for a Bundle ID, enter the Bundle ID from the project you want to use for testing.
Once you have aÂ GoogleService-Info.plistÂ file, save it in the same directory as the rest of the XCODE project source.
- Update cocoapods and install pod:
Now go to project directory from command terminal.
Run this command, this will install cocoapods
sudo gem install cocoapods
When cocoapods installation is complete, start adding to your projects with this command.
This command will create pod file in projects directory. You can add the rest command from terminal but also can be done by opening the file directly. I have done it for admob my project.
# platform :ios, â€˜7.0â€™
pod ‘Firebase’, ‘>= 2.5.0’
target â€˜XYZPROJECTSâ€™ do
Save the file and go to command line again. Now run any of this two command.
pod install â€“verbose
Second one worked for me. I got some bad file issue with first command. This may take more than 2 hours for the first time.
Got solution from this link : http://stackoverflow.com/questions/23755974/cocoapods-pod-install-takes-forever
When this complete, you will get some yellow line that firebase , admob and other necessary framework successfully added to your projects with cocopods.
- Init FireBase (Most important step *** ) :
Google changes their framework but did not updated their documentation because the way is not working currently.
You may get some issues still:
Check you project settings -> Other Linker Option and set it $(inherited).
And Donâ€™t forget to set Build architecture YES
Now you have to import Firbase and work for configuring it.
@import Firebase, this line is not working anymore.
So you have, import this like :
Now configure you Firebase in didFinishLaunchingWithOptions method using
CLEAN, BUILD AND RUN. Hope everything should works fine. You will see few line in your logs that Firebase has been started configuring projects. Happy Developing !!
Md. Jamshed Alam Bhuyan
TopOfStack Software Limited