Giter VIP home page Giter VIP logo

qtfirebase's Introduction

QtFirebase

An effort to bring the Firebase C++ API to Qt 5

QtFirebase aims to bring all the features of the Firebase C++ SDK to Qt 5 - both as C++ wrappers and as QML components.

Please bear in mind that the Firebase C++ SDK currently only supports the mobile platforms Android and iOS.

You can still build QtFirebase on other platforms as the project provides stub implementations or placeholder components - they just return default/empty values when used. Because of this you won't see e.g. ads from AdMob in your desktop builds.

This is due to Google's own limitations in the Firebase C++ SDK implementation.

The Firebase C++ SDK claim to already provide stub implementations for easier building on unsupported platforms - QtFirebase have chosen not to link to unnecessary closed source code - thus we do not link against the stub implementations from Google.

Features / Status

The following features have a working Qt 5 C++ and QML counterpart

Feature Library C++ QML Credits
Base libapp.a Lars Pontoppidan
AdMob libadmob.a Lars Pontoppidan
Analytics libanalytics.a Lars Pontoppidan
Authentication libauth.a Partial Partial Isy
Realtime Database libdatabase.a Partial Partial greenfield932
Dynamic Links libdynamic_links.a
Cloud Messaging libmessaging.a Isy
Remote Config libremote_config.a greenfield932
Cloud Storage libstorage.a in progress 🔧 Furkanzmc

Tested Firebase C++ SDK versions

Base, AdMob, Analytics Up until commit cb52be83:

v2.1.0, v2.1.1, v2.1.2

Base, AdMob, Analytics, RemoteConfig

v3.1.0, v4.0.1

Base, AdMob, Analytics, RemoteConfig, Cloud Messaging

v4.0.3

Base, AdMob, Analytics, RemoteConfig, Cloud Messaging, Authentication, Realtime Database

v4.1.0, v4.2.0, v4.5.0, v4.5.1, v5.0.0, v5.1.1, v5.3.0, 6.1.0, 6.7.0

In most cases you'll be able to build against the latest version of the Firebase C++ SDK - but we've experienced times when developers got lost in the woods for doing so. In that case we recommend you build against one of the latest tested versions of the Firebase C++ SDK as listed above.

Bugs

When you encounter bugs; Please see if they are known issues here or here - before reporting

Setup

For a working and up-to-date example please follow the Quick start section found in the QtFirebaseExample README.

Please see SETUP.md for instructions on how to set up QtFirebase in your Qt Creator project.

Examples

Please look at the QtFirebaseExample repository. In SETUP.md you will find details on what to add to your project files (gradle.build, Info.plist, etc.).

Documentation

Please see comments and usecases in the QtFirebaseExample project

Support

Possible ways of getting support

Possible ways of giving support

  • Comment helpfully on issues
  • Fork, Change, Make a Pull Request
  • Share online
  • Buy QtFirebase ❤'s You'll get a personal email full of hearts from Black Grain!

Possible ways of being really awesome

  • Open source your own Qt/QML projects
  • Be nice (it's really that simple)

Notes

Stability

The Firebase C++ SDK has (or has had) a lot of stability issues - which QtFirebase does its best to work around by wrapping the API into more Qt/C++ friendly classes that prevent some of the bugs and crashes found so far. Please use the latest SDK version to get the latest fixes.

Versions

Version v4.5.0: Native Express ads are deprecated and removed from Firebase in this release and forward. Therefore QtFirebaseAdMobNativeExpressAd is removed in commit 4e217cc.

Version v6.0.0: Invites are removed from Firebase.

In the wild

The following is a list of software that uses QtFirebase

Contributors

Without contributions from all these good people this project would not exist.

Lars Pontoppidan (Maintainer, project founder, Base, AdMob, Analytics), greenfield932 (Remote Config, Misc.), Isy (Cloud Messaging, Auth, Misc.), Andrew Dolby (adolby) (Cloud Messaging, Misc.), li3p (Bugs, Misc.), morebest (Bugs, Misc.) guillaume charbonnier (Auth) ... and many more

qtfirebase's People

Contributors

adolby avatar alexodus avatar borissoft avatar carlonluca avatar clayly avatar dtyugin avatar elderorb avatar garaone avatar isipisi89 avatar ivan-belyakov-bnetworks avatar ivanbelyakoff avatar larpon avatar li3p avatar mastermind2k avatar morebest avatar qjcina avatar rznccc avatar sharm avatar sparsemind avatar stefankrupop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qtfirebase's Issues

Is it possible to send push notifications while the app is not open?

So I would like to send a custom notification using Firebase (like for example an update in my app) so that when the user can click notification in order to open the app. With QtFirebase is this possible? Can an app receive notifications even when closed? Reading on the Firebase docs it seems possible, but I am not sure about QtFirebase.

State of Crashlytics support

Hi.

I haven't seen any reference to Crashlytics in this repo and I am opening up this issue just to ask a few questions :).

I want to add Crashlytics support to my Qt Android app, which I was able to do (by using Firebase SDK directly) for Java part. If I want to use NDK crashlytic, my app starts to crash more often (shutdown of the app crashes).

And now the question :). Does QtFirebase have any additions to make Crashlytics usage better or is the same as using vanilla approach? I'll be switching to QtFirebase soon, just asking if my issue will also be resolved with the switch :).

