Skip to content

Instantly share code, notes, and snippets.

View gmYusuf's full-sized avatar

Yusuf Altun gmYusuf

  • Mercedes
View GitHub Profile
public void ReadFromDatabase()
{
FirebaseDatabase database = FirebaseDatabase.DefaultInstance;
DatabaseReference myRef = database.GetReference("message");
ValueEventListener valueEventListener = new ValueEventListener();
myRef.AddValueEventListener(valueEventListener);
using UnityEngine;
using System.Collections;
using AndroidUtils;
namespace FirebaseUnityWrapper.Database.Event
{
public interface IValueEventListener
{
void onCancelled(DatabaseError error);
void onDataChange(DataSnapshot snapshot);
using UnityEngine;
using System.Collections;
using System;
using AndroidUtils;
namespace FirebaseUnityWrapper.Database.Event
{
public class ValueEventListenerWrapper : AndroidJavaProxy
{
protected readonly IValueEventListener mListener;
using FirebaseUnityWrapper.Auth;
using FirebaseUnityWrapper.Database;
using FirebaseUnityWrapper.Database.Event;
using FirebaseUnityWrapper.Storage;
using FirebaseUnityWrapper.Storage.StorageTask;
using GMSTasks;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
Material newMat = Resources.Load("Materials/Material/NewYear", typeof(Material)) as Material;
ball.GetComponent<MeshRenderer>().material = newMat;
public string GetSource(string key)
{
string source = "";
if (agc != null) source = agc.GetSource(key);
return source;
}
HMSRemoteConfigManager.LoadLastFetched();
HMSRemoteConfigManager.LoadLastFetched().getValueAsString("shape")}
Debug.Log($"Value: {HMSRemoteConfigManager.GetValueAsBoolean("Key")}");
Debug.Log($"Value: {HMSRemoteConfigManager.GetValueAsByteArray("Key")}");
Debug.Log($"Value: {HMSRemoteConfigManager.GetValueAsDouble("Key")}");
Debug.Log($"Value: {HMSRemoteConfigManager.GetValueAsLong("Key")}");
Debug.Log($"Value: {HMSRemoteConfigManager.GetValueAsString("Key")}");
public void Fetch()
{
ITask<ConfigValues> x = agc.Fetch();
x.AddOnSuccessListener((configValues) =>
{
OnFecthSuccess?.Invoke(configValues);
});
x.AddOnFailureListener((exception) =>
{
OnFecthFailure?.Invoke(exception);
@gmYusuf
gmYusuf / RemoteConfigDemo.cs
Created April 30, 2021 05:50
RemoteConfigDemo
using HuaweiMobileServices.RemoteConfig;
using HuaweiMobileServices.Utils;
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class RemoteConfigDemo : MonoBehaviour
{