hunk.code_window: import abi41_0_0.host.exp.exponent.modules.internal.ExponentAsyncStorageModule;
   import abi41_0_0.host.exp.exponent.modules.internal.ExponentIntentModule;
   import abi41_0_0.host.exp.exponent.modules.internal.ExponentUnsignedAsyncStorageModule;
   import static host.exp.exponent.kernel.KernelConstants.IS_HEADLESS_KEY;
   import static host.exp.exponent.kernel.KernelConstants.LINKING_URI_KEY;
  
hunk.labels: keep keep keep add keep keep keep
hunk.after_edit: import static host.exp.exponent.kernel.KernelConstants.INTENT_URI_KEY;
  
hunk.file_path: android/versioned-abis/expoview-abi41_0_0/src/main/java/abi41_0_0/host/exp/exponent/ExpoTurboPackage.java
hunk.type: add
file: // Copyright 2017-present 650 Industries. All rights reserved.
  
  #import <EXAdsAdMob/EXAdsAdMobAppTrackingPermissionRequester.h>
  #import <AppTrackingTransparency/ATTrackingManager.h>
  
  @implementation EXAdsAdMobAppTrackingPermissionRequester
  
  + (NSString *)permissionType
  {
    return @"appTracking";
  }
  
  - (NSDictionary *)getPermissions
  {
    UMPermissionStatus status;
    
    if (@available(iOS 14, *)) {
      ATTrackingManagerAuthorizationStatus systemStatus = [ATTrackingManager trackingAuthorizationStatus];
      switch (systemStatus) {
        case ATTrackingManagerAuthorizationStatusAuthorized:
          status = UMPermissionStatusGranted;
          break;
        case ATTrackingManagerAuthorizationStatusNotDetermined:
          status = UMPermissionStatusUndetermined;
          break;
        case ATTrackingManagerAuthorizationStatusRestricted:
        case ATTrackingManagerAuthorizationStatusDenied:
          status = UMPermissionStatusDenied;
          break;
      }
    } else {
      status = UMPermissionStatusGranted;
    }
    
    return @{
      @"status": @(status)
    };
  }
  
  - (void)requestPermissionsWithResolver:(UMPromiseResolveBlock)resolve rejecter:(UMPromiseRejectBlock)reject
  {
    if (@available(iOS 14, *)) {
      UM_WEAKIFY(self)
      [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
        UM_STRONGIFY(self)
        resolve([self getPermissions]);
      }];
    } else {
      resolve([self getPermissions]);
    }
  }
  
  @end
  