Facebook 好友邀请已成功发送,但在 facebook-sdk.4.0 中未收到响应数据 android
Facebook Friend invite is sent successfully but no data received in response in facebook-sdk.4.0 android
String appLinkUrl, previewImageUrl;
final String TAG = "fbv4";
appLinkUrl = "https://fb.me/1161673067......";
previewImageUrl = "mydomain.com/my_invite_image.jpg";
if (AppInviteDialog.canShow())
{
AppInviteContent content = new AppInviteContent.Builder()
.setApplinkUrl(appLinkUrl)
.setPreviewImageUrl(previewImageUrl)
.build();
AppInviteDialog.show(MainActivity.this, content);
AppInviteDialog appInviteDialog = new AppInviteDialog(activity);
appInviteDialog.registerCallback(callbackManager, new FacebookCallback<AppInviteDialog.Result>()
{
@Override
public void onSuccess(AppInviteDialog.Result result)
{
Log.d(TAG, "onSuccess result = " + result.getData().toString());
}
@Override
public void onCancel()
{
}
@Override
public void onError(FacebookException e)
{
Log.d(TAG, "onError message = "+ e.getMessage());
}
});
appInviteDialog.show(content);
}
这是我用facebook-sdk.4.0邀请朋友的代码。我的邀请对话框使用好友列表正确打开并显示邀请已正确发送但没有邀请到朋友。在日志中获得成功,所有过程都正常进行,但我没有收到任何关于我的应用程序的通知。
@zephyr
是的,我遇到了来自 Facebook 用户设置的通知阻止问题,请试试这个,也许它对你有帮助,就像它对我有用一样。
Click in the top right of Facebook and select Settings
Click Notifications in the left menu
Click Edit next to On Facebook
Click Edit next to App requests and activity
Click to set the notifications for the app or game to On
String appLinkUrl, previewImageUrl;
final String TAG = "fbv4";
appLinkUrl = "https://fb.me/1161673067......";
previewImageUrl = "mydomain.com/my_invite_image.jpg";
if (AppInviteDialog.canShow())
{
AppInviteContent content = new AppInviteContent.Builder()
.setApplinkUrl(appLinkUrl)
.setPreviewImageUrl(previewImageUrl)
.build();
AppInviteDialog.show(MainActivity.this, content);
AppInviteDialog appInviteDialog = new AppInviteDialog(activity);
appInviteDialog.registerCallback(callbackManager, new FacebookCallback<AppInviteDialog.Result>()
{
@Override
public void onSuccess(AppInviteDialog.Result result)
{
Log.d(TAG, "onSuccess result = " + result.getData().toString());
}
@Override
public void onCancel()
{
}
@Override
public void onError(FacebookException e)
{
Log.d(TAG, "onError message = "+ e.getMessage());
}
});
appInviteDialog.show(content);
}
这是我用facebook-sdk.4.0邀请朋友的代码。我的邀请对话框使用好友列表正确打开并显示邀请已正确发送但没有邀请到朋友。在日志中获得成功,所有过程都正常进行,但我没有收到任何关于我的应用程序的通知。
@zephyr
是的,我遇到了来自 Facebook 用户设置的通知阻止问题,请试试这个,也许它对你有帮助,就像它对我有用一样。
Click in the top right of Facebook and select Settings
Click Notifications in the left menu
Click Edit next to On Facebook
Click Edit next to App requests and activity
Click to set the notifications for the app or game to On