gameDNAstudio / gameDNAinstaller

Automatic SDK downloader and installer for gameDNA's plugins
https://www.gamednastudio.com
Other
34 stars 7 forks source link

cannot initialize ultimate mobile kit #11

Open ashigirl96 opened 4 years ago

ashigirl96 commented 4 years ago

Success to install

==================================================
Library Firebase Android SDK installed successfully!
==================================================

==================================================
==================================================
====== ALL LIBRARIES INSTALLED SUCCESSFULLY ======
==================================================
==================================================

Plugin installed successfully
Plugins list refreshed successfully

Configuration

config

config

Program

config

Output Log

LogUltimateMobileKit: Ultimate Mobile Kit CreateSubsystem!
LogUltimateMobileKit: Warning: Ultimate Mobile Kit API failed to initialize!
LogUltimateMobileKit: Display: Firebase App Shutdown
LogUltimateMobileKit: Display: Firebase Analytics Shutdown
LogUltimateMobileKit: Display: Firebase Authentication Shutdown
LogUltimateMobileKit: Display: Firebase Config Shutdown
LogUltimateMobileKit: Display: Firebase Crashlytics Shutdown
LogUltimateMobileKit: Display: Firebase In-App Messaging Shutdown
LogUltimateMobileKit: Display: Firebase Instance Id Shutdown
LogUltimateMobileKit: Display: Firebase Invites Shutdown
LogUltimateMobileKit: Display: Firebase Links Shutdown
LogUltimateMobileKit: Display: Firebase Messaging Shutdown
LogUltimateMobileKit: Display: Firebase Performance Shutdown
LogUltimateMobileKit: Display: Firebase Storage Shutdown
LogUltimateMobileKit: Display: Firebase Test Lab Shutdown
LogBlueprintUserMessages: [ThirdPersonCharacter_167] Api Not Available
ghost commented 4 years ago

I guess the problem is, that you´re running it on desktop, and for desktop there is with this plugin no api available.

Give me a couple of days, i´ve made a change locally to my version in order to make it working basically for desktop too for improved development.

As the author is not taking the responsibility for his tools anymore, i need to get the plugin working for 4.24 too

ghost commented 4 years ago

For a quick solution check: FirebaseApp.cpp, i´ve added something like:

const bool FFirebaseApp::Init() { if (IsInitialized()) { return true; }

// Settings
const UUltimateMobileKitSettings* DefaultSettings = GetDefault<UUltimateMobileKitSettings>();

if WITH_ULTIMATEMOBILEKIT

if (firebase::App::GetInstance() == nullptr)
{

if PLATFORM_WINDOWS

    firebase::AppOptions Options = firebase::AppOptions();
    Options.set_app_id(TCHAR_TO_ANSI(*DefaultSettings->FirebaseAppIdAndroid));
    Options.set_api_key(TCHAR_TO_ANSI(*DefaultSettings->FirebaseApiKeyAndroid));
    Options.set_project_id(TCHAR_TO_ANSI(TEXT("yourProjectIDFromFirebase")));
    Options.set_database_url(TCHAR_TO_ANSI(*DefaultSettings->FirebaseDatabaseURLAndroid));
    Options.set_messaging_sender_id(TCHAR_TO_ANSI(*DefaultSettings->FirebaseCloudMessagingSenderIdAndroid));
    Options.set_storage_bucket(TCHAR_TO_ANSI(*DefaultSettings->FirebaseGoogleCloudStorageBucketNameAndroid));
    FirebaseNativeAppPtr = MakeShareable(firebase::App::Create(Options));

elif PLATFORM_IOS

    FirebaseNativeAppPtr = MakeShareable(firebase::App::Create(firebase::AppOptions()));

elif PLATFORM_ANDROID

    JNIEnv* Env = FAndroidApplication::GetJavaEnv();
    jobject Activity = FAndroidApplication::GetGameActivityThis();

    if (Env && Activity)
    {
        FirebaseNativeAppPtr = MakeShareable(firebase::App::Create(firebase::AppOptions(), Env, Activity));
    }
    else
    {
        return false;
    }

endif

}
else
{
    FirebaseNativeAppPtr = MakeShareable(firebase::App::GetInstance());
}

bool bWasSuccessfullyInitialized = FirebaseNativeAppPtr.IsValid();
SetInitialized(bWasSuccessfullyInitialized);

return bWasSuccessfullyInitialized;

else

return false;

endif

}