Skip to main content

Asynchronous cutout screen information retrieval interface callback (CutoutInfoObserver)

If you are using Unreal Engine, please refer to CutoutInfoObserver in the Unreal Engine SDK.

The callback for asynchronously retrieving information about irregular-shaped screens. The game must register a callback to handle this.For more information about the callback data structure, please refer to CutoutInfoResult.

note

It is strongly recommended that games register during the application start-up function.

Function definition

// Add INTLCutoutInfo callback
public static void AddCutoutInfoObserver(OnINTLResultHandler<INTLCutoutInfo> callback);

// Remove INTLCutoutInfo callback
public static void RemoveCutoutInfoObserver(OnINTLResultHandler<INTLCutoutInfo> callback);

Code sample

// Add callback
public void AddCutoutObserver()
{
#if UNITY_ANDROID
INTLAPI.AddCutoutInfoObserver(OnCutoutInfoResultEvent);
#endif
}

// Remove callback
public void RemoveCutoutObserver()
{
#if UNITY_ANDROID
INTLAPI.RemoveCutoutInfoObserver(OnCutoutInfoResultEvent);
#endif
}

// Callback handling for INTLCutoutInfo
#if UNITY_ANDROID
public void OnCutoutInfoResultEvent(INTLCutoutInfo data)
{
Debug.Log("OnCutoutInfoResultEvent");
m_sample.ShowLogInNewLine("Cutout info:" + Tools.Instance.GetRetString(data));
}
#endif