facebook-ios-sdk icon indicating copy to clipboard operation
facebook-ios-sdk copied to clipboard

Can't get any event log in Event Manager

Open karenxpn opened this issue 4 years ago • 16 comments

Checklist before submitting a bug report

Xcode version

13.2

Facebook iOS SDK version

12.0.2

Dependency Manager

CocoaPods

SDK Framework

Core

Goals

Just wanna connect my app and see events in Event Manager.

Expected results

Events should be logged in to the Event Manager but nothing happens. I have updated everything to the latest versions and trying to achieve the result for 2days.

Actual results

Nothing happens.

Steps to reproduce

No response

Code samples & details

AppEvents.logEvent(.viewedContent)

karenxpn avatar Oct 29 '21 15:10 karenxpn

Hi @karenxpn - What does your events manager page look like for the application you're issuing for?

jamestouri avatar Nov 01 '21 21:11 jamestouri

image

karenxpn avatar Nov 01 '21 21:11 karenxpn

Sorry it's not working for you

Curious if you have tried any of these:

  1. Did you add
    FacebookAutoLogAppEventsEnabled TRUE to the info.plist?

  2. Did you add Settings.isAutoLogAppEventsEnabled = true

  3. If you're testing on your own phone are you signed into facebook.com?

jamestouri avatar Nov 01 '21 22:11 jamestouri

@jamestouri yes all done

karenxpn avatar Nov 01 '21 23:11 karenxpn

Faced the same issue with latest released SDK version.

Dependency Manager

CocoaPods pod 'FBSDKCoreKit'

Pods' versions

FBAEMKit (12.1.0) FBSDKCoreKit (12.1.0) FBSDKCoreKit_Basics (12.1.0)

Minimum supported IOS version

IOS 14.1

App Configuration

https://developers.facebook.com/docs/app-events/getting-started-app-events-ios#add-events

AppDelegate: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { ApplicationDelegate.shared.application( application, didFinishLaunchingWithOptions: launchOptions ) Settings.shared.isAutoLogAppEventsEnabled = true }

SceneDelegate: func sceneDidBecomeActive(_ scene: UIScene) { AppEvents.shared.activateApp() }

Info.plist

<key>FacebookAutoLogAppEventsEnabled</key> <string>TRUE</string>

Expected Behaviour

Receiving install events and purchase events

Current Behaviour

Install event was received only one time. However, app was installed on several different devices (not simulators). Currently app is in production mode in App Store and still doesn't receive auto logged app events.

andreibilyk avatar Nov 04 '21 15:11 andreibilyk

Did you allow tracking (ATT) on the Facebook app otherwise no events will be logged.

teejayhh avatar Dec 21 '21 01:12 teejayhh

Did you allow tracking (ATT) on the Facebook app otherwise no events will be logged.

yes its enabled

karenxpn avatar Dec 21 '21 04:12 karenxpn

Hi @karenxpn , this issue is similar to https://github.com/facebook/facebook-ios-sdk/issues/1667 . Can you check the followings:

  1. SDK is initialized and iOS ATT is enabled
  2. Set the AdvertiserTrackingEnabled as True
  3. Set the AdvertiserIDCollectionEnabled as True
  4. Log in FB App on the same device and allow tracking

It'd be better if you can provide more details like AppID and FB SDK related settings in info.plist. Thanks

KylinChang avatar Dec 21 '21 08:12 KylinChang

I can't get this working either: 634763881213996

Facebook info.plist settings:

<key>CFBundleURLTypes</key>
<array>
<dict>
  <key>CFBundleURLSchemes</key>
  <array>
  <string>fb634763881213996</string>
  <string>#DISPLAY_NAME#</string>
  </array>
</dict>
</array>
<key>FacebookAppID</key>
<string>634763881213996</string>
<key>FacebookClientToken</key>
<string>#CLIENT_TOKEN#</string>
<key>FacebookDisplayName</key>
<string>#DISPLAY_NAME#</string>
<key>SKAdNetworkItems</key>
<array>
<dict>
	<key>SKAdNetworkIdentifier</key>
	<string>v9wttpbfk9.skadnetwork</string>
</dict>
<dict>
	<key>SKAdNetworkIdentifier</key>
	<string>n38lu8286q.skadnetwork</string>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
  <string>fbapi</string>
  <string>fbapi20130214</string>
  <string>fbapi20130410</string>
  <string>fbapi20130702</string>
  <string>fbapi20131010</string>
  <string>fbapi20131219</string>
  <string>fbapi20140410</string>
  <string>fbapi20140116</string>
  <string>fbapi20150313</string>
  <string>fbapi20150629</string>
  <string>fbapi20160328</string>
  <string>fbauth</string>
  <string>fb-messenger-share-api</string>
  <string>fbauth2</string>
  <string>fbshareextension</string>
</array>

Using the community version of React Native SDK - so using the latest SDK - 12.2.1: https://github.com/thebergamo/react-native-fbsdk-next/releases/tag/v6.2.0

App.tsx:

