Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

214
Vistas
How can I open a specific scene from the firebase cloud messaging on click in Unity C#

I am trying to make a Unity app in which firebase is sending notification to both android and iOS. but I want to open a specific scene when someone click on the notification. I don't have any idea how to do this.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

I think you are looking for something like a dynamic link there is another firebase service for that called dynamic links here- https://firebase.google.com/docs/dynamic-links/unity/receive or deep links in unity here - https://docs.unity3d.com/Manual/enabling-deep-linking.html

over 4 years ago · Santiago Trujillo Denunciar

0

var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
    var currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
    var intent = currentActivity.Call<AndroidJavaObject>("getIntent");
    var extras = GetExtras(intent);
    var sceneToLoad = GetProperty(extras, "<key to load in string>");
    var currentScene = SceneManager.GetActiveScene();

GetExtras() function

    private static AndroidJavaObject GetExtras(AndroidJavaObject intent)
{
    AndroidJavaObject extras = null;

    try
    {
        extras = intent.Call<AndroidJavaObject>("getExtras");
    }
    catch (Exception e)
    {
        Debug.LogError("firebaseScript.GetExtras()->" + e.Message);
    }

    return extras;
}

GetProperty function

    private static string GetProperty(AndroidJavaObject extras, string name)
{
    var s = string.Empty;
    try
    {
        s = extras.Call<string>("getString", name);
    }
    catch (Exception e)
    {
        Debug.LogError("firebaseScript.GetProperty() throws ->" + e.Message);
    }

    return s;
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda