larpon / qtfirebase Goto Github PK
View Code? Open in Web Editor NEWAn effort to bring Google's Firebase C++ API to Qt + QML
License: MIT License
An effort to bring Google's Firebase C++ API to Qt + QML
License: MIT License
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.
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.
All this stuff works only if m_activity is a member of QtFirebase by some reason.
Should I send pull request for it?
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
.
AdMobInterstitial {
...
onError: {
// code and message == undefined
}
}
Same thing for AdMobBanner
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
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?
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.
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
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 ?
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?
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*'
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:
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)
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 !
...and upgrade to firebase 4.0, thanks!
Hello,
I have a problem with Messeging plugin, the plugin is intialized and ready but it does not retrieve the token.
I put it in my manifest
my android ndk version is 14b
I've forgot something?
Hello,
I have this error when I try to compile qtfirebase:
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.
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
Hi together,
so i got the problem that i cant compile the example project. My include paths are all ok.
Here a pic of my Build-Problems: https://www2.pic-upload.de/img/32896123/Error.png
Hope you can help me.
Regards Isy
QtFirebase hard for use in project
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
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?
One step less of a pain when setting up and building on iOS
Currently crashes in the QtFirebaseExample app when the Loader
loads it the second time.
Might be because of the use of ModuleInitializer?
Workaround it by having your RemoteConfig
only initialized once per. application life-cycle
Implement similar availability checks
for Google Services in corresponding modules
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.
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
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?
Hi. When keyboard is activated admob banner is still on. How can I hide it behind keyboard? Thanks!
Screenshot: https://ibb.co/nu5NPw
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)
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
The Admob code is very ugly at the moment. We should rewrite it in the future.
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?
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.
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...
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
After A Ad has loaded successfully , internal code will call setLoaded(true)
to emit loadedChanged
signal.
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.
To fix this
loadedChanged()
signal to loadedChanged(bool loaded)
setLoaded(false)
before every emit loading()
I will make a PR for this.
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.
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'
We could try to collect all futures, when they're used, in a list and traverse that list upon shutdown and then shut them down with ::Release()
@larpon Is there any difficulties to implement Native Ad?
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? :)
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.
I have this error when I try to compile test project (QtFirebaseExample) on the last version of xcode with ios 11 (on emulator)
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.
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.
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?
... not sure what to do about this yet
I fixed it local. WIll push it tomorow.
How add QtFirebase to Qt Plugins ?
CONFIG += QtFirebase
or
QT += QtFirebase
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.