And another question. If you do not use Crashlytics for crash reports, do you use any other service?

Thank you.

Notifications are not displayed

Hello, I made QtFirebaseExample work, and now I'm integrating QtFirebase into my own app, but I have an issue. When I enter my app, I get my FCM token. After quitting my app, I'm sending a notification from FCM console, but nothing is received. But, when I launch back my app, I enter into the callback of received notification. Any idea of why the notification is not displayed ? (I've accepted push notifications when launching the app, and notifications are activated in my settings)

Thank you in advance for any help

Unable to build QtFirebase with Clang

So I decided to switch to Clang as Google deprecated GCC, so I built Qt from the source with the command ./configure xplatform = android-clang and I finally got it working. However, QtFirebase seems not working with Clang as I get many compile errors like the following

/opt/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/basic_string.h:1149: error: undefined reference to 'std::string::assign(char const*, unsigned int)'
/tmpfs/src/gfile/kokoro_admobandroid/firebase/admob/client/cpp/src/include/firebase/admob/rewarded_video.h:105: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)'
/tmpfs/src/gfile/kokoro_admobandroid/firebase/admob/client/cpp/src/include/firebase/admob/rewarded_video.h:105: error: undefined reference to 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
....
....
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

How to solve gradle 3.0.0 (3.0.1) issues

To get FireBase functional (Android), i am using Gradle 3.0.0 as directed by , but I encountered enormous issues with this Gradle (It still seems not adapted by Qt!) , the output structure of this Gradle is not identified by Qt build (apk goes in apk/debug/ folder which Qt does not scan while installing on device) this can be corrected by gradle tools. But the big issue is with QML types:

Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.impl

QtFirebase/src/platformutils.h missing constructor destructor

In the platformutils.h the constructor and destructor are missing.

It should loke like this:

    #if defined(Q_OS_IOS)
    PlatformUtils();
    ~PlatformUtils();
    static void* getNativeWindow();
    #elif defined(Q_OS_ANDROID)
    static jobject getNativeWindow();
    #else
    static void getNativeWindow();
    #endif

Rewrite Admob code

The Admob code is very ugly at the moment. We should rewrite it in the future.

Can QtFirebase be built standalone?

Hi.
I managed to build QtFirebaseExample and run it on iOS Simulator and my iPhone (6S, iOS 11.2.6). I have banner ads and interstitials running. I'm very excited to get this far. Thank you for making this code available!
My issue... I was only able to get the QtFirebase build to succeed when run as part of the QtFirebaseExample build. So far, I have not been able to build QtFirebase on its own as a library. Do you expect this to be possible?
Thank you.

QtFirebase support for Facebook and Google authentication

Dont get me wrong but is there any reasons why you didn't create wrappers for Facebook,Google,Twitter authentication? I will try to create them for my project but i wanted to ask is there any particular problem you faced or you just didn't have time to create them or any other reason that's not my business? :)

How to make subscribe to topic for Firebase cloud messaging

Hi, I have integrated QtFirebase successfully to my application and uploaded in Playstore everything is working fine and i really appreciate the contributors for helping to develop apps very quickly.
I need any docs or example to implement subscription for topics in Firebase cloud messaging.
one more issue i found in my app whenever the user clicks on the notification, one more notification is displaying with 'userclick true' message.

Admob: test ads not working due to "An internal SDK error"

I was able to integrate QtFirebase in my project. I copied the code from the example provided to display a banner ad in my application. When I use the test ad unit ID, the test ad is working as expected, however then I added my own devices to the list of test devices and tried to use my own ad unit ID and I get this:
QtFirebaseAdMobBase::load()::<lambda(const firebase::FutureBase&)>): QtFirebaseAdMobBanner(0xcc534ca0) ::load load failed ERROR code: 4 message: An internal SDK error occurred. D Notizie : qrc:/main.qml:105 (onError): qml: Banner failed with error code 4 and message An internal SDK error occurred.
I am not sure how I can fix the problem. This makes me think that ads won't even work in real apps published in the Play Store or App store

setCurrentScreen cannot be called with the same class and name

Sometimes the warning: setCurrentScreen cannot be called with the same class and name is printed from Firebase Analytics. This is probably because QtFirebaseAnalytics::setCurrentScreen(const QString &screenName, const QString &screenClass)currently takes a screen name and screen class as parameters but then uses the screenName parameter twice when it calls analytics::SetCurrentScreen.

androiddeplyqt crashing: NullPointerException

Hello,

I'm trying to use this in one of my apps. The build itself seems to complete, though as a final step, the androiddeployqt runs into trouble:

