Skip to main content

CutoutInfoObserver

If you were looking for the method for use with Unreal Engine, see CutoutInfoObserver for Unreal Engine SDK.

Register the callback of the Player Network SDK Notched Display module, the game needs to process the callback function. For more information on the callback data structure, see CutoutInfoResult.

note

It is strongly recommended to perform registration in the startup function of the game application.

Function definition

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

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

Code sample

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

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

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