Projects Social Media Sign Up Project
Project
Cancel

Social Media Sign Up Project

Preview Image

Nowadays most of the mobile apps are integrating with the most famous social media platforms (Facebook, Instagram, Twitter, Google Plus and LinkedIn).

For the developer, it’s going to be a hassle to communicate with all of these platforms. So, SocialMediaSignUp library makes the magic for you, with only one line of code, you can integrate with the most famous social media platform :

  • Facebook
  • Instagram
  • Twitter
  • Google Plus
  • LinkedIn

And get the user data without handling anything from your side. SO EASY SO SIMPLE.


Github Project

You can check the whole project here.


Features

  • Sign up with the most famous social media platforms which are :
    • Facebook
    • Instagram
    • Twitter
    • Google Plus
    • LinkedIn
  • Adding scopes for each platform according to the application needs.
  • Support default scopes to get the minimum user data.
  • Used inside Activity, Fragment or event Custom View.
  • Update the social media sdk versions in gradle file of your application, which guarantee the up-to-date social media sdk versions.
  • Adding the social media public, secret and application keys in the gradle file of your application to guarantee the totally isolation between the library and the integrated application.
  • No need to add anything in Manifest.xml file, we did all of these to you in SocialMediaSignUp library ;).
  • Easily integration, with only one line of code, you will have the user data starting from access token to personal data like name, email and profile picture.

Benefits

  • Free Hassle of integration with more that four social media platforms.
  • Increase isolation, good code structure and separation.
  • Easy integration, with only one line of code, and that’s it ;).

Installation

For Gradle Step 1 : Add it in your root build.gradle at the end of repositories:

1
2
3
4
5
6
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2 : Add the dependency

1
2
3
dependencies {
        implementation 'com.github.ahmed-adel-said:socialmediasignup:v1.0'
}

For Maven Step 1 : Add it in your root build.gradle at the end of repositories:

1
2
3
4
5
6
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Step 2. Add the dependency

1
2
3
4
5
<dependency>
    <groupId>com.github.ahmed-adel-said</groupId>
    <artifactId>socialmediasignup</artifactId>
    <version>-v1.0</version>
</dependency>

Documentation - The first two points are mandatory:

  1. To add your public, secret and application keys for every social media platform, all you have to do is to override the default values that the library has and put or own values in the build.gradle file app of your app module:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    android.defaultConfig.manifestPlaceholders = [
         facebookAppId         : "FACEBOOK_APP_ID",
         googleWebClientId     : "GOOGLE_WEB_CLIENT_ID",
         twitterConsumerKey    : "TWITTER_CONSUMER_KEY",
         twitterConsumerSecret : "TWITTER_CONSUMER_SECRET",
         instagramClientId     : "INSTAGRAM_CLIENT_KEY",
         instagramClientSecret : "INSTAGRAM_CLIENT_SECRET",
         instagramRedirectUri  : "INSTAGRAM_REDIRECT_URI"
    ]
    
  2. You must add the social media sdk versions by yourself in the build.gradle file of the project module. Since our SocialMediaSignUp library will wait them from you to be your mission to always making the social media sdk versions up-to-date:
    1
    2
    3
    4
    5
    6
    7
    
    ext {
     socialMediaSignUpLibraries = [
             facebookVersion  : '4.30.0',
             googlePlusVersion: '11.8.0',
             twitterVersion   : '3.2.0'
     ]
    }
    
  3. If you want to get user data of any of the five social media platforms, all you have to do is to write this one line of code:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    
    /**
     * @param socialMediaType is enum class that has types of all social media platforms.
     * @param scopes that can be passed to each social media platform.
     * @param callback that will be fired once there is success, error, or sign out happens during the connection with any social media platform.
     */
    SocialMediaSignUp.getInstance().connectTo(
     SocialMediaType socialMediaType, List<String> scopes, SocialMediaSignUpCallback callback
    );
    /**
     * This is only for connecting with LinkedIn social media platform.
     * @param linkedInScope that will be passed to LinkedIn social media platform.
     * @param callback that will be fired once there is success, error, or sign out happened during the connection with LinkedIn social media platform.
     */
    SocialMediaSignUp.getInstance().connectToLinkedIn(
     Scope linkedInScope, SocialMediaSignUpCallback callback
    );
    
  4. While if you want to disconnect the connection between any of the five social media platforms, here is how can you make it :
    1
    2
    3
    4
    5
    6
    7
    
    /**
     * @param socialMediaType is enum class that has types of all social media platforms.
     * @param callback that will be fired once there is success, error, or sign out happens during the connection with any social media platform.
     */
    SocialMediaSignUp.getInstance().disconnectService(
     SocialMediaType socialMediaType, SocialMediaSignUpCallback callback
    );
    
  5. Here is the SocialMediaType enum class :
    1
    2
    3
    4
    5
    6
    7
    
    enum SocialMediaType {
         FACEBOOK("facebook"),
         GOOGLE_PLUS("google_plus"),
         TWITTER("twitter"),
         INSTAGRAM("instagram"),
         LINKEDIN("linkedin");
    }
    
  6. And the SocialMediaSignUpCallback interface :
    1
    2
    3
    4
    5
    
    public interface SocialMediaSignUpCallback {
     void onSuccess(SocialMediaSignUp.SocialMediaType socialMediaType, SocialMediaUser socialMediaUser);
     void onError(Throwable error);
     void onSignOut(SocialMediaSignUp.SocialMediaType socialMediaType);
    }
    
This post is licensed under CC BY 4.0 by the author.

PhotoEditor SDK

Github Repositories Simple App

Loading comments from Disqus ...