23:08:19: Starting: "/home/flo/Qt/5.9.2/android_armv7/bin/androiddeployqt" --input /home/flo/bb/build-ceemii-app-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_2_for_Android_armv7-Debug/android-libceemii-app.so-deployment-settings.json --output /home/flo/bb/build-ceemii-app-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_2_for_Android_armv7-Debug/android-build --deployment bundled --android-platform android-27 --jdk /usr/lib/jvm/java-8-openjdk-amd64 --gradle
Generating Android Package
Input file: /home/flo/bb/build-ceemii-app-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_2_for_Android_armv7-Debug/android-libceemii-app.so-deployment-settings.json
Output directory: /home/flo/bb/build-ceemii-app-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_2_for_Android_armv7-Debug/android-build/
Application binary: /home/flo/bb/build-ceemii-app-Android_for_armeabi_v7a_GCC_4_9_Qt_5_9_2_for_Android_armv7-Debug/libceemii-app.so
Android build platform: android-27
Install to device: No
Warning: QML import could not be resolved in any of the import paths: com.ameba
Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Material.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Universal.impl
QtFirebase using Firebase C++ SDK located in /home/flo/bb/ceemii-app/firebase_cpp_sdk (from system property firebase_cpp_sdk.dir)
QtFirebase (Firebase C++ SDK) using Android NDK located in /home/flo/tmp/ndk/android-ndk-r13 (from system property ndk_dir)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'android-build'.

java.lang.NullPointerException (no error message)

I tried this with QtCreator 4.5.0 on Qt 5.9.2 on a Linux host. NDK version is r13. Maybe you can point me to one direction what went wrong here? It does not seem to be an issue with the system itself, as your example program perfectly generates an APK. What i noticed though is that ... yours seemed to download and install a different gradle (4.1) while mine used 3.4

I have no idea what caused your example to fetch that 4.1 version ... maybe that would solve the issue already?

Crash on Android 6.0.1 while compiling with Qt 5.8

I'm getting stable crash on startup if compile with Qt 5.8. Works fine on Qt 5.7+android 6.0.1

D libApp.so: (null):0 ((null)): QtFirebaseAdMob(0xab7da928) ::QtFirebaseAdMob singleton
F libc : Fatal signal 6 (SIGABRT), code -6 in tid 635 (QtThread)

Seems the issue in the activity handle. I'm able to workaround it but really can't explain it.

  1. In QtFirebase class
    add member QAndroidJniObject m_activity;
  2. init in requestInit()
    if(!m_activity.isValid())
    {
    m_activity = QAndroidJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;");
    }
  3. Add member function
    jobject getNativeWindow(){return m_activity.object();}

All this stuff works only if m_activity is a member of QtFirebase by some reason.
Should I send pull request for it?

QT FIrebase on IOS Background App

Hello,
I used qtFirebase in android without any problem
In IOS i could receive notification while app is open but when app is in background I could not receive any message.
Could you help me?

Win 10, Qt5.8 Example project can't start - "Java class com/google/firebase/FirebaseApp not found"

Hi @Larpon
first of all, thank you for your project.
I catch exception when I try build example project, same as @isipisi281
"Java class com/google/firebase/FirebaseApp not found. Please verify the AAR which contains the com/google/firebase/FirebaseApp class is included in your app."
looks like I forget something small, but I can't found problem by myself

My environment:
Qt 5.8, Win 10,
SDK Tool 25.2.3
SDK google play services 40
NDK r10e
Device with Android 5.0.1

thanks for help

Crashes while ad loading on android

We have serveral crash reports on android in our last release... mostly while loading of banner and rewared ads... interstitials seems to be stable instead.

do you have any idea?

we shipped with:

  • latest QtFirebase (593032a)
  • firebase_cpp 5.2.0
  • qt 5.11.1

QtFirebaseAdMobBanner::loadInternal


pid: 0, tid: 0 >>> de.bitspree.pico.islands <<<

backtrace:
#00 pc 0000000000049b58 /system/lib/libc.so (tgkill+12)
#1 pc 00000000000472d3 /system/lib/libc.so (pthread_kill+34)
#2 pc 000000000001d575 /system/lib/libc.so (raise+10)
#3 pc 00000000000190c1 /system/lib/libc.so (__libc_android_abort+34)
#4 pc 0000000000017124 /system/lib/libc.so (abort+4)
#5 pc 000000000031b945 /system/lib/libart.so (_ZN3art7Runtime5AbortEPKc+328)
#6 pc 00000000000b561d /system/lib/libart.so (_ZN3art10LogMessageD2Ev+1132)
#7 pc 00000000001bcc23 /system/lib/libart.so (_ZN3art22IndirectReferenceTable3AddEjPNS_6mirror6ObjectE+194)
#8 pc 0000000000265e09 /system/lib/libart.so (_ZN3art3JNI17CallObjectMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list+456)
#9 pc 000000000011c273 /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN7_JNIEnv16CallObjectMethodEP8_jobjectP10_jmethodIDz+42)
#10 pc 000000000011fb85 /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN8firebase5admob18AdRequestConverterC1ENS0_9AdRequestE+640)
#11 pc 000000000011bf77 /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN8firebase5admob8internal25BannerViewInternalAndroid6LoadAdERKNS0_9AdRequestE+78)
#12 pc 000000000011d995 /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN8firebase5admob10BannerView6LoadAdERKNS0_9AdRequestE+34)
#13 pc 00000000000877cd /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN21QtFirebaseAdMobBanner12loadInternalEv+40)
#14 pc 0000000000085afb /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN19QtFirebaseAdMobBase4loadEv+224)
#15 pc 000000000010f2df /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so
#16 pc 000000000010f685 /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN19QtFirebaseAdMobBase11qt_metacallEN11QMetaObject4CallEiPPv+30)
#17 pc 000000000010f6d9 /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN25QtFirebaseAdMobBannerBase11qt_metacallEN11QMetaObject4CallEiPPv+8)
#18 pc 00000000001081b5 /data/app/de.bitspree.pico.islands-1/lib/arm/libQt5Qml.so (_ZN17QQmlVMEMetaObject8metaCallEP7QObjectN11QMetaObject4CallEiPPv+2584)


