简体   繁体   中英

Not receiving Events via Facebook iOS SDK

I have followed all the instructions for setting up the Facebook iOS SDK.

All I want to do is track install events on iPhone devices, so I can run Ads on iOS 14.

I have:

Added my iOS app to my Facebook account

Added the relevant key pairs to Info.plist

<key>CFBundleURLTypes</key>
<array>
  <dict>
  <key>CFBundleURLSchemes</key>
  <array>
    <string>fb{APP_ID}</string>
  </array>
  </dict>
</array>
<key>FacebookAppID</key>
<string>{APP_ID}</string>
<key>FacebookClientToken</key>
<string>{CLIENT_ID}</string>
<key>FacebookDisplayName</key>
<string>{APP-NAME}</string>

Initialised the FB SDK on launch:

MyApp.swift

class AppDelegate: NSObject, UIApplicationDelegate, MessagingDelegate, UNUserNotificationCenterDelegate {
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        // Facebook Init
        ApplicationDelegate.shared.application(
            application,
            didFinishLaunchingWithOptions: launchOptions
        )
        return true
    }
    func application(
        _ app: UIApplication,
        open url: URL,
        options: [UIApplication.OpenURLOptionsKey : Any] = [:]
    ) -> Bool {
        // Facebook Init
        ApplicationDelegate.shared.application(
            app,
            open: url,
            sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
            annotation: options[UIApplication.OpenURLOptionsKey.annotation]
        )
    }

The Test Events section of Facebook says:

Open your app and interact with it to start seeing activity.

So I open the app - however there are no events showing up. I restart the app and still nothing.

Any idea what the problem may be? I feel like i'm missing something but can't figure out what.

Posting incase this helps anybody else out

I got in touch with FB support- the problem was not opting-in to data collection for FB and IG for iOS ATS.

FB instructed to deleted both apps, opt in to allow tracking on both apps then you will be able to see the data populate when testing in the Events Manager.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM