Hi,
I have seen many posts about this but still unable to get our app to prompt users for their permission.
we are a group of scouts trying to develop our first app and none of us have much if any experience and are now totally stuck.
we have tried many ways of putting the code in but the AppDelegate and MainViewController but still unable to get the prompt.
any advice or assistance would be gratefully appreciated
below is the last attempt where we had this code in our MainViewController.
-(void)viewDidLoad { UIApplication *applicaiton = [UIApplication sharedApplication];
if (applicaiton.applicationState == UIApplicationStateActive) { if (@available(iOS 14, *)) { ATTrackingManagerAuthorizationStatus status = [ATTrackingManager trackingAuthorizationStatus];
if (status == ATTrackingManagerAuthorizationStatusNotDetermined) { [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { // Tracking authorization completed. Start loading ads here.
[[NSOperationQueue mainQueue] addOperationWithBlock:^ { [[GADMobileAds sharedInstance] startWithCompletionHandler:nil]; }]; }]; } } else { [[GADMobileAds sharedInstance] startWithCompletionHandler:nil]; // Fallback on earlier versions } } [super viewDidLoad]; }