QtFirebaseAdMobRewardedVideoAd::loadInternal


pid: 0, tid: 0 >>> de.bitspree.pico.islands <<<

backtrace:
#00 pc 000000000004a1c0 /system/lib/libc.so (tgkill+12)
#1 pc 0000000000047953 /system/lib/libc.so (pthread_kill+34)
#2 pc 000000000001d955 /system/lib/libc.so (raise+10)
#3 pc 00000000000194a1 /system/lib/libc.so (__libc_android_abort+34)
#4 pc 00000000000170e8 /system/lib/libc.so (abort+4)
#5 pc 000000000031b5c5 /system/lib/libart.so (_ZN3art7Runtime5AbortEv+252)
#6 pc 00000000000b4d47 /system/lib/libart.so (_ZN3art10LogMessageD2Ev+866)
#7 pc 00000000001bd02f /system/lib/libart.so (_ZN3art22IndirectReferenceTable3AddEjPNS_6mirror6ObjectE+194)
#8 pc 000000000027cc99 /system/lib/libart.so (_ZN3art3JNI12NewStringUTFEP7_JNIEnvPKc+424)
#9 pc 000000000011f98b /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN8firebase5admob18AdRequestConverterC1ENS0_9AdRequestE+134)
#10 pc 000000000011d481 /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN8firebase5admob14rewarded_video8internal28RewardedVideoInternalAndroid6LoadAdEPKcRKNS0_9AdRequestE+96)
#11 pc 000000000011eb0d /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN8firebase5admob14rewarded_video6LoadAdEPKcRKNS0_9AdRequestE+40)
#12 pc 0000000000087885 /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN30QtFirebaseAdMobRewardedVideoAd12loadInternalEv+40)
#13 pc 0000000000085afb /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN19QtFirebaseAdMobBase4loadEv+224)
#14 pc 000000000010f2df /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so
#15 pc 000000000010f685 /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN19QtFirebaseAdMobBase11qt_metacallEN11QMetaObject4CallEiPPv+30)
#16 pc 000000000010f781 /data/app/de.bitspree.pico.islands-1/lib/arm/libpico-islands.so (_ZN30QtFirebaseAdMobRewardedVideoAd11qt_metacallEN11QMetaObject4CallEiPPv+8)
#17 pc 00000000001081b5 /data/app/de.bitspree.pico.islands-1/lib/arm/libQt5Qml.so (_ZN17QQmlVMEMetaObject8metaCallEP7QObjectN11QMetaObject4CallEiPPv+2584)

Resize ad banner on screen orientation change

On iOS (probably also Android) the ad banner does not adapt to a change in the view's width or height properties. The ad banner view should issue a new ad request in case the width or height changes. As an alternative (or better addition) it would be useful to manually tell the ad banner view to send a new ad request.

iOS Background notification - not working

Hello,

I can't receive any notification in background, it's fired when the application become active.
Did I forgot a setting? I activate Remote notification background on xcode and push notification capabilities.

Help

Great job guys! You are doing a very cool thing! Thanks you!

I had such a mistake, Having built in my application the package does not subscribe, have any ideas?

How to connect to MessageReceived signal from C++?

Hello. How can I receive message (and token) inside my application? For now I do like this:

auto firebase = QtFirebaseMessaging::instance(); Notification handler; QObject::connect(firebase, &QtFirebaseMessaging::messageReceived, &handler, &Notification::messageReceived);

Where Notification is my class. But I do not receive any signal. Also, no notification when App is opened.

Latest Changes broke Qt 5.9.6 compatibility

works with 5.11.1
failed with 5.9.6

http://doc.qt.io/qt-5/qmetaobject.html#invokeMethod-4
"This function was introduced in Qt 5.10."

