0

我使用Facebook SDK 3.0.2并希望通过此 SDK 发布活动的应用安装。我不想提供 facebook 登录,只是发布应用安装并记录事件。我按照本教程进行操作,即,我在 Facebook 上注册了应用程序,并添加了所有内容,如包名、类名和密钥哈希(开发和发布密钥哈希)。

安装事件已从 ios SDK 很好地注册。但是,如果我尝试调用android 应用程序,我会收到一条带有标签com.facebook.Settings.publishInstallAsync(context, MY_APP_ID);的 logCat 消息;此外,在 Android 设备的 App Dashboard 中看不到任何安装事件。如果设备上没有安装本机 Facebook 应用程序,我还会在消息之前在 logcat 中收到一条消息。有人在 android 上获得安装事件吗?NullPointerException: nullFacebook-publishFailed to find provider info for com.facebook.katana.provider.AttributionIdProviderNullPointerException: null

4

1 回答 1

3

Ok, so the problem occurs due to the fact that you don't have Facebook application installed on your device.

From the source code of publishInstallAndWaitForResponse(Context,String) method you can see this line:

String attributionId = Settings.getAttributionId(context.getContentResolver());

In the getAttributionId(ContentResolver) is said:

returns null if the facebook app is not present on the phone

So, this is the problem. You get null for attributionId and thus publishing installs doesn't for for you.

于 2013-08-16T17:20:26.320 回答