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.
Yeah, sure.
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.
Thanks for detailed overview! Sounds like a great approach, plus prevents from future issues with dependency changes (i.e. Firebase moving to Swift binaries)
What do you use for Crash reporting of Auv3 plugins?
Not sure Iām the right person to get the tips on AUv3: weāre now in the process of working on the first commercial AUv3 Iāve ever done, so itās possible I might not have all the answers.
But so far I just used the mechanisms that are built in the App Store (App Store Connect) to see crash logs and such from users, which was pretty helpful.
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!
Did you modified Projucer to work with *.xcframeworks"?
I think itās a good idea to checkout my repo I posted above and see if youāre still getting same issues with that project.
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.
jucer_ProjectExport_Xcode.h you need to edit is not part of juce_modules. Itās code for the app - Projucer. So you need to rebuild it and use if to open project youāre working on.
Checkout juce repo
If youāre on Mac - Go to extras/Projucer/Build/
Open Xcode project Projucer.xcodeproj
Edit jucer_ProjectExport_Xcode.h
Build Projucer
Use new Projucer.app to open your project with ā.xcframeworksā
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ā¦)