cutelyst / firebase-qt

Qt Wrapper for Firebase C++ API
MIT License
19 stars 5 forks source link

no matching function for call to 'Create' #3

Open shokarta opened 1 month ago

shokarta commented 1 month ago

Hello... I am recreating all your guide (just the part of receiving notificaitons, sending I am not realy interest in this specific app) from: https://www.youtube.com/watch?v=QsuoYGysekY but I also all rewrite to CMake, and at point of video 16:45 when I try to build to see if all works (so far of course), i see an error:

C:\Qt\Projects\Sources\MyProject\firebase-qt\src\firebaseqtapp.cpp:96: error: no matching function for call to 'Create'

C:/Qt/Projects/Sources/MyProject/firebase-qt/src/firebaseqtapp.cpp:96:14: error: no matching function for call to 'Create'
    d->app = ::firebase::App::Create(options, &*env, QNativeInterface::QAndroidApplication::context());
             ^~~~~~~~~~~~~~~~~~~~~~~
C:/Qt/Projects/Sources/MyProject/firebase_cpp_sdk/include/firebase/app.h:519:15: note: candidate function not viable: no known conversion from 'QtJniTypes::Context' to 'jobject' (aka '_jobject *') for 3rd argument
  static App* Create(const AppOptions& options, JNIEnv* jni_env,
              ^
C:/Qt/Projects/Sources/MyProject/firebase_cpp_sdk/include/firebase/app.h:482:15: note: candidate function not viable: requires 2 arguments, but 3 were provided
  static App* Create(JNIEnv* jni_env, jobject activity);
              ^
C:/Qt/Projects/Sources/MyProject/firebase_cpp_sdk/include/firebase/app.h:563:15: note: candidate function not viable: requires 4 arguments, but 3 were provided
  static App* Create(const AppOptions& options, const char* name,
              ^

in file firebaseqtapp.cpp on line 96

dantti commented 1 month ago

It's been a while since I had a need for this, but one important thing is to use the firebase sdk version that was on that tutorial, newer versions do not work, I started another project trying to use cmake and newer version but it's on halt ATM so no update here yet.

shokarta commented 1 month ago

Hello @dantti, first of all I follow you for a long time already, and I have to thank you for your great work! Very good news hearing from you that you are working on cmake solution of current version :) I will unpatiently wait for it... please link it here or make it well known when its out... As you know there are not many usefull examples/guides on this topic online :(. For the time being, I will try to get the SDK version of what was current at date of video making... the C++ will be easy to get, but the iOS SDK probably not as oon firebase homepage is only link to current... by any chance you wont be able to get the iOS SDK of what you used and post it online?

shokarta commented 3 weeks ago

hello @dantti, so according to your recomendation, for now I did rebuilt all the project from CMake to QMake. However this is still the only issue... I used C++ SDK which was current at the tiem you uploaded that video (16.2.2022) which is version 8.9.0, and this repo has no versions so it should work... however I still having this one error all over: image tried all lower versions of c++ sdk up to 7.3.0 with same result... so when crosschecked that firebasee sdk c++ version is not an issue, only posibility I see is issue in your code... would be posible for you to check? as this is for us only blocking point to make your work posible to build... the issue realy is: image

dantti commented 3 weeks ago

Qt changed that context() object in recent versions something like to<jobject>() should fix it

shokarta commented 3 weeks ago

@dantti you are the best :) if this will help anyone, then after I fixed that conversion simply: QNativeInterface::QAndroidApplication::context().object() but then I have milion of errors when declared: Firebase fb; in main.cpp after all day figuring out, of course newest Firebase C++ SDKs works... so using old ones as suggested was not good move :D... so finaly after weeks of figuring out the Firebase Push notifications work on QMake... so much looking forward for new CMake solution