oddbit / flutter_facebook_app_events

Flutter Plugin for Facebook App Events
https://pub.dev/packages/facebook_app_events
Apache License 2.0
119 stars 296 forks source link

[Bug]: Automatic collection of event reporting issues #356

Open hhzhangzy opened 2 weeks ago

hhzhangzy commented 2 weeks ago

Is there an existing issue for this?

Current Behavior

I integrated the 0.19.2 version of the SDK and configured the Android XML files according to the documentation. However, I did not add any code to call the SDK. Can I still see the automatically collected Android application installation events on the Facebook platform? However, in reality, the collected events are not accurate and relatively few.

Expected Behavior

Directly integrate the SDK and configure the AndroidManifest.xml files:

<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>

and android/app/src/main/values/styles.xml ,android/app/src/main/values-night/styles.xml :

<resources>
    <string name="facebook_app_id">xxxxxxxx</string>
    <string name="facebook_client_token">xxxxxxxx</string>
</resources>

Steps To Reproduce

No response

Platform

Android

Flutter Doctor

[√] Flutter (Channel stable, 3.13.2, on Microsoft Windows [版本 10.0.22631.3447], locale zh-CN)
    • Flutter version 3.13.2 on channel stable at D:\Work\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ff5b5b5fa6 (9 months ago), 2023-08-24 08:12:28 -0500
    • Engine revision b20183e040
    • Dart version 3.1.0
    • DevTools version 2.25.0
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn
hhzhangzy commented 2 weeks ago

The document on the official website of the fakbook SDK (https://developers.facebook.com/docs/app-events/automatic-event-collection-detail) describes: "For Android, please call callbackManager.onActivityResult to pass the login result to the callbackManager. For iOS, no code is required to collect events. " Does it mean that Android automatic event reporting also requires additional code to be added?

hhzhangzy commented 2 weeks ago

Do you need to add the following code to the main.dart file?

FacebookAppEvents events = FacebookAppEvents();
events.setAutoLogAppEventsEnabled(true);
hhzhangzy commented 2 weeks ago

@antonoddbit

maksim-wom commented 2 weeks ago

I'm currently figuring out a similar situation.

1 - Is it possible to add logging to the plugin, so it would log in the console when it sends something to Meta? 2 - Is it also suppose to work from the ios / android emulator? (I assume - yes, but in practice it's hard to debug without the logging)

hhzhangzy commented 2 weeks ago

I'm currently figuring out a similar situation.

1 - Is it possible to add logging to the plugin, so it would log in the console when it sends something to Meta? 2 - Is it also suppose to work from the ios / android emulator? (I assume - yes, but in practice it's hard to debug without the logging)

This issue has already affected the normal advertising process. I'm not sure if it's a problem with the face book SDK itself. After connecting to Flutter SDK on the Android end, there is a significant discrepancy in the application installation event statistics that are automatically reported and viewed in the face book backend. It is unclear whether additional Dart code needs to be written, or if the plugin is not fully integrated with Android native code.

antonoddbit commented 2 weeks ago

@hhzhangzy I will check about autologging on android, thanks for the suggestion code

hhzhangzy commented 2 weeks ago

@hhzhangzy I will check about autologging on android, thanks for the suggestion code

However, according to the Facebook SDK document, there should be no need to verify the login logic for event reporting, right? According to the Facebook SDK documentation, automatic event recording and reporting should be enabled by default.

antonoddbit commented 2 weeks ago

@hhzhangzy previously I have read the SDK and it should enabled by default. There is similar issue about this last year.

hhzhangzy commented 1 week ago

@hhzhangzy previously I have read the SDK and it should enabled by default. There is similar issue about this last year.

Hello, have you found the reason?

hhzhangzy commented 5 days ago

@antonoddbit Do I need to integrate Facebook SDK instead of just integrating Facebook event SDK?

antonoddbit commented 5 days ago

Hi @hhzhangzy maybe you could try to integrate the the FBSDK on android directly if the problem persist. Previously there are several issue that also occurs in the native FBSDK itself, since this library is wrapper to native FBSDK on Flutter