简体   繁体   English

将facebook整合到Android应用程序

[英]Integrating facebook to android app

I have a simple question here. 我这里有一个简单的问题。 What is the need for integrating FB sdk to android app. 将FB sdk集成到Android应用程序的需求是什么?

I can open the facebook url in web view and login and do whatever to be done on FB. 我可以在Web视图中打开facebook url并登录并在FB上做任何事情。 Then what will be the scenario where FB need to be integrated with my app . 那么FB需要与我的应用程序集成的场景是什么。

With Facebook sdk, you can upload photos directly to your Facebook albums, and also you can get all the user likes, friends and many more. 使用Facebook sdk,您可以将照片直接上传到您的Facebook相册,还可以获得所有用户的喜欢,朋友等等。

Compared to work with webview, the use of sdk saves time for your app user - he don't need to login every time he want's to enter his profile (Using sso - Single Sign On) or any other thing, that requires Facebook. 与使用webview相比,使用sdk可以为您的应用程序用户节省时间 - 他不需要每次想要输入他的个人资料(使用sso - 单点登录)或任何其他需要Facebook的东西时登录。

In my case, I activate the native Facebook app directly from my app, with my app page. 在我的情况下,我直接从我的应用程序,我的应用程序页面激活本机Facebook应用程序。 In my opinion, if you don't need something more sophisticated, just showing page, you can use it. 在我看来,如果你不需要更复杂的东西,只需要显示页面,你就可以使用它。

In case there is no native Facebook app, activate it with the user browser (catch block). 如果没有原生Facebook应用程序,请使用用户浏览器激活它(catch块)。

try{

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/" + PROFILE_FACEBOOK_APP_ID));
startActivity(intent);

}catch(Exception e){

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.facebook.com/UserNamePage")));
}

In general, the integration is used when the developer wants to post on a users' behalf, add pictures directly to specified albums, get a user's email address etc. 通常,当开发人员想要代表用户发布,直接将图片添加到指定的相册,获取用户的电子邮件地址等时,就会使用集成。

These can be done when the user authorises the app for the first time, they also authorise the privileges. 这些可以在用户第一次授权应用程序时完成,他们还授权权限。

It is also seen as a marketing tool, as all the posts will say via (yourAppName), so you can gain some online presence. 它也被视为一种营销工具,因为所有帖子都会通过(yourAppName)说明,因此您可以获得一些在线状态。

Like Ofir A said, it is time saving for the user as they only need to log in once. 像Ofir A说的那样,为用户节省时间,因为他们只需要登录一次。

Hi Why you are calling webview with facebook link.You should use FaceBook Native Sdk for Android.This giveing your better user experience compare to webview. 嗨为什么你用facebook链接调用webview。你应该使用FaceBook Native Sdk for Android。这样​​可以提供比webview更好的用户体验。 Refrence for Facebook Integration 对Facebook整合的反思

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

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