Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
¿Cómo puedo abrir una escena específica desde la mensajería en la nube de firebase al hacer clic en Unity C#?

Estoy tratando de crear una aplicación de Unity en la que Firebase envíe notificaciones tanto a Android como a iOS. pero quiero abrir una escena específica cuando alguien haga clic en la notificación. No tengo idea de cómo hacer esto.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Creo que está buscando algo así como un enlace dinámico. Hay otro servicio de Firebase para eso llamado enlaces dinámicos aquí: https://firebase.google.com/docs/dynamic-links/unity/receive o enlaces profundos en la unidad aquí: https ://docs.unity3d.com/Manual/habilitación-deep-linking.html

over 4 years ago · Santiago Trujillo Report

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();

Función ObtenerExtras()

 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; }

Función ObtenerPropiedad

 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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!