Latest 0.1.1
Homepage https://github.com/CloudRail/SocialLogin-ios
License MIT
Platforms ios 9.3
Dependencies cloudrail-si-ios-sdk, FoldingTabBar
Frameworks UIKit
Authors

Screenshots

SocialLogin
SocialLogin
SocialLogin

Example

To run the example project, clone the repo, and run pod install from the Example directory first. Then open the .xcworkspace file inside the example directory. Build and run the project.

Installation

SocialLogin is available through CocoaPods. To install
it, simply add the following line to your Podfile, remember to add it to a specific target:

pod "SocialLogin"

Usage

You can add up to six services, listed here (link). On the view controller that you wish to perform the seguie to the SocialLoginViewController, add services using the respective enum ServiceName , clientID and clientSecret. These values can be found on the developers console of each service. You can use this excellent post as a reference for getting all the necessary values.

SocialLogin.addServiceNamed("Facebook", clientID:"CLIENT_ID", clientSecret: "CLIENT_SECRET")
SocialLogin.addServiceNamed("Linkedin", clientID:"CLIENT_ID", clientSecret: "CLIENT_SECRET")
SocialLogin.addServiceNamed("MicrosoftLive", clientID:"CLIENT_ID", clientSecret: "CLIENT_SECRET")
SocialLogin.addServiceNamed("Yahoo", clientID:"CLIENT_ID", clientSecret: "CLIENT_SECRET")
SocialLogin.addServiceNamed("Instagram", clientID:"CLIENT_ID", clientSecret: "CLIENT_SECRET")
SocialLogin.addServiceNamed("Twitter", clientID: "CLIENT_ID", clientSecret: "CLIENT_SECRET")

SocialLogin.performSegueToSocialLoginVC(self);// perform the segue

Only Services

In case you dont want to implement a native login feature using the pod, you can set the shouldPresentNativeLogin to false

SocialLogin.shouldPresentNativeLogin = false
SocialLogin.performSegueToSocialLoginVC(self);// perform the segue

With Username and Password

In case you dont want to implement a native login feature using the pod, you can set the shouldPresentNativeLogin to false

SocialLogin.shouldPresentNativeLogin = true // default
SocialLogin.performSegueToSocialLoginVC(self);// perform the segue

Delegate

To actually get the maximum of the pod benefits its necessary to implement the SocialLoginDelegate and set it before performing the segue.

class ViewController: UIViewController, SocialLoginDelegate { /* class code*/}
SocialLogin.delegate = self
SocialLogin.performSegueToSocialLoginVC(self);

To get the accessToken you need to implement the delegate method:

func socialLoginDidAuthenticatedWithService(service:Service , accessToken: String, refreshToken:String, rawState:String)

The Pod also provides other optional delegaete methods:

public protocol SocialLoginDelegate {

func socialLoginDidAuthenticatedWithService(service:Service , accessToken: String, refreshToken:String, rawState:String)
func socialLoginShouldDismissAfterLoginbutton()->Bool
func socialLoginViewDidPressLoginButtonWith(username:String?, password:String?)
func socialLoginDidFailWithError(error:ErrorType)
}

Services List

  • Facebook
  • Twitter
  • GitHub
  • Google Plus
  • Instagram
  • LinkedIn
  • Microsoft Live
  • Slack
  • Yahoo

Author

CloudRail, [email protected]

License

SocialLogin is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SocialLogin",
    "version": "0.1.1",
    "summary": "Social Login uses CloudRail SDK with the objective to ease authentications processes",
    "description": "Social Login uses CloudRail SDK with the objective to ease authentications processes in services such Facebook, Instagram, Twitter, linkedIn, GooglePlus, Yahoo, GitHub, Slack, MicrosoftLive. Only the client ID and client secret are needed.",
    "homepage": "https://github.com/CloudRail/SocialLogin-ios",
    "screenshots": [
        "https://s14.postimg.io/fh4su5bap/Simulator_Screen_Shot_06_Sep_2016_15_23_28.png",
        "https://s14.postimg.io/58cbobn8x/Simulator_Screen_Shot_06_Sep_2016_15_23_51.png"
    ],
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Felipe Cesar": "[email protected]"
    },
    "source": {
        "git": "https://github.com/CloudRail/SocialLogin-ios.git",
        "tag": "0.1.1"
    },
    "social_media_url": "https://twitter.com/CloudRail",
    "platforms": {
        "ios": "9.3"
    },
    "source_files": "SocialLogin/Classes/**/*.{swift,m,h}",
    "resource_bundles": {
        "SocialLogin": [
            "SocialLogin/Classes/**/*.{storyboard,xib}",
            "SocialLogin/Assets/**/*.{png,jpg,jpeg}"
        ]
    },
    "frameworks": "UIKit",
    "dependencies": {
        "cloudrail-si-ios-sdk": [
            "~> 3.2.4"
        ],
        "FoldingTabBar": []
    }
}

Pin It on Pinterest

Share This