Google+ Tools
Make Google+ profile picture
Make Google plus banners for profile
Create and share your Google Plus profile banners.

Profile image for mrk studios indianocean on April 14, 2011
Language
Java
Tags

Check if app is liked on Facebook without requesting permission


public boolean isLikedOnFacebook( String signedRequest ) throws IOException, JsonException
   {
      String payload = signedRequest.split( "\\." )[ 1 ];
      String replaced1 = payload.replaceAll( "-", "+" );
      String replaced2 = replaced1.replaceAll( "_", "/" );
      BASE64Decoder decoder = new BASE64Decoder();
      byte[] decodedBytes = null;
      decodedBytes = decoder.decodeBuffer( replaced2 );
      String decodedString = new String( decodedBytes );
      JsonObject jsonObject = new JsonObject( decodedString );
      if( jsonObject.getJsonObject( "page" ).get( "liked" ).equals( "true" ) )
      {
         return true;
      }
      else
      {
         return false;
      }
   }

Comments

blog comments powered by Disqus