Beispiel #1
0
 public static void RequestPermissions(List <string> permissions, Action <bool, bool> callback)
 {
     KGApplication.RequestPermissions(
         permissions,
         (result, granted) => {
         if (callback != null)
         {
             if (result.isSuccess)
             {
                 if (granted)
                 {
                     // Permission granted
                     callback(true, true);
                 }
                 else
                 {
                     // No permission granted
                     callback(true, false);
                 }
             }
             else
             {
                 // Request Failed
                 callback(false, false);
             }
         }
     });
 }
Beispiel #2
0
 public static void ShowPermissionsDescription(List <string> requiredPermissions, List <string> optionalPermissions, string resourceId, Action <bool, bool> callback)
 {
     KGApplication.RequestPermissionsWithDescriptionPopup(
         requiredPermissions,
         optionalPermissions,
         resourceId,
         (result, granted) => {
         if (callback != null)
         {
             if (result.isSuccess)
             {
                 // Success Request : All required permissions are acquired.
                 if (granted)
                 {
                     // All optional permissions is obtained.
                     callback(true, true);
                 }
                 else
                 {
                     // Not all optional permissions is obtained.
                     callback(true, false);
                 }
             }
             else
             {
                 // Fail Request.
                 callback(false, false);
             }
         }
     });
 }