How to parse or split URL Address in Java?

Use Android’s Uri class. Uri uri = Uri.parse(“”); String protocol = uri.getScheme(); String server = uri.getAuthority(); String path = uri.getPath(); Set<String> args = uri.getQueryParameterNames(); String limit = uri.getQueryParameter(“limit”);

Can you get a public Facebook page’s feed using Graph API without asking a user to allow?

If you’re anything like me your clients won’t want a standard Facebook likebox plugin, they’ll want it all styled and customised their own way. You don’t need to spend all day going round the official documentation wondering if any of it applies to you for something simple like this, it’s quite easy. The confusion arises … Read more

How to programmatically log out from Facebook SDK 3.0 without using Facebook login/logout button?

Update for latest SDK: Now @zeuter’s answer is correct for Facebook SDK v4.7+: LoginManager.getInstance().logOut(); Original answer: Please do not use SessionTracker. It is an internal (package private) class, and is not meant to be consumed as part of the public API. As such, its API may change at any time without any backwards compatibility guarantees. … Read more

Post to a facebook page without “manage_pages” permission using php

Request a new User Access Token by using the Graph API Explorer (with manage_pages permission, eventually in conjunction with publish_pages). Be sure to use one of your own apps, because you want to exchange the generated (short-lived) access token to a long-lived one: Copy the newly generated User Access Token from the according form field … Read more

Post to a Facebook user’s wall with cURL PHP

$attachment = array( ‘access_token’ => $token, ‘message’ => $msg, ‘name’ => $title, ‘link’ => $uri, ‘description’ => $desc, ‘picture’=>$pic, ‘actions’ => json_encode(array(‘name’ => $action_name,’link’ => $action_link)) ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,’’); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //to suppress the curl output $result = curl_exec($ch); … Read more

How to access Facebook private information by using ASP.NET Identity (OWIN)?

Create a new Microsoft.Owin.Security.Facebook.AuthenticationOptions object in Startup.ConfigureAuth (StartupAuth.cs), passing it the FacebookAppId, FacebookAppSecret, and a new AuthenticationProvider. You will use a lambda expression to pass the OnAuthenticated method some code to add Claims to the identity which contain the values you extract from context.Identity. This will include access_token by default. You must add email to … Read more