Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook SDK events are not displaying. #1273

Closed
5 tasks done
ArtsiomHubanay opened this issue Oct 14, 2024 · 1 comment
Closed
5 tasks done

Facebook SDK events are not displaying. #1273

ArtsiomHubanay opened this issue Oct 14, 2024 · 1 comment

Comments

@ArtsiomHubanay
Copy link

Checklist before submitting a bug report

Java version

21

Android version

API 34, Android 13

Android SDK version

17.0.2

Installation platform & version

Gradle (Android Studio) 8.3.1

Package

Core & AppEvents

Goals

Fixing the issue of duplicate app ID in the client access token

Expected results

When installing my application through Facebook ads, I expected to see app install and activation events in my Ads Manager

Actual results

The APP INSTALL event did not appear even in the Event Manager. The ACTIVATE APP event appeared, but it did not show up in the Ads Manager

Steps to reproduce

Standard app launch through the development environment. Organic installation from Google Play. Non-organic installation through Facebook ads

Code samples & details

I launched the app in debug mode and encountered the following error:
`{"error":{"message":"Invalid access token signature.","type":"OAuthException","code":190,"fbtrace_id":"AfitjEP1vLloVIvZq1tsPYd"}}`

Request:                                                                                                     Id:	4                                                                                                    URL:	https://graph.facebook.com/v16.0/app/mobile_sdk_gk?access_token=1234567891011123%7C1234567891011123%7Ci-ZTjvShHEt8NdXTRfI8yrTvP6w&fields=gatekeepers&format=json&sdk_version=17.0.2&sdk=android&platform=android                                                                                                   Method:	GET                                                                                                     User-Agent:	FBAndroidSDK.17.0.2                                                                                                   Content-Type:	application/x-www-form-urlencoded

As I can see, the access_token in this case duplicates the app_id:
app_id | app_id | secret

According to the documentation, it should follow this format:
app_id | secret

If you remove the duplication of the app ID from the link:
https://graph.facebook.com/v16.0/app/mobile_sdk_gk?access_token=1234567891011123%7C1234567891011123%7Ci-ZTjvShHEt8NdXTRfI8yrTvP6w&fields=gatekeepers&format=json&sdk_version=17.0.2&sdk=android&platform=android

and leave the correct format:
https://graph.facebook.com/v16.0/app/mobile_sdk_gk?access_token=1234567891011123%7Ci-ZTjvShHEt8NdXTRfI8yrTvP6w&fields=gatekeepers&format=json&sdk_version=17.0.2&sdk=android&platform=android

and then open it in the browser, everything works as it should.

I double-checked how I specify the client_token in my app, and it's in the correct format. I generated it using:
https://graph.facebook.com/oauth/access_token?client_id=app_id&client_secret=app_secret&grant_type=client_credentials

I tried using different versions of the library starting from 7.1.0, but I always get the same result.

Integration of the library in the application according to the documentation:
<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/fb_client_token" />
<meta-data
    android:name="com.facebook.sdk.AutoLogAppEventsEnabled"
    android:value="true"/>
<meta-data
    android:name="com.facebook.sdk.AutoInitEnabled"
    android:value="true"/>

Gradle:
implementation("com.facebook.android:facebook-android-sdk:17.0.2")

In Activity:
if (FacebookSdk.isInitialized()) {
    FacebookSdk.setIsDebugEnabled(true);
    FacebookSdk.addLoggingBehavior(LoggingBehavior.APP_EVENTS);
    FacebookSdk.addLoggingBehavior(LoggingBehavior.REQUESTS);
    FacebookSdk.addLoggingBehavior(LoggingBehavior.INCLUDE_RAW_RESPONSES);
}
@ArtsiomHubanay
Copy link
Author

If I use just the app_secret in the client_token, everything works. Perhaps that's how it's supposed to be. It turns out I was wrong. The issue can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant