oddbit / flutter_facebook_app_events

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

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

Closed hhzhangzy closed 5 months ago

hhzhangzy commented 6 months 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 6 months 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 6 months ago

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

FacebookAppEvents events = FacebookAppEvents();
events.setAutoLogAppEventsEnabled(true);
hhzhangzy commented 6 months ago

@antonoddbit

maksim-wom commented 6 months 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 6 months 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 6 months ago

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

hhzhangzy commented 6 months 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 6 months ago

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

hhzhangzy commented 6 months 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 6 months ago

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

antonoddbit commented 6 months 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

github-actions[bot] commented 5 months ago

This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 5 months ago

This issue was closed because it has been stalled for 5 days with no activity.