Example #1
0
 private iOSConsentDialog()
 {
     mListener = NativeConsentDialogListener.GetListener();
     mListener.ToggleStateUpdated += OnNativeToggleStateUpdated;
     mListener.DialogCompleted    += OnNativeDialogCompleted;
     mListener.DialogDismissed    += OnNativeDialogDismissed;
 }
 void OnDestroy()
 {
     if (sInstance == this)
     {
         sInstance = null;
     }
 }
 /// <summary>
 /// Creates a gameobject for use with UnitySendMessage from native side.
 /// Must be called from Unity game thread.
 /// </summary>
 public static NativeConsentDialogListener GetListener()
 {
     if (sInstance == null)
     {
         var go = new GameObject(NATIVE_CONSENT_DIALOG_LISTENER_GO);
         go.hideFlags = HideFlags.HideAndDontSave;
         sInstance    = go.AddComponent <NativeConsentDialogListener>();
         DontDestroyOnLoad(go);
     }
     return(sInstance);
 }
Example #4
0
        private iOSConsentDialogListenerInfo GetListenerInfo(NativeConsentDialogListener listener)
        {
            var info = new iOSConsentDialogListenerInfo();
            info.name = listener.ListenerName;
            info.onToggleBecameOnHandler = listener.ToggleBecameOnHandlerName;
            info.onToggleBecameOffHandler = listener.ToggleBecameOffHandlerName;
            info.onDialogCompletedHandler = listener.DialogCompletedHandlerName;
            info.onDialogDismissedHandler = listener.DialogDismissedHandlerName;

            return info;
        }
Example #5
0
        private AndroidConsentDialog()
        {
            mAndroidJavaObject = new AndroidJavaObject(FacadeClassName);
            mIsShowing         = false;

            mListener = NativeConsentDialogListener.GetListener();
            mListener.ToggleStateUpdated += OnNativeToggleStateUpdated;
            mListener.DialogCompleted    += OnNativeDialogCompleted;
            mListener.DialogDismissed    += OnNativeDialogDismissed;

            mCompleted += (_, __, ___) => mIsShowing = false;
            mDismissed += _ => mIsShowing = false;
        }