Skip to content

Instantly share code, notes, and snippets.

@deanpanayotov
Created July 18, 2014 10:04
Show Gist options
  • Save deanpanayotov/1bbc3d66813cc98b8113 to your computer and use it in GitHub Desktop.
Save deanpanayotov/1bbc3d66813cc98b8113 to your computer and use it in GitHub Desktop.

1.1 Facebook

  1. Go to https://developers.facebook.com/apps

  2. Click "+ Create New App" (top right);

  3. Fill the form - namespace is not important

  4. Click "Create App" (bottom right);

  5. App Dashboard screen loads

  6. Click "Settings" (left)

  7. Click "+ Add platform"

  8. Add package name, launch activity name, and hash obtained by one of these ways(the second way is preferred):

  9. Using keytool: In command prompt execute: keytool: keytool -exportcert -alias <RELEASE_KEY_ALIAS> -keystore <RELEASE_KEY_PATH> | openssl sha1 -binary | openssl base64

  10. Executing the following code in the onCreate() method of the launch activity of the app (the hash will be dumped in logcat with tag "KeyHash"):

    
    try {
        PackageInfo info = getPackageManager().getPackageInfo(
                "com.facebook.samples.hellofacebook", 
                PackageManager.GET_SIGNATURES);
        for (Signature signature : info.signatures) {
            MessageDigest md = MessageDigest.getInstance("SHA");
            md.update(signature.toByteArray());
            Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
            }
    	} catch (NameNotFoundException e) {
    	} catch (NoSuchAlgorithmException e) {
    }
    
  11. Put manifestmerger.enabled=true in project.properties or paste this in your AndroidManifest.xml file:

         <meta-data
             android:name="com.facebook.sdk.ApplicationId"
             android:value="@string/app_id" />
    
         <activity
             android:name="com.facebook.LoginActivity"
             android:label="@string/app_name" />
    
  12. Put <string name="app_id">your app id here</string> in res/values/strings.xml

  13. You are ready for coding in Java!

1.2 Google+

  1. Go to https://console.developers.google.com/project

  2. Click "Create Project" (top left)

  3. Fill out the form (project id is not important)

  4. Wait up to 30 seconds for the project creation task to resolve

  5. Project Dashboard loads

  6. Select "APIs & auth" (left)

  7. APIs submenu is selected; Scroll down to "Google+ API" and enable it

  8. Click on "Credentials" submenu (left)

  9. Click "Create new Client ID"

  10. Select "Installed application"

  11. Select "Android"

  12. Put package name

  13. Put SHA1 hash obtained by:

    1. Using Eclipse:
      1. Go to Window > Preferences
      2. Click Android
      3. Click Build
      4. Copy SHA1 fingerprint
    2. Using keytool: execute in command prompt keytool -exportcert -alias androiddebugkey -keystore <path-to-debug-or-production-keystore> -list -v
  14. Set DEEP LINKING to Enabled

  15. Click "Create Client ID"

  16. Put manifestmerger.enabled=true in project.properties, if you haven't already or paste this in your AndroidManifest.xml file:

1.3 Twitter:

  1. Go to https://apps.twitter.com/

  2. Click "Create New App"

  3. Fill out the form (Website and Callback URL are not important)

  4. Select the "Permissions" tab

  5. Set permissions to "Read, Write and Access direct messages"

  6. Go to "API Keys" tab

  7. Use API Key and Secret and any callback URL you want in your application.

  8. Put manifestmerger.enabled=true in project.properties, if you haven't already or paste this in your AndroidManifest.xml file:

     <activity
     android:name="com.melon.android.socialnetworkslibrary.twitter.operation.login.TwitterLoginActivity"
     android:label="@string/app_name" />
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment