Activating eye calibration directly from app

Hey all!

In my unity app I give the user the option to open the custom fit magic leap app in a similiar manner to the how its depicted in the custom fit example scenes. It works great but I was wondering if it’s possible to start eye calibration automatically without the friction of navigating to it inside the custom fit app.

Thanks for the help!
Gal.

Unity Editor version: 2022.3.16.f1
ML2 OS version: 1.9
Unity SDK version:1.12.1
Host OS: Windows

Hi @GalLibba,

I would recommend our page for Magic Leap specific Intents.

This can take you directly to eye calibration.

Let me know if you have any questions.

1 Like

thanks @etucker, after some digging i made it work. I attach the code snippet that worked for me in order to launch auto eye calibration for future use of others:

 public static void OpenAutomaticEyeCalibration()
 {
     using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
     {
         using (AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
         {
             using (AndroidJavaObject intent = new AndroidJavaObject("android.content.Intent", "com.magicleap.intent.action.EYE_CALIBRATION_AUTOMATIC"))
             {
                 currentActivity.Call("startActivity", intent);
              }
         }
      }
  }
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.