Skip to content

Commit

Permalink
fix: execute FBAdSettings if iOS is higher 14 #59
Browse files Browse the repository at this point in the history
  • Loading branch information
gumaciel committed Aug 5, 2023
1 parent 02c4243 commit 1246f52
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@
};

void PoingGodotAdMobMetaFBAdSettings::set_advertiser_tracking_enabled(bool tracking_required) {
NSLog(@"PoingGodotAdMobMetaFBAdSettings::set_advertiser_tracking_enabled");
[FBAdSettings setAdvertiserTrackingEnabled:tracking_required];
NSOperatingSystemVersion iOS14Version = { .majorVersion = 14, .minorVersion = 0, .patchVersion = 0 };

if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:iOS14Version]) {
NSLog(@"FBAdSettings set_advertiser_tracking_enabled, %@", tracking_required ? @"YES" : @"NO");
[FBAdSettings setAdvertiserTrackingEnabled:tracking_required];
} else {
NSLog(@"not executing set_advertiser_tracking_enabled because the iOS version is below 14");
}
}

void PoingGodotAdMobMetaFBAdSettings::_bind_methods() {
Expand Down

0 comments on commit 1246f52

Please sign in to comment.