Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The event manager tool, which warns us that I need to install the latest version of the Facebook SDK for my app,but I've updated it to the 17.1.0 #2513

Open
5 tasks done
LeMuguet opened this issue Dec 6, 2024 · 0 comments

Comments

@LeMuguet
Copy link

LeMuguet commented Dec 6, 2024

Checklist before submitting a bug report

Xcode version

16.0

Facebook iOS SDK version

17.1.0

Dependency Manager

CocoaPods

SDK Framework

Core

Goals

I need to log Facebook Events and create facebook app ads。

Expected results

Accurately log Facebook events and tell us which field error caused the warning in the event management background

Actual results

We've upgraded the Facebook SDK to 17.1.0 and confirmed compliance with the Facebook SDK documentation, but the event management tool still says your app needs to be updated to the latest version of the Facebook SDK in order to serve ads to users on devices with iOS 14.5 or higher.

Steps to reproduce

1、Create a new app in the facebook background
2、Use the Facebook SDK to report an event

Code samples & details

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    SDKLog(@"%@:didFinish", [CYISDKConfig sharedInstance].sdkVersion);
    BOOL finished = [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
    [FBSDKSettings sharedSettings].isAdvertiserIDCollectionEnabled = YES;
}

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
    return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                                   openURL:url
                                                                   options:options];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
    if (@available(iOS 14, *)) {
        ATTrackingManagerAuthorizationStatus status = ATTrackingManager.trackingAuthorizationStatus;
        if (status == ATTrackingManagerAuthorizationStatusNotDetermined) {
            [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus result) {

                if (@available(iOS 17, *)) return;
                
                if (@available(iOS 14, *)) {
                    BOOL authorized = (result == ATTrackingManagerAuthorizationStatusAuthorized);
                    [FBSDKSettings sharedSettings].isAdvertiserTrackingEnabled = authorized;
                }
            }];
        } else {
            if (@available(iOS 17, *)) return;
            BOOL authorized = (status == ATTrackingManagerAuthorizationStatusAuthorized);
            [FBSDKSettings sharedSettings].isAdvertiserTrackingEnabled = authorized;
        }
    }else {
        [FBSDKSettings sharedSettings].isAdvertiserTrackingEnabled = YES;
    }
}

- (void)logEvent {
    [[FBSDKAppEvents shared] logEvent:@"fb_mobile_complete_registration" parameters:@{@"fb_registration_method": @"facebook"}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant