Latest 0.3.2
Homepage https://github.com/abring/sample_ios
License MIT
Platforms ios 10.0
Dependencies Alamofire, SwiftyJSON
Authors

pod
Platform
language
License

Preview

Abring

About

Abring makes it easy to implement login to your app.

Requirements

  • iOS 10.0+
  • XCode 9.0
  • Swift 4

Integration

CocoaPods

You can use CocoaPods to install Abring by adding it to your Podfile:

platform :ios, '10.0'
use_frameworks!

target 'MyApp' do
    pod 'Abring'
end

Usage

Go to Abring.ir website and add an app in your panel.
You must set project name in ABAppConfig later in your project.

Type these to the Appdelegate.swift file:

import Abring
ABAppConfig.name = "your App Id"

The login viewcontroller is highly customizable:

ABAppConfig.font = UIFont.systemFont(ofSize: 14) //or your own font
ABAppConfig.tintColor = UIColor.cyan
ABAppConfig.labelsColor = UIColor.gray
ABAppConfig.mainButton = UIButton() // your custom UIButton
ABAppConfig.texts.inputPhoneText = "input phone title"
ABAppConfig.texts.inputCodeText = "input code title"
ABAppConfig.buttonsTitles.loginSendCodeToPhoneButtonTitle = "Send Code"
ABAppConfig.buttonsTitles.loginConfirmCodeButtonTitle = "Done"

// you can customize textfields and their placeholders too.

and finally add this line of code in your viewcontroller to present login

presentLogin(style: .lightBlurBackground, delegate: self)

Don’t forget to implement AbLoginDelegate methods:

func userDismissScreen()
func userDidLogin(_ player: ABPlayer)

Still want more flexability?

You can ignore our UI and implement your own UI.
Just use these methods when you need them:

ABPlayer.requestRegisterCode(phoneNumber: String, completion: LoginCompletionBlock) {}
ABPlayer.verifyRegisterCode(phoneNumber: String, code: String, completion: @escaping (_ success: Bool, _ player: ABPlayer?, _ errorType: ABErrorType?)

License

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

Latest podspec

{
    "name": "Abring",
    "version": "0.3.2",
    "summary": "Abring SDK, pre release.",
    "description": "Abring is an BaaS. In this version it will handle login with phone number. just type 2 lines of code and you're ready to go. for more information please visit our website.",
    "homepage": "https://github.com/abring/sample_ios",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "hosein abbaspoor": "[email protected]"
    },
    "source": {
        "git": "https://github.com/abring/sample_ios.git",
        "tag": "0.3.2"
    },
    "dependencies": {
        "Alamofire": [],
        "SwiftyJSON": []
    },
    "platforms": {
        "ios": "10.0"
    },
    "source_files": "Abring/*",
    "resources": "Abring/*.bundle",
    "pushed_with_swift_version": "3.0n3.0n3.0"
}

Pin It on Pinterest

Share This