简体   繁体   English

Unity3d Facebook AppRequest过滤器

[英]Unity3d Facebook AppRequest filter

In my Unity project for IOS i use FB.AppRequest( 在我的IOS Unity项目中,我使用FB.AppRequest(
message: "somedesc", 讯息:“ somedesc”,
title: "sometitle", 标题:“ sometitle”,
callback:appRequestCallback ); callback:appRequestCallback);
I want filter and show only friends who don't install app, but filters = ["app_users"] and excludeIds = "someIdValue" not working 我想要过滤器并仅显示未安装应用程序的朋友,但是过滤器= [“ app_users”]和excludeIds =“ someIdValue”不起作用

How solved this problem 如何解决这个问题

(I use Facebook Unity SDK, https://developers.facebook.com/docs/unity ) (我使用Facebook Unity SDK, https://developers.facebook.com/docs/unity

You can use this: 您可以使用此:

// "app_non_users" will list friends that haven't installed the game yet
List<object> filter = new List<object>() { "app_non_users" };
// Then, call the API with this filter. Enjoy!
FB.AppRequest("Test Message", null, filter, null, 0, string.Empty, string.Empty, this.HandleResult);

In the examples that are provided within the Facebook SDK for Unity, there's a scene called AppRequests . 在用于Unity的Facebook SDK中提供的示例中,有一个名为AppRequests的场景。 From there, I've seen a class named AppRequests.cs, in which you can find several examples on how to use these app requests. 从那里,我看到了一个名为AppRequests.cs的类,您可以在其中找到有关如何使用这些应用程序请求的几个示例。 Note: To try this examples, make sure to add all FacebookSDK provided scenes to your build settings scenes. 注意:要尝试此示例,请确保将所有FacebookSDK提供的场景添加到构建设置场景中。 Test them in device. 在设备中对其进行测试。

FB Unity SDK documentation says that filters are currently supported: FB Unity SDK文档说当前支持过滤器:

Filter are currently not supported for mobile devices 移动设备当前不支持过滤器

You should probably get list of friends first with a request like this with FB.API method : 您可能应该首先使用FB.API方法通过这样的请求获取朋友列表:

FB.API ("/me/friends?installed=false", HttpMethod.GET, Callback, null);

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

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