将照片发布到iOS页面 [英] Post a photo to a page for iOS

查看:224
本文介绍了将照片发布到iOS页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将照片发布到用户不拥有的页面。请注意,我从其他讨论线程中找到的所有解决方案都要求用户具有管理权并获取具有* manage_pages *权限的页面的access_token。

I am trying to post a photo to a page that the user does not own. Note that all solutions that I found from other discussion threads require the user to be administrative and get the access_token of a page with *manage_pages* permissions.

然而,我想要的是什么要做的是不同的:使用iOS SDK将图像上传到页面,该页面有一个人们可以上传图像的设置。

However, what I want to do is different: Using iOS SDK to upload an image to a page, which has a setting that people can upload images to it.

我尝试了几种方法,但没有其中有效。

I try several ways, but none of them works.

以下是我获得权限的方式

Here is how I get permissions

NSArray *permissions = [[NSArray alloc] initWithObjects:
                            @"photo_upload",
                            @"share_item",
                            @"status_update",
                            @"manage_pages",
                            @"user_likes",
                            @"publish_stream", 
                            nil];
    [fb authorize: permissions];

以下是上传图片的代码

NSString *uri = [NSString stringWithFormat: @"%@/photos", FBPageId];
[fb requestWithGraphPath: uri
               andParams: params
           andHttpMethod: @"POST"
             andDelegate: self];

它一直将图像发布到用户的相册,这不是我想要的。

It kept posting the image to the user's album, which is not what I want.

如果有人知道怎么做,我将非常感激。谢谢!

I will really appreciate if anyone knows how to do it. Thank you!

推荐答案

我有两种可能的解决方法供你试用:

I have two potential workarounds for you to try out:


  1. 将图片发布到网页Feed而不是 {pageid} / photos

收集该页面的相册 {pageid} / albums 。现在使用正确的相册ID,将图片发布到 {albumId} / photos

Collect the albums for that page {pageid}/albums. Now with the correct album id, post the picture to {albumId}/photos.

这篇关于将照片发布到iOS页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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