AppInviteDialog不工作在Android的Facebook的SDK 4.0 [英] AppInviteDialog not working in Android Facebook SDK 4.0

查看:400
本文介绍了AppInviteDialog不工作在Android的Facebook的SDK 4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

长期的研究,并试图解决这个问题我自己之后,我还没有发现任何可以接受的工作结果。

After long research and trying to fix this on my own, I haven't found any acceptable working result.

这个文档我想邀请朋友来我的应用程序。所有元素,如共享按钮是否工作正常。

Following this documentation I'm trying to invite friends to my app. All elements, such as share buttons are working properly.

唯一的问题是与邀请到应用程序对话框。选择一个朋友后,对话框都呈现红色警报图标和发送按钮变为重试按钮。

The only problem are with "Invite to app" dialog. After selecting a friend, the dialog are showing red alert icon and "send" button is turns into "retry" button.

我试图修复这个在许多方面 - 配置我的应用程序中 FB开发页面(如改变应用类别:游戏,旅游.etc),增加新的权限共享(但我还没有发现,那温馨的需要的话),使用的 GamesRequests (但我的应用程序是不是一个游戏,它的Andr​​oid +帆布应用程序)。于是我又回到了AppInviteDialog。

I have tried fix this in many ways - configure my app in FB dev page (like changing app category: game, travel .etc), adding new permission for sharing (but I haven't found, that inviting is required it), using GamesRequests (but my app isn't a game, it's android + canvas app). So I have returned again to AppInviteDialog.

另外,我还试图用它自己的实例,与听众,而不是静态类。

Also, I have trying to use own instance of it, with listeners, instead of static class.

inviteDialog = new AppInviteDialog(this);
inviteDialog.registerCallback(callbackManager, new FacebookCallback<Result>() {
    @Override
    public void onSuccess(Result result) {
        Log.i(TAG, "MainACtivity, InviteCallback - SUCCESS!");
    }

    @Override
    public void onCancel() {
        Log.i(TAG, "MainACtivity, InviteCallback - CANCEL!");
    }

    @Override
    public void onError(FacebookException error) {
        Log.e(TAG, "MainACtivity, InviteCallback - ERROR! " + error.getMessage());
    }
});

和调用它,就像在教程

 if(AppInviteDialog.canShow()) {
        AppInviteContent content = new AppInviteContent.Builder()
            .setApplinkUrl(appUrl)
            .setPreviewImageUrl(imagePreviewUrl)
            .build();
            //AppInviteDialog.show(this, content); //static
        inviteDialog.show(content); //my instance
  }

但是,所有我所得到的是:

But all what i get is:

在使用 AppLinks 创建链接到我的应用程序,并使用它在AppInviteDialog,现在一切工作正常。 这是一个有点混乱,在文档没有明确说明,是什么样的联系需要使用方法:AppLinks链接或只是应用程序的链接(链接到你的FB的应用程序)

After creating link to my app using AppLinks, and using it in the AppInviteDialog, now all works fine. It's a bit confusing, that in documentation not clearly described, what kind of link need to use: "AppLinks link" or just "app link (link to your fb app)".

推荐答案

有一个错误信息?

我得到这个,如果我不使用AppLink。

I get this if I don't use an AppLink.

https://developers.facebook.com/quickstarts/1374389166202673/?platform=app-links-host

这篇关于AppInviteDialog不工作在Android的Facebook的SDK 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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