playMaker

Author Topic: How to implement FirebaseSDK in Playmaker[SLOVED]  (Read 1243 times)

playmakertester

  • Full Member
  • ***
  • Posts: 211
How to implement FirebaseSDK in Playmaker[SLOVED]
« on: September 27, 2020, 11:11:04 PM »
I'm looking for an easy way to implement the Firebase Analytics SDK in Playmaker.
What do you recommend?
I'm looking at the official Firebase reference, but it seems that I need to load this snippet in each Scene, and I'm not familiar with C#, so I'm looking for a way to solve this problem with Playmaker.

Code: [Select]
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
  var dependencyStatus = task.Result;
  if (dependencyStatus == Firebase.DependencyStatus.Available) {
    // Create and hold a reference to your FirebaseApp,
    // where app is a Firebase.FirebaseApp property of your application class.
    //   app = Firebase.FirebaseApp.DefaultInstance;

    // Set a flag here to indicate whether Firebase is ready to use by your app.
  } else {
    UnityEngine.Debug.LogError(System.String.Format(
      "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
    // Firebase Unity SDK is not safe to use here.
  }
});

There seems to be a related asset in the store as well, but it's not rated and I'm worried about buying it.
« Last Edit: October 26, 2020, 04:05:59 PM by playmakertester »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to implement FirebaseSDK in Playmaker.
« Reply #1 on: September 28, 2020, 06:11:11 AM »
Hi.
@ start you could set a Singleton Manager action and then a Dont Destroy On Load.
this will make the object stay even when loading a different scene.

Then you could set the object as a global object if needed (for reference)


playmakertester

  • Full Member
  • ***
  • Posts: 211
Re: How to implement FirebaseSDK in Playmaker.
« Reply #2 on: September 28, 2020, 08:05:09 AM »
Thank you.
I would like to try the method you have taught me, so if you have any questions as I try, please let me ask them again.

playmakertester

  • Full Member
  • ***
  • Posts: 211
Re: How to implement FirebaseSDK in Playmaker.
« Reply #3 on: October 25, 2020, 07:38:16 PM »
Hi,

I'm trying to try the advice I've been given, but I couldn't do much with Singleton and Dont destroy on load when I looked it up.

Let me ask you a question.

1, What should I set for Singleton's Reference?
2,At the time of game start-up, an FSM like the one shown in the picture was attached to an empty game object, is this correct?

By the way, I added the following C# script as an add component to the above "Firebase Dont destory Obj" empty object.

Code: [Select]
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class StartUpObject : MonoBehaviour
{
    void Awake()
    {
        Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
            var dependencyStatus = task.Result;
            if (dependencyStatus == Firebase.DependencyStatus.Available) {
            // Create and hold a reference to your FirebaseApp,
            // where app is a Firebase.FirebaseApp property of your application class.
            //   app = Firebase.FirebaseApp.DefaultInstance;

            // Set a flag here to indicate whether Firebase is ready to use by your app.
            } else {
            UnityEngine.Debug.LogError(System.String.Format(
                "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
            // Firebase Unity SDK is not safe to use here.
            }
        });
    }
}
Best regards.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How to implement FirebaseSDK in Playmaker.
« Reply #4 on: October 26, 2020, 11:52:11 AM »
hi.
For reference you can set any name.

its just for if you want to remove the singleton.

playmakertester

  • Full Member
  • ***
  • Posts: 211
Re: How to implement FirebaseSDK in Playmaker[SLOVED]
« Reply #5 on: October 26, 2020, 04:06:25 PM »
Hi djaydino,

Thanks! got it.