Is anyone having any success with the Firebase frameworks, particularly Google Mobile Ads, in their iOS apps?
I cannot for the life of me get the ads working. I have been through these excellent threads from @matkatmusic but cannot replicate what he has achieved
The guides are 4 years old now and I can only guess that some things have changed since then. Firstly, I cannot get the .xc frameworks to be detected by Xcode when I add them to the custom frameworks section. The only way I can seem to get them loaded into the project is if I embed them, but I think this may be the wrong way to do it. I can build at this point, but the app fails to install (on simulator) with this error message
I’m pulling my hair out with it, as I’m sure it is not as complicated as it seems to me. I must confess I don’t know much about static and dynamic libraries and how they need to be structured. I did try and load the frameworks in as libraries (firebase.a) but again they could not be detected by Xcode. Any pointers in the right direction would be hugely appreciated, as I’m sure people are monetising ads in their Juce apps??
I just ran into issues with Firebase myself. OMG I wasted so many hours trying different combination of Header Search Path, Frameworks, XFrameworks, other Projucer/xCode evil things. But I finally got Firebase Analytics and Crashlytics to work on iOS. I suspect issue with Google Mobile Ads are most likely have similar causes.
Due to changed in recent Firebase iOS SDK (i.e. 9.5.0) - it uses now Swift binaries I didn’t find any way to link it properly and make some with Projucer. I went back on GH looking for older release of Firebase which doesn’t use Swift Binaries and it worked with 8.5.0!
My solution to similar issues with Firebase and other kinds of databases was to add a container in Google Cloud Run, or a cloud function that would be the only entity communicating with the database directly and forward whatever results back to the plugin.
That way, the plugin can just send plain https messages, which makes the cross platform build way simpler, and works easily on iOS too.
@eyalamir Can you please elaborate on your approach?
Also I would love to turn Firebase into juce module… But I’m not sure how to approach it. I’ve created simple just modules before, but not something that has quite an extensive setup.
I’m currently running into issue when iOS Auv3 plugin doesn’t report Analytics even after confirming that Firebase was successfully initialized. Of course this issue is not present in Standalone build.
Google has a service called “Cloud Run”
It lets you essentially run a docker container which will be launched and run for a short period of time whenever an http request happens. That container can run a node.js program, a C++ program, a Python program… whatever you want, on a Linux machine you configure with a dockerfile.
Then you set up a simple web server that answers HTTP requests that take some input and returns an output, and does all the heavy duty of talking to Firebase, SQL or whatever your database is.
Then the plugin/app only needs to make regular HTTPS requests (for example, using juce::URL) without any direct connection to the specific type of database, which you can in fact even change later without the plugin knowing about it.
TBH I tried it and the Firebase build system was too complicated and non-portable, which is why I went with the solution above, and never looked back.
Great info from you both, thank you. I STILL can’t even get a single firebase framework (even the v8.5 ones) to copy into Xcode via that ‘Extra Custom Frameworks’ box. Ive added the search path, but as soon as Xcode loads up it is red in the framework list (and has the .xcframework extension). It works fine if I drag them direct into Xcode from the exact same location. The only way it will work (or at least seem to) is if I embed them from Projucer, but then that gives me the weird info.plist error in post 1. Im tearing my hair out with it!
Yes I did, but I think you may be correct in that this is where the problem lies. Ive changed that code in this path JUCE/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h but it doesn’t seem to be doing anything. In fact I’ve commented out a huge chunk of code in that header file and it isn’t doing anything, no errors or anything! The header is not copied into the project file either that I can see. Ill try start a new project with this edited header in place and see what happens. I feel like I’m on the right track though. Thanks.
I think my issue may be to do with ‘Build custom Projucer from source’, in your guide. If I just start a new project as I always do, nothing that I do to change those jucer_ProjectExport_Xcode.h makes any difference. If I modify those and then open the /Users/…/Documents/JUCE/extras/Projucer/Projucer.jucer the effects can be seen with errors etc. What is the purpose of that Projucer.jucer? Am I supposed to start a new project from that somehow?
Sorry I know I’m being an amateur but I’ve never had to do anything but start a new project from the standard Producer app icon in the top of the Juce directory.
That was painful, but I’ve sorted it. The issue I was having all along was as you said @dikadk13 , thanks for all your help. I didn’t realise that was the way the Projucer app was built and so when I edited the code, I was then still using the old Projucer app from my dock. You live and learn.
FYI, I have it working using the latest version of firebase (9.4). I don’t know if this will solve the problems you were having, but you need to add a blank .swift file to your source. I added it direct in Xcode (choose to add bridging header when asked) then that will save in your builds folder. Then back in Projucer/Source choose add existing file and select it.
Firebase 10.2 and gma.h, compile ok but firebase::gma::Initialize not working…
Console messages :
Loading UIApplication category for Firebase App No app has been configured yet. The default Firebase app has not yet been configured. Add FirebaseApp.configure() to your application initialization. This can be done in in the App Delegate’s application(_:didFinishLaunchingWithOptions:)(or the@main` struct’s initializer in SwiftUI). Read more: https://goo.gl/ctyzm8.
And “future.status()” stay eternally in firebase::kFutureStatusPending status (Initialization on-going, continue to wait…)