Giter Club home page Giter Club logo

authenticatorkit's Introduction

AuthenticatorKit

Usage

Step 1

Add pod 'AuthenticatorKit', '0.1.2' in your Podfile.

And run pod install.

Step 2

Add a URL Schemes in your project targets.

image

And add a key of LSApplicationQueriesSchemes with value ontologyauthenticator in your Info.plist file.

image

Step 3

Add #import <AuthenticatorKit/AuthenticatorKit.h> in AppDelegate.m.

And add some code in the application:didFinishLaunchingWithOptions func:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    
    [[AuthenticatorKit shareInstance] setUrlSchemes:@"AuthenticatorKitDemo"]; // the url schemes set in step 2
    
    return YES;
}

image

Step 4

Add some cod in AppDelegate.m and SceneDelegate.m:

- (BOOL)application:(UIApplication *)app openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    [[AuthenticatorKit shareInstance] handelURL:url];
    
    return YES;
}

image

- (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts {
    UIOpenURLContext *context = URLContexts.allObjects.firstObject;
    NSURL *url = context.URL;
    [[AuthenticatorKit shareInstance] handelURL:url];
}

image

Step 5

Set the AuthenticatorKitDelegate where you want, and add the func receiveResultFromAuthenticator.

[[AuthenticatorKit shareInstance] setDelegate:self];
#pragma mark - AuthenticatorKitDelegate
- (void)receiveResultFromAuthenticator:(NSDictionary *)result {
    NSLog(@"%@", result);
}

image

Examples

See more usage in the example project of AuthenticatorKitDemo.

AuthenticatorKitDemo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.