../../sdk/qt-firebase/src/qtfirebaseadmob.cpp: In lambda function: ../../sdk/qt-firebase/src/qtfirebaseadmob.cpp:557:18: error: no matching function for call to 'QMetaObject::invokeMethod(QtFirebaseAdMobBase*, QtFirebaseAdMobBase::init()::<lambda(const firebase::FutureBase&)>::<lambda()>)' }); ^ ../../sdk/qt-firebase/src/qtfirebaseadmob.cpp:557:18: note: candidates are: In file included from ../../../../sdk/qt/5.9.6/android_armv7/include/QtCore/qobject.h:46:0, from ../../../../sdk/qt/5.9.6/android_armv7/include/QtCore/qiodevice.h:45, from ../../../../sdk/qt/5.9.6/android_armv7/include/QtCore/qtextstream.h:43, from ../../../../sdk/qt/5.9.6/android_armv7/include/QtCore/qdebug.h:49, from ../../../../sdk/qt/5.9.6/android_armv7/include/QtCore/QDebug:1, from ../../sdk/qt-firebase/src/platformutils.h:4, from ../../sdk/qt-firebase/src/qtfirebase.h:9, from ../../sdk/qt-firebase/src/qtfirebaseadmob.h:6, from ../../sdk/qt-firebase/src/qtfirebaseadmob.cpp:1: ../../../../sdk/qt/5.9.6/android_armv7/include/QtCore/qobjectdefs.h:406:17: note: static bool QMetaObject::invokeMethod(QObject*, const char*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) static bool invokeMethod(QObject *obj, const char *member, ^ ../../../../sdk/qt/5.9.6/android_armv7/include/QtCore/qobjectdefs.h:406:17: note: candidate expects 14 arguments, 2 provided ../../../../sdk/qt/5.9.6/android_armv7/include/QtCore/qobjectdefs.h:420:24: note: static bool QMetaObject::invokeMethod(QObject*, const char*, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) static inline bool invokeMethod(QObject *obj, const char *member, ^ ../../../../sdk/qt/5.9.6/android_armv7/include/QtCore/qobjectdefs.h:420:24: note: candidate expects 13 arguments, 2 provided ../../../../sdk/qt/5.9.6/android_armv7/include/QtCore/qobjectdefs.h:437:24: note: static bool QMetaObject::invokeMethod(QObject*, const char*, Qt::ConnectionType, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) static inline bool invokeMethod(QObject *obj, const char *member, ^ ../../../../sdk/qt/5.9.6/android_armv7/include/QtCore/qobjectdefs.h:437:24: note: candidate expects 13 arguments, 2 provided ../../../../sdk/qt/5.9.6/android_armv7/include/QtCore/qobjectdefs.h:454:24: note: static bool QMetaObject::invokeMethod(QObject*, const char*, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) static inline bool invokeMethod(QObject *obj, const char *member, ^ ../../../../sdk/qt/5.9.6/android_armv7/include/QtCore/qobjectdefs.h:454:24: note: no known conversion for argument 2 from 'QtFirebaseAdMobBase::init()::<lambda(const firebase::FutureBase&)>::<lambda()>' to 'const char*'

Renamed libraries in Firebase SDK

I tried to build your Example App and got an "library not found for -ladmob" error and the build doesn't
succeed.
It seems that the newest version of the Firebase SDK (4.5) has renamed the libraries in the "libs/ios/universal" folder. Instead of "libLIBNAME.a" they are named like this: "libfirebase_LIBNAME.a"

How do I have to change the .pri file to correct this? Or should I just build with Firebase SDK 4.2?

SFSafariViewController links error

thanks for this wonderful project, after following the setup guidelines, I receive these errors:

Undefined symbols for architecture x86_64:
"OBJC_CLASS$_SFSafariViewController", referenced from:
objc-class-ref in FirebaseAuth(FIRAuthURLPresenter_f9c1670c7b472e1f12d82d1c6f46940a.o)
"OBJC_CLASS$_FIRLifecycleEvents", referenced from:
objc-class-ref in FirebaseRemoteConfig(RCNConfigExperiment_8bc114fd2122a8a3d08208ec2bfe88e0.o)
"OBJC_CLASS$_FIRExperimentController", referenced from:
objc-class-ref in FirebaseRemoteConfig(RCNConfigExperiment_8bc114fd2122a8a3d08208ec2bfe88e0.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

it seems, SFSafariViewController is not found, is it due to the SDK or new policy on webiew?
any hint is appreciated...

[iOS] FirebaseCore/Firebasecore.h not found

Hello, and first of all thank you very much for all the huge work you put into this plugin !

I made it work perfectly with Android, but I have a problem under iOS.

I followed all of your steps. After downloading the Firebase iOS SDK, I unzip it and put it under the src/ios folder, (location of the sh script), this is the 5.8.0 of the SDK. But when building, I have the following error :

In file included from ..../src/ios/AppDelegate.mm:4 FirebaseCore/FirebaseCore.h file not found #import <FirebaseCore/FirebaseCore.h>

So I checked in the folder of the firebase SDK, and there is no FirebaseCore folder, maybe this come from the version of the iOS SDK ? I couldn't find zipped previous versions

Thank in advance for your help !

RemoteConfig crashes on subsequent calls to fetch()

RemoteConfig crashes @ line 355 .cpp file.

As soon as this is called:
remote_config::SetDefaults(defaults.get(), filteredMap.size());

defaults.get() and filteredMap.size() do work fine
defaults.get() gives a pointer and filteredMap.size() gives the count in the array setted in qml.

Tested on IOS with Firebase 4.1.0 and the latest pull.
Could someone test this if it crashes only 4 me?

Reload the Ad wont trigger `loadedChanged` signal after first time.

  1. After A Ad has loaded successfully , internal code will call setLoaded(true) to emit loadedChanged signal.

  2. But In some circumstance, we need re-load an Ad , then we should call ::load() again , but there is no code call the setLoaded(false) , so the reload wont emit loadedChanged signal any more.

  3. To fix this

    • change the loadedChanged() signal to loadedChanged(bool loaded)
    • call setLoaded(false) before every emit loading()

I will make a PR for this.

missing readyChanged of QtFirebaseRemoteConfig

On Android platform, by adding some qDebug output, I found that the following code in constructor

{
    __QTFIREBASE_ID = QString().sprintf("%8p", this);
    if(self == 0)
    {
        self = this;
        qDebug() << self << "::QtFirebaseRemoteConfig" << "singleton";
    }

    if(qFirebase->ready())
    {
        //Call init outside of constructor, otherwise signal readyChanged not emited
        qDebug() << this << "QtFirebase::is ready, call init after 500 msecs." ;
        QTimer::singleShot(500, this, SLOT(init()));
    }
    else
    {
        qDebug() << this << "QtFirebase::not ready, connect to ist readyChanged signal" ;
        connect(qFirebase,&QtFirebase::readyChanged, this, &QtFirebaseRemoteConfig::init);
        qFirebase->requestInit();
    }
    connect(qFirebase,&QtFirebase::futureEvent, this, &QtFirebaseRemoteConfig::onFutureEvent);
}

Their is a QTimer::singleShot to assure that QFirebaseRemoteConfig dont call init in constructor. But actually I found before the constructor finished, the init() is called . and according to the debug output, I found it is triggered by QtFirebase::readyChanged signal, which will let other code cannot catch the QtFirebaseRemoteConfig::readyChanged signal.

D/Sudoku Master(20622): (null):0 ((null)): QtFirebaseRemoteConfig(0x7a2c08d0) ::QtFirebaseRemoteConfig singleton
D/Sudoku Master(20622): (null):0 ((null)): QtFirebaseRemoteConfig(0x7a2c08d0) QtFirebase::not ready, connect to ist readyChanged signal
D/Sudoku Master(20622): (null):0 ((null)): QtFirebaseRemoteConfig(0x7a2c08d0) ::init called
I/firebase(20622): Remote Config API Initialized
D/Sudoku Master(20622): (null):0 ((null)): QtFirebaseRemoteConfig(0x7a2c08d0) ::init native initialized
D/Sudoku Master(20622): (null):0 ((null)): QtFirebaseRemoteConfig(0x7a2c08d0) ::setReady before: false now: true
D/Sudoku Master(20622): (null):0 ((null)): QtFirebaseRemoteConfig(0x7a2c08d0) ::instance singleton

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

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:

        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?

Compile errors need help

When following the steps for the example to build for ios I get some errors while compiling.

First is a header file is not found:
extensions/QtFirebase/src/ios/Firebase/Firebase.h:1:9: fatal error: 'FirebaseAnalytics/FirebaseAnalytics.h' file not found
#import <FirebaseAnalytics/FirebaseAnalytics.h>

I commented the import out and then I get linking errors, below is the output. Any help is greatly appreciated.

Undefined symbols for architecture arm64:
"OBJC_CLASS$_FIRApp", referenced from:
objc-class-ref in FirebaseMessaging(FIRMessaging+FIRApp_990c986890993e9ee1072f08cac17bb3.o)
"_kServiceInfoFileName", referenced from:
-[FIRMessaging(FIRApp) exitApp:withError:] in FirebaseMessaging(FIRMessaging+FIRApp_990c986890993e9ee1072f08cac17bb3.o)
"_kServiceInfoFileType", referenced from:
-[FIRMessaging(FIRApp) exitApp:withError:] in FirebaseMessaging(FIRMessaging+FIRApp_990c986890993e9ee1072f08cac17bb3.o)
"_kFIRAppIsDefaultAppKey", referenced from:
+[FIRMessaging(FIRApp) didReceiveConfigureSDKNotification:] in FirebaseMessaging(FIRMessaging+FIRApp_990c986890993e9ee1072f08cac17bb3.o)
"_kFIRAppNameKey", referenced from:
+[FIRMessaging(FIRApp) didReceiveConfigureSDKNotification:] in FirebaseMessaging(FIRMessaging+FIRApp_990c986890993e9ee1072f08cac17bb3.o)
"_kFIRAppReadyToConfigureSDKNotification", referenced from:
+[FIRMessaging(FIRApp) load] in FirebaseMessaging(FIRMessaging+FIRApp_990c986890993e9ee1072f08cac17bb3.o)
"_FIRLogBasic", referenced from:
-[FIRMessagingLogger logFuncDebug:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_790219f59b0990edc1544b20c012dab3.o)
-[FIRMessagingLogger logFuncInfo:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_790219f59b0990edc1544b20c012dab3.o)
-[FIRMessagingLogger logFuncNotice:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_790219f59b0990edc1544b20c012dab3.o)
-[FIRMessagingLogger logFuncWarning:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_790219f59b0990edc1544b20c012dab3.o)
-[FIRMessagingLogger logFuncError:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_790219f59b0990edc1544b20c012dab3.o)
"OBJC_CLASS$_FIRReachabilityChecker", referenced from:
objc-class-ref in FirebaseMessaging(FIRMessaging_deafbc79d85e7151d21253034afabe34.o)
"_kFIRServiceMessaging", referenced from:
-[FIRMessaging(FIRApp) configureMessaging:] in FirebaseMessaging(FIRMessaging+FIRApp_990c986890993e9ee1072f08cac17bb3.o)
-[FIRMessaging(FIRApp) exitApp:withError:] in FirebaseMessaging(FIRMessaging+FIRApp_990c986890993e9ee1072f08cac17bb3.o)
"typeinfo for firebase::messaging::Listener", referenced from:
typeinfo for MessageListener in moc_qtfirebasemessaging.o
"vtable for firebase::messaging::Listener", referenced from:
firebase::messaging::Listener::Listener() in qtfirebasemessaging.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"OBJC_CLASS$_FIRInstanceID", referenced from:
objc-class-ref in FirebaseMessaging(FIRMessaging_deafbc79d85e7151d21253034afabe34.o)
"firebase::messaging::Listener::~Listener()", referenced from:
MessageListener::~MessageListener() in moc_qtfirebasemessaging.o
"firebase::messaging::Terminate()", referenced from:
QtFirebaseMessaging::~QtFirebaseMessaging() in qtfirebasemessaging.o
"_kFirebaseCloudMessagingErrorDomain", referenced from:
-[FIRMessaging(FIRApp) configureMessaging:] in FirebaseMessaging(FIRMessaging+FIRApp_990c986890993e9ee1072f08cac17bb3.o)
-[FIRMessaging(FIRApp) exitApp:withError:] in FirebaseMessaging(FIRMessaging+FIRApp_990c986890993e9ee1072f08cac17bb3.o)
"firebase::App::Create(firebase::AppOptions const&)", referenced from:
QtFirebase::requestInit() in qtfirebase.o
"_kFIRLoggerMessaging", referenced from:
-[FIRMessagingLogger logFuncDebug:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_790219f59b0990edc1544b20c012dab3.o)
-[FIRMessagingLogger logFuncInfo:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_790219f59b0990edc1544b20c012dab3.o)
-[FIRMessagingLogger logFuncNotice:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_790219f59b0990edc1544b20c012dab3.o)
-[FIRMessagingLogger logFuncWarning:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_790219f59b0990edc1544b20c012dab3.o)
-[FIRMessagingLogger logFuncError:messageCode:msg:] in FirebaseMessaging(FIRMessagingLogger_790219f59b0990edc1544b20c012dab3.o)
"firebase::messaging::Initialize(firebase::App const&, firebase::messaging::Listener*)", referenced from:
QtFirebaseMessaging::init() in qtfirebasemessaging.o
"firebase::g_messaging_initializer", referenced from:
firebase::messaging_ref in qtfirebase_register.o
firebase::messaging_ref in qtfirebasemessaging.o
firebase::messaging_ref in moc_qtfirebasemessaging.o
ld: symbol(s) not found for architecture x86_64

Android application broken on Auth.

Hi! My application is crashing on authorization step.
Here is function that occur crash:
m_auth = auth::Auth::GetAuth(qFirebase->firebaseApp());
Message:
W System.err: java.lang.NoSuchMethodError: no non-static method "Lcom/google/firebase/auth/FirebaseUser;.getMetadata()Lcom/google/firebase/auth/FirebaseUserMetadata;" E firebase: method_ids[i] || method.optional F firebase: Unable to find Method com/google/firebase/auth/FirebaseUser.getMetadata (signature '()Lcom/google/firebase/auth/FirebaseUserMetadata;', instance). Please verify the AAR which contains the com/google/firebase/auth/FirebaseUser class is included in your app.

grandle.build file:

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
    }
}

project.ext {
    // Configure the Firebase C++ SDK location.
    firebase_cpp_sdk_dir = System.getProperty('firebase_cpp_sdk.dir')
    firebaseSdkUsed = 'system property firebase_cpp_sdk.dir'

    if (firebase_cpp_sdk_dir == null || firebase_cpp_sdk_dir.isEmpty()) {
        firebase_cpp_sdk_dir = System.getenv('FIREBASE_CPP_SDK_DIR')
        firebaseSdkUsed = 'system env variable FIREBASE_CPP_SDK_DIR'
        if (firebase_cpp_sdk_dir == null || firebase_cpp_sdk_dir.isEmpty()) {
            if ((new File('firebase_cpp_sdk')).exists()) {
                firebase_cpp_sdk_dir = 'firebase_cpp_sdk'
            } else {
                throw new StopActionException(
                    'firebase_cpp_sdk.dir property or the FIREBASE_CPP_SDK_DIR ' +
                    'environment variable must be set to reference the Firebase C++ ' +
                    'SDK install directory.  This is used to configure static library ' +
                    'and C/C++ include paths for the SDK.'
                )
            }
        }
    }

    if (!(new File(firebase_cpp_sdk_dir)).exists()) {
        throw new StopActionException(
            sprintf('Firebase C++ SDK directory %s does not exist', firebase_cpp_sdk_dir)
        )
    }
    println 'QtFirebase using Firebase C++ SDK located in ' + firebase_cpp_sdk_dir + ' (from ' + firebaseSdkUsed + ')'
}

repositories {
    flatDir {
        dirs project.ext.firebase_cpp_sdk_dir + "/libs/android"
    }
}

apply plugin: 'com.android.application'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.facebook.android:facebook-android-sdk:3+'

    compile 'com.android.support:multidex:1.+'

    compile 'com.android.support:appcompat-v7:25.0.1'         // Optional??
    compile 'com.google.android.gms:play-services-base:11.0.4'  // Mandatory - Firebase rely on Google Play services

    // For AdMob support
    compile 'com.google.firebase:firebase-ads:11.0.4'

    // For Google Analytics support
    compile 'com.google.firebase:firebase-core:11.0.4'         // Recommended package
    // compile 'com.google.firebase:firebase-analytics:11.0.4' // deprecated

    // For RemoteConfig support
    compile 'com.google.firebase:firebase-config:11.0.4'

    // For Messaging support
    compile 'com.google.firebase:firebase-messaging:11.0.4'
    compile 'com.google.firebase.messaging.cpp:firebase_messaging_cpp@aar'

    // For Auth support
    compile 'com.google.firebase:firebase-auth:11.0.4'

    // For Database support
    compile 'com.google.firebase:firebase-database:11.0.4'
}

android {
    /*******************************************************
     * The following variables:
     * - androidBuildToolsVersion,
     * - androidCompileSdkVersion
     * - qt5AndroidDir - holds the path to qt android files
     *                   needed to build any Qt application
     *                   on Android.
     *
     * are defined in gradle.properties file. This file is
     * updated by QtCreator and androiddeployqt tools.
     * Changing them manually might break the compilation!
     *******************************************************/

    compileSdkVersion androidCompileSdkVersion.toInteger()

    buildToolsVersion androidBuildToolsVersion

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
            aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
            res.srcDirs = [qt5AndroidDir + '/res', 'res']
            resources.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            assets.srcDirs = ['assets']
            jniLibs.srcDirs = ['libs']
       }
    }

    lintOptions {
        abortOnError false
    }
    defaultConfig {
        applicationId "com.lookmygame.app" // Used by Firebase auto-config (the google-services.json from Firebase console)
        //minSdkVersion 14
        //targetSdkVersion 25
        //versionCode 1
        //versionName "1.0"

        //testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        vectorDrawables.useSupportLibrary = true

        // Enabling multidex support.
        multiDexEnabled = true

    }
}