useEffect(() => {
    const changeListener = AppState.addEventListener(
      'change',
      async (nextAppState) => {
        if (Platform.OS === 'ios' && nextAppState === 'active') {
          const trackingStatus = await getTrackingStatus();
          const isEnabled = (result: TrackingStatus): boolean =>
            result === 'authorized' || result === 'unavailable';
          Settings.setAdvertiserTrackingEnabled(isEnabled(trackingStatus));
          Settings.initializeSDK();
        }
      },
    );

    return () => {
      changeListener.remove();
    };
  }, []);

AppDelegate.m:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
   [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];

  return YES;
}

This shows as up to date: image

This sporadically shows Installs registered: image

This shows 14.5 ATE True status rate as this: image

This constantly shows: image

Spent quite a few days trying to understand what I'm doing wrong now...

Struggling with the documentation if I'm honest: https://developers.facebook.com/quickstarts/634763881213996/?platform=ios

Differs from this: https://developers.facebook.com/docs/app-events/getting-started-app-events-ios

datoon83 avatar Jan 11 '22 16:01 datoon83

I can't get this working either: 634763881213996

Facebook info.plist settings:

<key>CFBundleURLTypes</key>
<array>
<dict>
  <key>CFBundleURLSchemes</key>
  <array>
  <string>fb634763881213996</string>
  <string>#DISPLAY_NAME#</string>
  </array>
</dict>
</array>
<key>FacebookAppID</key>
<string>634763881213996</string>
<key>FacebookClientToken</key>
<string>#CLIENT_TOKEN#</string>
<key>FacebookDisplayName</key>
<string>#DISPLAY_NAME#</string>
<key>SKAdNetworkItems</key>
<array>
<dict>
	<key>SKAdNetworkIdentifier</key>
	<string>v9wttpbfk9.skadnetwork</string>
</dict>
<dict>
	<key>SKAdNetworkIdentifier</key>
	<string>n38lu8286q.skadnetwork</string>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
  <string>fbapi</string>
  <string>fbapi20130214</string>
  <string>fbapi20130410</string>
  <string>fbapi20130702</string>
  <string>fbapi20131010</string>
  <string>fbapi20131219</string>
  <string>fbapi20140410</string>
  <string>fbapi20140116</string>
  <string>fbapi20150313</string>
  <string>fbapi20150629</string>
  <string>fbapi20160328</string>
  <string>fbauth</string>
  <string>fb-messenger-share-api</string>
  <string>fbauth2</string>
  <string>fbshareextension</string>
</array>

Using the community version of React Native SDK - so using the latest SDK - 12.2.1: https://github.com/thebergamo/react-native-fbsdk-next/releases/tag/v6.2.0

App.tsx:

useEffect(() => {
    const changeListener = AppState.addEventListener(
      'change',
      async (nextAppState) => {
        if (Platform.OS === 'ios' && nextAppState === 'active') {
          const trackingStatus = await getTrackingStatus();
          const isEnabled = (result: TrackingStatus): boolean =>
            result === 'authorized' || result === 'unavailable';
          Settings.setAdvertiserTrackingEnabled(isEnabled(trackingStatus));
          Settings.initializeSDK();
        }
      },
    );

    return () => {
      changeListener.remove();
    };
  }, []);

AppDelegate.m:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
   [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];

  return YES;
}

This shows as up to date: image

This sporadically shows Installs registered: image

This shows 14.5 ATE True status rate as this: image

This constantly shows: image

Spent quite a few days trying to understand what I'm doing wrong now...

Struggling with the documentation if I'm honest: https://developers.facebook.com/quickstarts/634763881213996/?platform=ios

Differs from this: https://developers.facebook.com/docs/app-events/getting-started-app-events-ios

Were you able to solve the problem? I can't get it to work either(

KotMira avatar Jan 21 '22 07:01 KotMira

I enabled AEM for my project and this seems to work.

I had to upgrade to the beta version of this: "react-native-fbsdk-next": "7.0.0-beta.4"

Then followed the instructions found here: https://github.com/thebergamo/react-native-fbsdk-next/tree/beta#aggregated-event-measurementaem-for-ios

Seems to be working now for us!

datoon83 avatar Jan 21 '22 12:01 datoon83

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 22 '22 05:04 github-actions[bot]

Not solved...

karenxpn avatar Apr 22 '22 07:04 karenxpn

Not solved...

camboYY avatar Jul 25 '22 03:07 camboYY

Çözülmedi...

ayhedanakliyat avatar Jul 25 '22 03:07 ayhedanakliyat

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):

  1. Info.Plist Screen Shot 2022-08-11 at 10 44 47 am

  2. SceneDelegate

Screen Shot 2022-08-11 at 10 50 43 am

Screen Shot 2022-08-11 at 11 05 33 am

Screen Shot 2022-08-11 at 10 48 40 am

This will bring up the following pop up:

Screen Shot 2022-08-11 at 10 58 05 am

  1. In your viewcontroller:

Screen Shot 2022-08-11 at 10 52 39 am

DonTharaka avatar Aug 11 '22 01:08 DonTharaka

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Nov 09 '22 05:11 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

github-actions[bot] avatar Nov 17 '22 05:11 github-actions[bot]