Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Rest 黑莓-Facebook扩展权限_Rest_Blackberry_Facebook - Fatal编程技术网

Rest 黑莓-Facebook扩展权限

Rest 黑莓-Facebook扩展权限,rest,blackberry,facebook,Rest,Blackberry,Facebook,我刚找到Eki Y.Baskoro的一个很好的样品 以下是在Blackberry上使用Facebook Connect的简短说明。我创建了一个简单的Facade,封装了FacebookRESTAPI,并添加了用于屏幕导航的“粗略”MVC方法。我已经使用8320模拟器在JDE4.5上进行了测试。这项工作仍在进行中,所有工作均已完成 它非常适合阅读材料 NB别忘了在TestBB类中设置它 但是现在我想在我的墙上贴些东西。因此,我使用以下方法向FacebookFacade类添加了新方法: 这将返回错误

我刚找到Eki Y.Baskoro的一个很好的样品

以下是在Blackberry上使用Facebook Connect的简短说明。我创建了一个简单的Facade,封装了FacebookRESTAPI,并添加了用于屏幕导航的“粗略”MVC方法。我已经使用8320模拟器在JDE4.5上进行了测试。这项工作仍在进行中,所有工作均已完成

它非常适合阅读材料

NB别忘了在TestBB类中设置它

但是现在我想在我的墙上贴些东西。因此,我使用以下方法向FacebookFacade类添加了新方法:

这将返回错误代码200,“用户尚未授权应用程序执行此操作”

首先,我认为它与Facebook->应用程序设置->附加权限->将最近的活动(一行故事)发布到我的墙上有关,但即使选中,也没有区别

然后我发现这解释了这个问题

这反过来应通过以下方式解决:

不幸的是,它不起作用。返回stream.publish请求时仍然出现错误代码200

你对如何解决这个问题有什么建议吗


谢谢大家!

我已经在我的网站()上发布了更新的API,这应该可以解决这个问题。请告诉我其他情况

萨拉姆。干杯


Eki

您好,即使我使用的是相同的baskaro代码,但一开始我得到的是无效参数错误。在为LoginScreen构造函数编写代码之后,现在我获得了成功,但它没有重定向到另一个页面。你能帮我解决这个问题吗?页面只显示成功,没有其他内容。Sunil,这个问题已经解决了。请查看我的网站或直接访问Facebook BlackBerry SDK项目网站()@Eki此SDK是否仅适用于wi-fi连接?它在blackberry internet连接上无法正常工作。请帮忙。。
 /***
 * Publishes message to the stream.
 * @param message - message that will appear on the facebook stream
 * @param targetId - The ID of the user, Page, group, or event where 
 *     you are publishing the content.
 */
public void streamPublish(String message, String targetId)
{
    Hashtable arguments = new Hashtable();
    arguments.put("method", "stream.publish");
    arguments.put("message", message);
    arguments.put("target_id", targetId);
    try {
        JSONObject result = new JSONObject(
        int new JSONTokener(sendRequest(arguments)));            
        int errorCode = result.getInt("error_code");
        if (errorCode != 0) System.out.println("Error Code: "+errorCode);
    } catch (Exception e) {
        System.out.println(e);
    }
}

 /***
 * Publishes message on current user wall.
 * @param message - message that will appear on the facebook stream
 */
public void postOnTheWall(String message)
{
    String targetId = String.valueOf(getLoggedInUserId()); 
    streamPublish(message, targetId);
}
public LoginScreen(FacebookFacade facebookFacade) {
    this.facebookFacade = facebookFacade;

    StringBuffer data = new StringBuffer();
    data.append("api_key=" + facebookFacade.getApplicationKey());
    data.append("&connect_display=popup");
    data.append("&v=1.0");
    //revomed
    //data.append("&next=http://www.facebook.com/connect/login_success.html");
    //added     
    data.append("&next=http://www.facebook.com/connect/prompt_permissions.php?" +
    "api_key="+facebookFacade.getApplicationKey()+"&display=popup&v=1.0"+
    "&next=http://www.facebook.com/connect/login_success.html?"+
    "xxRESULTTOKENxx&fbconnect=true" +
    "&ext_perm=read_stream,publish_stream,offline_access");     
data.append("&cancel_url=http://www.facebook.com/connect/login_failure.html");
    data.append("&fbconnect=true");
    data.append("&return_session=true");
    (new FetchThread("http://m.facebook.com/login.php?" 
            + data.toString())).start();
}