在Facebook墙壁和Facebook的朋友墙上张贴图像 [英] post image on Facebook wall and facebook friends wall

查看:119
本文介绍了在Facebook墙壁和Facebook的朋友墙上张贴图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很厌倦API的问题,如Facebook Graph API,天气API等。



我在项目中使用了两个API。 Graph API适用于Facebook和Google天气API的天气,但现在在项目完成的时候,这两个API都不工作。 Google天气API在十一月份贬值,



而我一直在使用的Facebook功能(墙上的图像和朋友墙上的贴图)都在上班,但现在他们没有。



问题是当我登录时,我收到消息找不到您要求的页面以下链接返回上一页。





当我点击链接返回上一页时,会显示消息:

  AppName发生错误,请再次尝试
API错误代码:100
API错误说明:无效参数
Error_message: cancel_URL URL格式不正确

我想知道Facebook API的解决方案。这个问题是每个开发人员?如果API修改或更改了我们可以做的事情?

解决方案

你更新了Facebook API多久以前?大约两个星期前,我不得不删除我的整个API,重新下载,并更改我的应用程序正在使用的所有发布代码。它完全停止工作,直到应用程序用户抱怨。新的Facebook API的一些必要的更改:



如果您查看最新的示例应用程序,Facebook建议将这些更改为您的AppDelegate。

  #import< FacebookSDK / FacebookSDK.h> 

- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
NSArray * permissions = [NSArray arrayWithObjects:@publish_actions,nil];
return [FBSession openActiveSessionWithPermissions:permissions
allowLoginUI:allowLoginUI
completionHandler:^(FBSession * session,FBSessionState state,NSError * error){
if(state == 513){
// facebook的使用已被批准
}
}];


- (BOOL)应用程序:(UIApplication *)应用程序
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
注释:(id)注释{
//我们需要通过将URL传递给FBSession来处理URL,以便SSO身份验证
//可以正常工作。
return [FBSession.activeSession handleOpenURL:url];
}

无论你想让你的帖子如下:

  if(facebookEnabled == YES)
{

NSString * fbText = [NSString stringWithFormat:@ 任何你想发布的文字;

[FBRequestConnection startForPostStatusUpdate:fbText
completionHandler:^(FBRequestConnection * connection,id result,NSError * error)
{
}];
}

如果您有任何问题,请通知我。希望有帮助!


I am very tired with the problems of API, like Facebook Graph API, weather API etc.

I've used both API in my project. Graph API for Facebook and Google weather API for weather, but now on time of project completion, both API are not working. Google weather API depreciated in November,

And the Facebook features I've been using (post image on wall and post image on friend wall) were working last day, but now they don't.

The problem is that when I log in, I get the message The page you requested is not Found and below a link to go back to the previous page.

And when i click the link "back to previous page" it shows message:

An error has occurred with AppName, please try again
API error code : 100
API error Description : Invalid Parameter
Error_message : cancel_URL URL is not properly formatted

I wants to know solution of Facebook API. Is this problem is with every developer? if API modified or changed what we can do regarding?

解决方案

How long ago did you update your facebook API? About two weeks ago I had to remove my entire API, redownload, and change all the posting code my app was using. It stopped working entirely and had no idea until app users complained. Some necessary changes for the new facebook API:

Facebook recommends putting these in your appDelegate if you look at the newest sample apps.

    #import <FacebookSDK/FacebookSDK.h>

     - (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
        NSArray *permissions = [NSArray arrayWithObjects:@"publish_actions", nil];
                return [FBSession openActiveSessionWithPermissions:permissions
                                                      allowLoginUI:allowLoginUI
                                                 completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
     if(state==513){
                   //facebook usage has been approved
                   }
                   }];
            }    

     - (BOOL)application:(UIApplication *)application
                        openURL:(NSURL *)url
              sourceApplication:(NSString *)sourceApplication
                     annotation:(id)annotation {
                // We need to handle URLs by passing them to FBSession in order for SSO authentication
                // to work.
                return [FBSession.activeSession handleOpenURL:url];
            }

And whereever you want to make your post put something like this:

    if(facebookEnabled==YES)
    {

     NSString *fbText=[NSString stringWithFormat:@"whatever text you want to post";

            [FBRequestConnection startForPostStatusUpdate:fbText
                                        completionHandler:^(FBRequestConnection *connection, id result, NSError *error) 
{
                                                                                    }];
    }

Let me know if you have questions. Hope it helps!

这篇关于在Facebook墙壁和Facebook的朋友墙上张贴图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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