I was trying to add cocoapods for admob firebase in my iOS app. But pod intsall command took too much time. Now i want to add firebase admob directly without cocoapods.
I have downloaded whole SDK from https://dl.google.com/firebase/sdk/ios/3_5_2/Firebase.zip . It shows several folder with like AdMob Analytics, AppIndexing, Auth,Crash, Database,DynamicLinks, Invites, Messaging, RemoteConfig, Storage.
For cocoapods, we see they import firebase in .h file and add [Firebase configure] method.
What for SDK? Do I need to use only AdMob folder here? do I need to use the whole SDK? How would it need to be implemented?
Finally, i figured it out. import firebase is not working anymore. Hope the documentation is not updated properly.
Anyone should directly integrate Firebase to your project. And the documentation is not updated still. There is a issue there. Follow steps for analytics, add your database parameter from the video.
https://www.youtube.com/watch?v=joVi3thZOqc
https://www.youtube.com/watch?v=XIQsQ2injLo
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 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
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.
Save the file and go to command line again. Now run any of this two command.
OR
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 : 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.
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.
So you have, import this like :
Now configure you Firebase in didFinishLaunchingWithOptions method using
[FIRApp configure];
This is for analytics. To init Database, follow this link:
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 !!