Node-Webkit Facebook集成 [英] Node-Webkit Facebook integration

查看:150
本文介绍了Node-Webkit Facebook集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用node-webkit建立一个新闻阅读器 - 桌面应用程式

I am building a newsreader-ish desktop app using node-webkit

https://github.com/rogerwang/node-webkit

这是基本上同时是服务器和客户端。我的问题与facebook的API是以下:我想让我的应用程序的用户登录,并提出他们当前的墙贴和这样的东西。此外,我有一些来自其他来源的新闻项目,应该是喜欢/可以从这个用户共享。

which is basically server and client at the same time. My Problem with the facebook API is the following: i want the user of my app to login and present them their current wall-postings and the stuff like this. In addition, i have a couple of news-items from other sources, which should be like-able/share-able from this user.

整个应用程序是一个单页的JS(更确切地说:coffeescript)有多个组件,硬重定向是不可能的。

The whole app is a single-page JS (more exactly: coffeescript) thing with multiple components, a hard redirect is impossible.

API中显示的每个登录可能性似乎不适合我的应用程序类型。什么是最好的方式连接到Facebook,没有硬重定向,没有自己的URI重定向到?

Every login-possibility shown in the API seems not suited for my type of application. What is the best way to connect to facebook, without having a hard redirect and without an own URI to redirect to?

推荐答案

如果您正在开发一个独立的客户端应用程序,而不是网站,我不会尝试使用他们的Javascript API,因为它假设它在某些网站上运行。

If you're developing a standalone client application, not a website, I wouldn't try to use their Javascript API, because it assumes it's being run on some website.

您可能有更多的运气与非官方的Node.js API ,看到node-webkit允许你从DOM内部调用任何Node.js库。

You might have more luck with the unofficial Node.js APIs, seeing as node-webkit allows you to make calls to any Node.js library from within the DOM.

如果您仍然没有成功,请尝试让用户登录Facebook本身,将其登录页面显示在< iframe> 中。然后,您可以通过AJAX或通过Node.js HTTP API进行HTTP调用,直接调用Facebook的内部API。

If you still have no success, try letting the user log into Facebook itself, presenting its login page in an <iframe>. Then you might be able to make HTTP calls, either through AJAX or through Node.js HTTP APIs, to call Facebook's internal APIs directly.

这篇关于Node-Webkit Facebook集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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