简体   繁体   English

通过Facebook SDK将事件发送到分析的问题

[英]Problem with sending events to analytics over Facebook SDK

I using com.facebook.android:facebook-core:5.0.0 When I try send event to analytics like this 我使用com.facebook.android:facebook-core:5.0.0当我尝试将事件发送到这样的分析时

val logger = AppEventsLogger.newLogger(context, "my_app_id")  
logger.logEvent("event", Bundle())

But I has error in logs 但我在日志中有错误

    E/GraphResponse: {HttpStatus: 404, errorCode: 803, subErrorCode: -1,  
 errorType: OAuthException, errorMessage: (#803) Some of the aliases you  
 requested do not exist: "my_app_id"}

App was setup like in https://developers.facebook.com/quickstarts/?platform=android 应用程序的设置类似于https://developers.facebook.com/quickstarts/?platform=android

Facebook's support don't answer Facebook的支持没有回答

I fix with two point: 我解决了两点:

1: add two activities in manifest . 1:在清单中添加两个活动。

<activity android:name="com.facebook.FacebookActivity"
          android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
          android:label="@string/app_name"/>

<activity android:name="com.facebook.CustomTabActivity"
          android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="@string/fb_login_protocol_scheme"/>
    </intent-filter>
</activity>  

2: replace manifestPlaceholders in app/build.gradle with 2:替换manifestPlaceholders与应用程序/的build.gradle

resValue "string", "facebook_app_id", "$fbAppId"  
resValue "string", "fb_login_protocol_scheme", "fb$fbAppId"

I don't know why did't work manifestPlaceholders. 我不知道为什么没有工作manifestPlaceholders。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM