facebook-ios-sdk
facebook-ios-sdk copied to clipboard
Cannot see events on Events Manager dashboard
Checklist before submitting a bug report
- [X] I've updated to the latest released version of the SDK
- [X] I've searched for existing GitHub issues
- [X] I've looked for existing answers on Stack Overflow, the Facebook Developer Community Forum and the Facebook Developers Group
- [X] I've read the Code of Conduct
- [X] This issue is not security related and can safely be disclosed publicly on GitHub
Xcode version
13.3.1
Facebook iOS SDK version
13.2.0
Dependency Manager
SPM
SDK Framework
Core
Goals
See my events displayed on Events Manager
Expected results
After opening the app, I want to see session started event on Event Manager
Actual results
Nothing appears
Steps to reproduce
Find in code samples, the content of my AppDelegate
Code samples & details
AppDelegate.swift
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
return ApplicationDelegate.shared.application(app,
open: url,
sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
annotation: options[UIApplication.OpenURLOptionsKey.annotation])
}
SceneDelegate.swift
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
guard let url = URLContexts.first?.url else { return }
AEMReporter.configure(withNetworker: nil, appID: "XXXXXXXXX", reporter: nil)
AEMReporter.enable()
AEMReporter.handle(url)
ApplicationDelegate.shared.application(
UIApplication.shared,
open: url,
sourceApplication: nil,
annotation: [UIApplication.OpenURLOptionsKey.annotation]
)
}
Setup Settings
Settings.shared.enableLoggingBehavior(.appEvents)
Settings.shared.enableLoggingBehavior(.networkRequests)
Settings.shared.enableLoggingBehavior(.developerErrors)
Settings.shared.enableLoggingBehavior(.graphAPIDebugInfo)
Settings.shared.enableLoggingBehavior(.accessTokens)
Settings.shared.isAutoLogAppEventsEnabled = true
Settings.shared.isAdvertiserIDCollectionEnabled = true
Also, I found out that a request is made on every event to
https://graph.facebook.com/v13.0/XXXXXXXX/aem_conversion_configs?advertiser_ids=%5B%5D&debug=info&fields=&format=json&include_headers=false&sdk=ios
and the response is always
{ "data": [
] }
After firing the Settings configs on didBecomeActive, I manage to see events being flushed. Nevertheless, I still can not see them on Event Manager
FBSDKLog: FBSDKAppEvents: Flushed @ 1653398625.000000, 3 events due to 'EagerlyFlushingEvent' - {
.....
Flush Result: Success
same
Exact same issue here, despite following the documentation to the tee.
Xcode version: 13.4
Facebook iOS SDK version: 13.2.0
(also tried 13.0.0
and 12.3.2
)
Requests against graph.facebook.com
are successful (200, empty data), but nothing shows in Events Manager.
We also tried – in vain – while having the Facebook app installed (logged in) in the background with ATT enabled on both apps after spotting this comment.
We are running out of ideas.
Same here, I do see events flushed both android/ios and Deep Link verification passed, however no events recorded
I've contacted FB support and got "App has not configured properly with FB SDK." with an advice to read https://developers.facebook.com/docs/app-ads/overview
In my case, in addition to the above, the Event manager displays the warning "Update your apps to the latest Facebook SDK"... I can see in logs that SDK makes calls etc but apparently I don't have the SDK...
I struggled with the same issue until went through this checklist https://github.com/thebergamo/react-native-fbsdk-next/issues/66#issuecomment-888708757 Finally, events start work.
Check if you have defined ips in Server ip Whitelist in Settings > Advanced > Security. If that is the case u are subject to this issue that i opened in facebook android sdk ( https://github.com/facebook/facebook-android-sdk/issues/1094 ) but is the same of ios. It seems requests like App install to the graph api use the client token when in the previous sdks they didn't. For some reason such requests are subject to be blocked if the client ip is not in the Server ip Whitelist. For mobile clients this is ridiculous so the only viable solution for now is to not have any ips defined in the Server ip whitelist so that u can whitelist all.
Thanks for your advice but I've given up on integrating with Facebook SKD. It should be straightforward and easy but it seems like they don't care and configuring it properly is more like walking through a minefield.
Adding ApplicationDelegate.initialize()
to AppDelegate.swift helped me finally see the events
Full code:
- AppDelegate.swift
import UIKit
import Foundation
import FBSDKCoreKit
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
ApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
ApplicationDelegate.initialize()
Settings.shared.isAutoLogAppEventsEnabled = true
Settings.shared.isAdvertiserIDCollectionEnabled = true
Settings.shared.isAdvertiserTrackingEnabled = true
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
override func applicationDidBecomeActive(_ application: UIApplication) {
AppEvents.shared.activateApp()
Settings.shared.enableLoggingBehavior(.appEvents)
Settings.shared.enableLoggingBehavior(.developerErrors)
Settings.shared.enableLoggingBehavior(.cacheErrors)
Settings.shared.enableLoggingBehavior(.uiControlErrors)
}
}
- Info.plist
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb...</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>...</string>
<key>FacebookDisplayName</key>
<string>...</string>
<key>FacebookClientToken</key>
<string>...</string>
<key>FacebookAutoLogAppEventsEnabled</key>
<string>true</string>
<key>FacebookAdvertiserIDCollectionEnabled</key>
<string>true</string>
Facebook documentation on app events is very vague. It does not contain any information about ATTrackingManager which is necessary to track events. First follow all steps in the documentation. Below are the steps I have taken to successfully connect app events (iOS 15):
-
Info.Plist
-
SceneDelegate
This will bring up the following pop up:
- In your viewcontroller:
i am working for last 3 days
Device : iPhone 13 version: iOS 16.5
After implementing i see my device version in the list with event
Also check my log
2023-06-10 15:57:12.456735+0530 OJOLife[29995:7162246] FBSDKLog: FBSDKAppEvents: Flushed @ 1686392832.000000, 1 events due to 'Timer' - {
"advertiser_id" = "4B95C0EB-73AB-43A2-9E6C-XXXXXXXXXX";
"advertiser_id_collection_enabled" = 1;
"advertiser_tracking_enabled" = 1;
"anon_id" = "XZ3AE32712-B137-47E2-8071-XXXXXXXXX";
"application_tracking_enabled" = 1;
"custom_events" = "[{\"_eventName\":\"fb_mobile_content_view\",\"_logTime\":1686392821,\"fb_content\":\"{\\\"screen\\\":\\\"Home\\\"}\",\"_ui\":\"OJOLife.NavVC\"}]";
event = "CUSTOM_APP_EVENTS";
extinfo = "[\"i2\",\"com.ojolife.dietitioclinic\",\"5\",\"1.2.0\",\"16.5\",\"iPhone14,5\",\"en_IN\",\"IST\",\"--\",390,844,\"3.00\",6,119,5,\"Asia\\/Kolkata\"]";
ud = "{}";
"url_schemes" = "[\"com.googleusercontent.apps.XXXXXX-962s8s2nhitmvivqie5h9ls3t8m6rf1g\",\"https\",\"com.ojolife.dietitioclinic\",\"App-prefs\"]";
}
Events: [
{
"event" : {
"_eventName" : "fb_mobile_content_view",
"_logTime" : 1686392821,
"fb_content" : "{\"screen\":\"Home\"}",
"_ui" : "OJOLife.NavVC"
},
"isImplicit" : false
}
]
but when i see the custom log events for iphone where as i cant find any one where for android working fine