iOS Firebase and Mobile Ads SDKs issue solve
Firebase and Admob for recommend to use cocoapods.
This contains 4 separate steps:
-Link with firebase
-Download GoogleService-Info.plist
– 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.
pod init
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.
source ‘https://github.com/CocoaPods/Specs.git’
# platform :ios, ‘7.0’
pod ‘Firebase’, ‘>= 2.5.0’
target ‘XYZPROJECTS’ do
pod ‘Firebase/Core’
pod ‘Firebase/AdMob’
end
Save the file and go to command line again. Now run any of this two command.
pod install
OR
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 :
#import <Firebase/Firebase.h>
Now configure you Firebase in didFinishLaunchingWithOptions method using
[FIRApp configure];
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
Software Engineer
TopOfStack Software Limited