Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS - Should building QtFirebase with "QTFIREBASE_CONFIG += messaging" work? #91

Open
Markus87 opened this issue Sep 4, 2018 · 6 comments

Comments

@Markus87
Copy link

Markus87 commented Sep 4, 2018

At the moment I only need the messaging component of QtFirebase.
For my android build this was no problem.
In order to make it work for iOS I needed to edit:
https://github.com/Larpon/QtFirebase/blob/593032a7c613d40c55212ec10790400fd4a30c8f/qtfirebase_target.pri#L166

        LIBS += \
+           -F$$QTFIREBASE_FRAMEWORKS_ROOT/Analytics \
+           -framework GoogleUtilities \
+           -framework FirebaseCore \
+           -framework FirebaseInstanceID \
            -F$$QTFIREBASE_FRAMEWORKS_ROOT/Messaging \
            -framework FirebaseMessaging \
            -framework Protobuf \

I understand my solution is no general fix for the problem, but it works for me.
Should this work out of the box?

@larpon
Copy link
Owner

larpon commented Sep 4, 2018

Hi @Markus87 thanks for trying QtFirebase! - unfortunately it's not tested with individual components as such. The dependencies on iOS has been added in the order they were developed and later bug fixed. So your solution is perfectly sane. We're not always on top of things in this regard.

I guess standalone component support is easily fixed if LIBS += can contain duplicate entries. (Maybe you know if it's possible/allowed?)

On top of this we're fighting with Google changing dependencies around versus a lack of time to keep up atm.

@Markus87
Copy link
Author

Markus87 commented Sep 4, 2018

Thanks for the quick response.
All fair enough - besides this little hickup QtFirebase already helped me a lot, so thanks for this great project. 👍

I guess standalone component support is easily fixed if LIBS += can contain duplicate entries.

Dont take my word for it, but I just added a few of the same frameworks more than once to LIBS and in the command line they only show up once. It looks like QMake handles it. Could not find any documentation regarding this behaviour though.
So just trying to build the components one by one and fixing the errors could be the solution to standalone component support for iOS.

@larpon
Copy link
Owner

larpon commented Sep 4, 2018

Cool - thanks for trying it out. Yup that's exactly what I had in mind!

I'll keep the issue open

@adolby
Copy link
Contributor

adolby commented Feb 27, 2019

There is the *= operator which will prevent duplicates from being added to a variable. It looks like we might be able to use it to prevent adding duplicates to LIBS.

https://doc.qt.io/qt-5/qmake-language.html#adding-unique-values

It was my understanding that at one time Firebase Analytics (now called Firebase Core in the library name) was required as a minimum that was needed for other components but I think that the Firebase Team was working on refactoring that over the past year or so.

Update: It looks like Firebase Messaging doesn't require Firebase Core unless you want to use the Audiences feature to send messages, but I think that this is a recent change to Firebase to support this. The details are here:

Sharing Analytics data with Firebase features

@driele-torres
Copy link

driele-torres commented Sep 30, 2020

I think that I found out an error related to this. I cound`t compile using only "QTFIREBASE_CONFIG += messaging", instead it was necessary use "QTFIREBASE_CONFIG += analytics messaging". It was a linking error.

It was a hard time rsrs. For better understanding of my context: Qt Creator 4.13.1, QtVersion 5.14.2, Xcode Version 11.7 (11E801a), IOS 13.7 , Firebase C++ SDK 6.11.0 , Firebase IOS SDK Firebase iOS 6.28.2.

@larpon
Copy link
Owner

larpon commented Sep 30, 2020

@driele-torres
Yes. The problem is that analytics also acts as the base for firebase (Google's choice). analytics should probably be made obligatory somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants