为什么我的Facebook AppInviteDialog请求没有被目标朋友收到? [英] Why is my Facebook AppInviteDialog request not being received by target friend?

查看:111
本文介绍了为什么我的Facebook AppInviteDialog请求没有被目标朋友收到?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简而言之:一切似乎都在客户端工作,但没有收到Facebook的目标朋友。



这些是具有代码和屏幕截图的详细步骤:

  AppInviteContent content = new AppInviteConent.Builder()
.setApplinkUrl(通过Facebook AppLink创建者创建的应用链接网址工具)
.setPreviewImageUrl(http://www.redacted.com/previewImage.png)
.build();

appInviteDialog.show(this,content);

这将导致显示一个对话框,其中预览了安装应用程序的链接,在顶部输入消息的选项:





然后点击下一步,选择一个或多个朋友,然后点击右上角发送按钮:





结果是一个看似成功的发送:





我附加了一个回调,以确保它实际上是一个成功的发送:

  appInviteDialog.registerCallback (facebookCallbackManager,新的F​​acebookCallback< 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());
}
});

这将打印出onSuccess result = Bundle [{didComplete = 1}]



预期结果:朋友收到通知。
实际结果:朋友不收取任何费用。



可能有用的其他信息




  • 应用程式仅适用于Android。

  • 任何平台上都没有收到通知,包括Facebook Android应用程序。

  • 应用程序链接网址已通过点击Facebook的Android应用程序。 (它创建一个链接到Google Play商店的弹出式窗口)

  • 单点登录已启用,用户已登录,但根据Facebook上的AppInviteDialog文档不需要。 li>
  • 尝试此目标用户尚未授权应用程序,以及已安装应用程序的用户。相同的结果。

  • 我使用的Facebook SDK版本是4.0.0



令人沮丧的是因为一切似乎好的,没有办法(我知道)调试这个问题。



我希望有人可以帮助我或指向正确的方向。 >

谢谢!

解决方案

好的,原来一切都运行正常。我的错误是假设没有安装应用程序,而没有授权的应用程序应该生成推送通知。



创建新的测试用户后,使用应用程序当前未安装的设备,并且该应用程序从未被用户授权。



所以这里的关键是,如果目标设备上的应用安装,将不会生成推送通知,即使用户以前没有授权应用。此外,如果用户以前已经授权应用程序,那么即使在某些时候它被删除,它也不会生成通知。



所以如果你想测试这个,创建一个全新的测试用户,并在你正在测试的平台上的Facebook应用程序上登录,并确保该应用未安装在设备上。



我认为,尽管安装了应用,它仍然会生成通知,因为多个用户可能正在使用相同的设备,但这是现在似乎是如此。



我会在这里离开这里,以防将来有人遇到类似的问题。



长久而繁荣!


In short: Everything seems to be working on the client side, but nothing received for the Facebook target friend.

These are the detailed steps with code and screenshots:

AppInviteContent content = new AppInviteConent.Builder()
    .setApplinkUrl("App link url created via the Facebook AppLink creator tool")
    .setPreviewImageUrl("http://www.redacted.com/previewImage.png")
    .build();

appInviteDialog.show(this, content);

This results in a dialog being shown with a preview of a link to the install of the app, and the option of entering a message at the top:

I then click next, select one or more friends and click the top right Send button:

The result is a seemingly successful send:

I attached a callback as well to make sure it was actually a successful send:

appInviteDialog.registerCallback(facebookCallbackManager, 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());
    }
});

This prints out "onSuccess result = Bundle[{didComplete=1}]"

Expected result: Friend receives a notification. Actual result: Friend receives nothing.

Some more information that might be helpful:

  • App is only available on android.
  • Notification is not received on any platform including Facebook android app.
  • The App link url has been confirmed working by clicking on it in the Facebook android app. (It creates a popup linking to the Google Play Store)
  • Single Sign On has been enabled and user is logged in, although should not be necessary according to the AppInviteDialog documentation on Facebook.
  • Tried this with the target user not already having authorized the app, and also with user that already had the app installed. Same results.
  • The Facebook SDK version I am using is 4.0.0

It's frustrating because everything seems OK, and there is no way (that I know of) to debug this problem.

I hope someone can help me or point me in the right direction.

Thank you!

解决方案

Ok, turns out everything was working fine after all. My mistake was in assuming not having the app installed, and not having the app authorized should generate a push notification.

After creating a new test user, using a device where the app was not currently installed and the app NEVER having been authorized with the user.

So the key here is that no push notification will be generated if the app is installed on the target device, even if the user has not authorized the app previously. Also, seemingly, if the user has authorized the app previously, even if it was removed it at some point, it also will not generate a notification.

So if you want to test this, create an entirely new test user and log in on the Facebook app on the platform you are testing on, and make sure the app is not installed on the device.

I think it should still generate a notification despite app being installed, because multiple users might be using the same device, but that's how it seems to be right now.

I'll leave this here in case anyone has a similar problem in the future.

Live long and prosper!

这篇关于为什么我的Facebook AppInviteDialog请求没有被目标朋友收到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