Exemple #1
0
        public static AppCenterTask <ErrorReport> GetLastSessionCrashReportAsync()
        {
            var errorReportPtr = appcenter_unity_crashes_last_session_crash_report();
            var errorReport    = GetErrorReportFromIntPtr(errorReportPtr);

            return(AppCenterTask <ErrorReport> .FromCompleted(errorReport));
        }
Exemple #2
0
        public static AppCenterTask <string> GetInstallIdAsync()
        {
            AndroidJavaObject future = _appCenter.CallStatic <AndroidJavaObject>("getInstallId");
            var javaUUIDtask         = new AppCenterTask <AndroidJavaObject>(future);
            var stringTask           = new AppCenterTask <string>();

            javaUUIDtask.ContinueWith(t =>
            {
                var installId = t.Result == null ? null : t.Result.Call <string>("toString");
                stringTask.SetResult(installId);
            });
            return(stringTask);
        }
        public static AppCenterTask <string> GetInstallIdAsync()
        {
            Prepare();
            var installIdTask = UWPAppCenter.GetInstallIdAsync();
            var stringTask    = new AppCenterTask <string>();

            installIdTask.ContinueWith(t =>
            {
                var installId = t.Result?.ToString();
                stringTask.SetResult(installId);
            });
            return(stringTask);
        }
        public static AppCenterTask <ErrorReport> GetLastSessionCrashReportAsync()
        {
            var future          = _crashes.CallStatic <AndroidJavaObject>("getLastSessionCrashReport");
            var javaTask        = new AppCenterTask <AndroidJavaObject>(future);
            var errorReportTask = new AppCenterTask <ErrorReport>();

            javaTask.ContinueWith(t =>
            {
                var errorReport = JavaObjectsConverter.ConvertErrorReport(t.Result);
                errorReportTask.SetResult(errorReport);
            });
            return(errorReportTask);
        }
Exemple #5
0
 public static AppCenterTask <UserInformation> SignInAsync()
 {
     if (_signInTask != null)
     {
         var localSignInTask = new AppCenterTask <UserInformation>();
         var exception       = new Exception("Sign-in already in progress");
         localSignInTask.SetException(exception);
         return(localSignInTask);
     }
     else
     {
         // Create a local variable to avoid race condition
         var localSignInTask = new AppCenterTask <UserInformation>();
         _signInTask = localSignInTask;
         appcenter_unity_auth_sign_in_with_completion_handler(SignInCompletionHandlerNativeFunc);
         return(localSignInTask);
     }
 }
Exemple #6
0
 public static void SignInCompletionHandlerNativeFunc(IntPtr userInformationPtr, IntPtr nsErrorPtr)
 {
     if (_signInTask == null)
     {
         return;
     }
     else
     {
         var userInformation = GetUserInformationFromIntPtr(userInformationPtr);
         if (nsErrorPtr == IntPtr.Zero)
         {
             _signInTask.SetResult(userInformation);
         }
         else
         {
             _signInTask.SetException(NSErrorHelper.ToSystemException(nsErrorPtr));
         }
         _signInTask = null;
     }
 }
Exemple #7
0
        public static AppCenterTask <UserInformation> SignInAsync()
        {
            var future     = _auth.CallStatic <AndroidJavaObject>("signIn");
            var javaTask   = new AppCenterTask <AndroidJavaObject>(future);
            var signInTask = new AppCenterTask <UserInformation>();

            javaTask.ContinueWith(t =>
            {
                var exception = t.Result.Call <AndroidJavaObject>("getException");
                if (exception == null)
                {
                    var userInfo    = t.Result.Call <AndroidJavaObject>("getUserInformation");
                    var accountId   = userInfo.Call <string>("getAccountId");
                    var accessToken = userInfo.Call <string>("getAccessToken");
                    var idToken     = userInfo.Call <string>("getIdToken");
                    signInTask.SetResult(new UserInformation(accountId, accessToken, idToken));
                }
                else
                {
                    signInTask.SetException(ConvertException(exception));
                }
            });
            return(signInTask);
        }
Exemple #8
0
 public static AppCenterTask <bool> IsEnabledAsync()
 {
     return(AppCenterTask <bool> .FromCompleted(false));
 }
Exemple #9
0
 public static AppCenterTask <bool> HasCrashedInLastSessionAsync()
 {
     return(AppCenterTask <bool> .FromCompleted(false));
 }
Exemple #10
0
        public static AppCenterTask <bool> HasCrashedInLastSessionAsync()
        {
            var hasCrashedInLastSession = appcenter_unity_crashes_has_crashed_in_last_session();

            return(AppCenterTask <bool> .FromCompleted(hasCrashedInLastSession));
        }
Exemple #11
0
 public static AppCenterTask SetEnabledAsync(bool enabled)
 {
     return(AppCenterTask.FromCompleted());
 }
Exemple #12
0
        public static AppCenterTask <string> GetInstallIdAsync()
        {
            var installId = appcenter_unity_get_install_id();

            return(AppCenterTask <string> .FromCompleted(installId));
        }
Exemple #13
0
 public static AppCenterTask <UserInformation> SignInAsync()
 {
     return(AppCenterTask <UserInformation> .FromCompleted(null));
 }
Exemple #14
0
 public static AppCenterTask SetEnabledAsync(bool isEnabled)
 {
     appcenter_unity_set_enabled(isEnabled);
     return(AppCenterTask.FromCompleted());
 }
Exemple #15
0
        public static AppCenterTask <bool> IsEnabledAsync()
        {
            var isEnabled = appcenter_unity_is_enabled();

            return(AppCenterTask <bool> .FromCompleted(isEnabled));
        }
Exemple #16
0
        public static AppCenterTask <bool> HasReceivedMemoryWarningInLastSessionAsync()
        {
            var hadWarning = appcenter_unity_crashes_has_received_memory_warning_in_last_session();

            return(AppCenterTask <bool> .FromCompleted(hadWarning));
        }
Exemple #17
0
 public static AppCenterTask <string> GetMinidumpDirectoryAsync()
 {
     return(AppCenterTask <string> .FromCompleted(""));
 }
Exemple #18
0
 public static AppCenterTask SetEnabledAsync(IntPtr transmissionTarget, bool enabled)
 {
     appcenter_unity_transmission_target_set_enabled(transmissionTarget, enabled);
     return(AppCenterTask.FromCompleted());
 }
Exemple #19
0
 public static AppCenterTask <bool> HasReceivedMemoryWarningInLastSessionAsync()
 {
     return(AppCenterTask <bool> .FromCompleted(false));
 }
Exemple #20
0
 public static AppCenterTask <bool> IsEnabledAsync(RawType transmissionTarget)
 {
     return(AppCenterTask <bool> .FromCompleted(false));
 }
Exemple #21
0
 public static AppCenterTask SetEnabledAsync(RawType transmissionTarget, bool enabled)
 {
     return(AppCenterTask.FromCompleted());
 }
 public static AppCenterTask <string> GetInstallIdAsync()
 {
     return(AppCenterTask <string> .FromCompleted(""));
 }
Exemple #23
0
        public static AppCenterTask <bool> IsEnabledAsync(IntPtr transmissionTarget)
        {
            bool isEnabled = appcenter_unity_transmission_target_is_enabled(transmissionTarget);

            return(AppCenterTask <bool> .FromCompleted(isEnabled));
        }
Exemple #24
0
 public static AppCenterTask <ErrorReport> GetLastSessionCrashReportAsync()
 {
     return(AppCenterTask <ErrorReport> .FromCompleted(null));
 }