apply plugin: 'com.google.gms.google-services'

Crash reports in firebase::App::GetInstance

I published my app to Google Play Market, but By add Admob features, the crash reports increased.
Because my phone did not crash, so I cannot determine why this happen? Does it caused by thread issues? Any idea can help to fix this or further determine the reason?

crash

Why RewardedVideoAd does not work?

I am testing QtFirebaseRewardedVideoAd today, but always got :

QtFirebaseAdMobRewardedVideoAd(0x77cc9f98) ::onFutureEvent load failed ERROR code: 7 message: "No ad was available to serve."

I am not using it in QML but in C++ code, here is the coded related, AdMob is a c++ class in my own code:

m_rewardedVideoAd->setAdUnitId("ca-app-pub-3940256099942544/5224354917");
connect(m_rewardedVideoAd, &QtFirebaseAdMobRewardedVideoAd::readyChanged, this, &AdMob::onVideoAdReady);
connect(m_rewardedVideoAd, &QtFirebaseAdMobRewardedVideoAd::loadedChanged, this, &AdMob::onVideoAdLoaded);
connect(m_rewardedVideoAd, &QtFirebaseAdMobRewardedVideoAd::closed, this, &AdMob::onVideoAdClosed);
connect(m_rewardedVideoAd, &QtFirebaseAdMobRewardedVideoAd::rewarded, this, &AdMob::onVideoAdRewarded);

void AdMob::onVideoAdReady()
{
    qDebug() << "QtFirebaseAdMobRewarededVideoAd::ready";
    QtFirebaseAdMobRequest *_request = new QtFirebaseAdMobRequest(m_rewardedVideoAd);
    _request->setTestDevices(m_testDevices);
    m_rewardedVideoAd->setRequest(_request);
    m_rewardedVideoAd->load();
}

void AdMob::onVideoAdLoaded()
{
    qDebug() << "AdMob::onVideoAdLoaded";
}

void AdMob::onVideoAdClosed()
{
    qDebug() << "AdMob::onVideoAdClosed";
    m_rewardedVideoAd->load();
}

void AdMob::onVideoAdRewarded(QString type, float value)
{
    qDebug() << "AdMob::onViedoAdRewarded" << type << value;
}

Has anybody tested this Ad format ? Anything was wrong in my code ?

Question: Desktop platform?

I know the official C++ SDK only targets iOS + Android only with a desktop stubs.

But does this library makes necessary steps to make some features to work on desktops? Like, for example, using the REST API for the Realtime database.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.