samedi 18 avril 2015

Android Studio with Facebook (Login+Share Function)

I am a beginner who making an android app by using android studio which need Facebook login+share function.


To add a Share button add the following code snippet to your view:



ShareButton shareButton = (ShareButton)findViewById(R.id.fb_share_button);
shareButton.setShareContent(content);


I don't understand my view is in which class? Where actually should i put the code?


Is that any relevant tutorial which suitable for beginner steps by steps? Please recommend to me... Thank you in advance.


Login button is 'ghosted' in facebook login for android

I have the following code for the facebook login in an android Fragment:



loginButton = (LoginButton) fragment.findViewById(R.id.login_button);
loginButton.setReadPermissions("user_friends");
// If using in a fragment
loginButton.setFragment(this);
// Other app specific specialization

// Callback registration
loginButton.registerCallback(C.callbackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {

Log.wtf("onSuccess",loginResult.toString());

}

@Override
public void onCancel() {

Log.wtf("onCancel","");
}

@Override
public void onError(FacebookException exception) {
Log.wtf("onError",exception.toString());
}
});


The login button appears and when I click it a pop up appears asking for the login. I can enter the email and password but the button to send the credentials to facebook's servers does not function, not even click.


Sometimes I get these errors when the first menu (where the user is asked the credentials) doesn't open (happens frequently):



04-18 17:36:12.936 1607-1607/ E/ActivityThread﹕ Failed to find provider info for com.facebook.katana.provider.PlatformProvider
04-18 17:36:12.936 1607-1607/ E/ActivityThread﹕ Failed to find provider info for com.facebook.wakizashi.provider.PlatformProvider

Using facebook sdk alongside android app and web server

I am looking to implement the Facebook login SDK for my android app and will be asking permissions for user friend list. However most of my background work happens on my web server and I communicate with my app via volley. I am wondering whether I can get the friend list via the web server once the user grants permission on my app or do I have to get the friend list through my app and send it to the server. Thanks for the help


Security Warning Facebook raplaced meta-description in serp

if you search "discolaser" in google, the first result is the website with the Security Warning problem. The website has not done with any cms but i has a separated wordpress blog. It seems that the problem is in homepage, but i'm not be able to solve it... can you help me please?


Thanks, bye!


How to handle conection with multiple accounts in Meteor?

On my app, users can login and signup with the accounts-password package.


I added service configuration and facebook packages to allow them to connect user external service.


For now, users can log in using a "connect with facebook" button, or using the classical method (email + password).


But my problem is that, when a user log in with facebook, he is only "logged", his profile is empty, all the data i have about him is his _id and profile{name: "his facebook name")}.


I'd like to be able to get more informations to complete his profile from facebook informations, and so, check if it is the first time he connect via facebook. If it is, he must add some informations to be able to naviguate through the website.


The problem is that i can not find ANY usefulll doc about the accounts-facebook package. Even on the official website, there is a link to the atmoshpere package page, but there is nothing else written on this page than the link to the official doc, wich sends me back to atmoshpere ... (Epic Doc....).


I googled a lot about that, but all i find was some smalls tutorials about how to add a "connect with facebook" button and how to set a facebook dev' app ... Nothing new for me.


Could someone guide me plz ?


Thanks you


Why absolutely nothing happens after calling onActivityResult() on the CallbackManager using the Facebook Login Button?

I've been trying to figure out how to solve this but was unsuccessful.


The problem here is after clicking the login button, it loads the Facebook Activity normally, and when it finishes, my activity receives the activity result and notifies the CallbackManager (all as described in the docs).


Unfortunately nothing happens from this point, no method from the registered FacebookCallback is executed, and not even a line is logged to inform of an error.


Here are the involved files:



public class LoginActivity extends Activity

CallbackManager callbackManager;
LoginButton loginFacebook;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FacebookSdk.sdkInitialize(this);

setContentView(R.layout.activity_login);


...


callbackManager = CallbackManager.Factory.create();
loginFacebook = (LoginButton) findViewById(R.id.login_button);
loginFacebook.setReadPermissions("public_profile","email");
loginFacebook.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {

@Override
public void onSuccess(LoginResult loginResult) {
...
(This is never executed)
}

@Override
public void onCancel() {
...
(Not executed)
}

@Override
public void onError(FacebookException e) {
...
(Not executed either)
}
});

}



@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
callbackManager.onActivityResult(resultCode, resultCode, data);
super.onActivityResult(requestCode, resultCode, data);
}


...


}


And activity_login.xml includes the button like this



<com.facebook.login.widget.LoginButton
android:id="@+id/login_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"/>


I also added the APP ID in my android manifest file



<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" />


As well as the android app key in the facebook application.


Hope figures out a solution for this, thank you very much.


Javascript facebook sdk login local

i've got this Facebook login in sdk it works fine on my server but i need to use it in local path (file://path) when user is online, but it doesn't work, i click the button without any effect this is the code



<html>
<head>
<link rel="stylesheet" type="text/css" href="../css/style.css">
<meta name="viewport" content="width=320, initial-scale=0.7, user-scalable=no">
<script src="JS/jquery-1.11.1.js.js"></script>
<link rel="stylesheet" type="text/css" href="../css/login.css">
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'MYAPPID', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});


FB.Event.subscribe('auth.authResponseChange', function(response)
{
if (response.status === 'connected')
{
window.location.replace("gestaccount.html");
}
else
{

}
});

};

function Login()
{

FB.login(function(response) {
if (response.authResponse)
{

} else
{
window.location.replace("errorconn.html");
}
},{scope: 'email,user_photos,publish_actions'});


}


// Load the SDK asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));

</script>
</head>

<body style=" background: #2c3338;
color: #606468;
margin: 0;">

<div id="navigation">
<table width="100%">
<tr valign="bottom">
<td valign="middle" width="25%" align="center">
<a href="eventi.php"><img src="IMG/icon/prvs.png" class="icons3"/></a>
</td>
<td valign="bottom" width="50%" align="center">
<img src="IMG/LOGO-WHITE.png" class="logonbar" alt="DONUT"/>
</td>
<td width="25%" align="center" valign="middle">

</td>
</tr>
</table>

</div>
<div id="fb-root"></div>


<br>
<div class="containerlogin">
<br><br><br><br><br>



<div id="login" style="display: block; margin:0 auto;" >

<img src="../IMG/LOGIN.png" class="iconlogin" alt="" style="display: block; margin: 0 auto;"/>


<p> <button type="submit" name="fb" onClick="Login()" class="button"> </button>


<p style="margin-left:25px;">Loggati e avrai la possibilità di tenere controllati
tutti le tue prenotazioni tra prevendite e tavoli.
Inoltre se sei PR contattaci per avere accesso a tutte
le funzionalità riservate. </p>
</div> <!-- end login -->

</div>

<br>
<br>
</div>




</div>



</body>
</html>


Thank you for answer.