简体   繁体   English

在C#Facebook MVC应用程序模板中,如何获取我的应用程序的ads_read权限?

[英]In C# Facebook MVC app template, how to get ads_read permission for my app?

I'm using Facebook Template, as shown here . 我使用Facebook的模板,如图所示这里 I'm using Microsoft.AspNet.Facebook by Microsoft and Facebook by Outercurve Foundation nuget packages. 我正在使用Microsoft的Microsoft.AspNet.Facebook和Outercurve Foundation的nuget包。

Original code in HomeController looks like this: HomeController中的原始代码如下所示:

    [FacebookAuthorize("email", "user_photos")]
    public async Task<ActionResult> Index(FacebookContext context)

When I tried to add ads-related permissions like that: 当我尝试添加类似广告的权限时:

    [FacebookAuthorize("email", "user_photos", "ads_management", "ads_read")]
    public async Task<ActionResult> Index(FacebookContext context)

nohting changed. 点头改变了。 I expected that my app will generate two permission screens when I access it, just the way Graph Api Explorer does. 我希望我的应用在访问时会生成两个权限屏幕,就像Graph Api Explorer一样。 Ads-related permissions should be on second screen. 与广告相关的权限应显示在第二个屏幕上。 But it didn't, it simply displayed only the first screen, requesting access to my public profile. 但事实并非如此,它仅显示了第一个屏幕,请求访问我的公开个人资料。

So where / how I should declare my app needs access to ads and insights? 那么,在哪里/如何声明我的应用需要访问广告和见解?

I already can read them, if I manually provide access token with proper permissions (for example, from PHP code). 如果我手动提供具有适当权限的访问令牌(例如,来自PHP代码),我已经可以阅读它们。 Only thing I don't know how to do is obtaining proper token - or forcing package to do it properly. 我唯一不知道该怎么做的就是获取适当的令牌-或强迫程序包正确地执行此操作。

As you can see in this question, your app needs to get approved first. 正如您在问题中看到的那样,您的应用需要首先获得批准。 Look at this overview . 看一下这个概述

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

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