How to achieve a key to log on iOS end? This article will teach you!

Before a key to log appears on the market the most common APP registration login main account password, log in and third-party SMS verification. This seemingly common and convenient ways, but in reality there are many security risks, the user experience is relatively poor. First, SMS verification code to reach the low, cumbersome user actions and wait for a long time, if you encounter bug, APP will be uninstalled facing dire straits. Furthermore, the problem SMS Trojans, pseudo-base stations have made the verification code become more insecure, greatly reducing the user experience.

The "one-click login" allows users to use a key phone number Login / Register APP, mobile phone number that is user account without a password and SMS verification, carrier gateway directly verify the phone number of the machine, easy to solve the above problems. So, so easy to use function how to achieve it? Today give you about Aurora Developer Services Products "Aurora certification."

Aurora certified integration of the three operators of a function key login, access a certification Aurora SDK can achieve three networks a key user login APP, and has covered more than 99.9% of domestic users. Procedure iOS SDK integration ends as follows:

1. Aurora developer account registered and certified developers do, if you have previously used the Aurora push this step can be omitted directly. If other useless Aurora SDK before must first register an account, Portal: https://www.jiguang.cn/identify .

2. Select the opening of Aurora certified applications, click on the left of the [application settings in Aurora certification ] button. Fill in the application presentation [ Application classification ], [ Application Brief ]. iOS applications need to fill [ Bundle ID ], click on [fill in after the completion of submission review ];
Here Insert Picture Description

3. If you need to use a function key to log in. After the completion of step 2, in the [ one-click login settings you want to open a key platform log in and fill in the RSA public key encryption, click [] in submitting audit ] button;

4. After waiting for review submitted audit is very fast, about half an hour passed. First application, the aurora will be presented more than 10,000 the number of test strips can be described as the conscience. After review by downloading the SDK reference to the following steps integrated JVerification SDK. Portal: https://docs.jiguang.cn//jverification/resources/


Manual integration steps
1. Import the project in their own download the SDK package among the libs folder
One-click login

2. Add the appropriate Frameworks for the project, which requires the project to add Frameworks as follows:

  • AdSupport.framework (IDFA obtain required; if you do not use IDFA, do not add)
  • CoreLocation.framework
  • CFNetwork.framework
  • CoreFoundation.framework
  • libresolv.tbd
  • libz.tbd
  • libc++.1.tbd
  • CoreTelephony.framework
  • SystemConfiguration.framework
  • Security.framework
  • CoreGraphics.framework
  • libsqlite3.tbd
  • MobileCoreServices.framework
  • 位置:General 》linked Frameworks and libraries
    A key certification

3. Configure -ObjC
set the project TARGETS -> Build Settings -> Other Links Flags, set -ObjC
One-click login

4. Configure support Http transfer
right to open the project plist file, add the following code

 <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>

One-click login

5. Please demonstrate the Demo JVerificationResource.bundle dragged under its own project directory.
Referring to step 1

6. Add one-click login feature in the project

  • BundleID disposed in General "identity (refer to the figure)
    One-click login

  • Add the following code to the header file reference JVERIFICATIONService.h related classes (see below)

    //引入JVERIFICATIONService.h头文件
    #import "JVERIFICATIONService.h"
    // 如果需要使用 idfa 功能所需要引入的头文件(可选)
    #import <AdSupport/AdSupport.h>
  • JVerification SDK application access must be initialized JVERIFICATIONService, otherwise it will not work properly, add the following code to the appropriate position (refer to FIG.)

    //如需使用 IDFA 功能请添加此代码并在初始化配置类中设置 advertisingId
     NSString *idfaStr = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
     JVAuthConfig *config = [[JVAuthConfig alloc] init];
     config.appKey = @"your appkey";
     config.advertisingId = idfaStr;
     [JVERIFICATIONService setupWithConfig:config];   

    One-click login

  • Add a key sign-on codes in accordance with the integrated document: https://docs.jiguang.cn/jverification/client/ios_api/ following diagram for reference only.
    A key certification

  • Run the project
    log and print the registration result login result, returns the corresponding UID and registrationID means that successful integration (refer to the following log)

2019-08-09 11:10:32.727188+0800 login[1240:285949]  | JIGUANG | I - [JIGUANGService] 
--------------------------- JVerification Log ----------------------------
--------------------JVerification SDK Version:2.4.0--build:102------------
--------------------JCore Lib Version:2.1.1--build:78-----------------
-----------------AppKey:79d4c5ad142bba180ac12344-----------------------
-----------------------------------------------------------------------
2019-08-09 11:10:32.823700+0800 login[1240:285952]  | JIGUANG | I - [JIGUANGClientController] Action - setup
2019-08-09 11:10:32.847702+0800 login[1240:285949]  | JIGUANG | I - [JIGUANGConnectManager] Action - closeConection
2019-08-09 11:10:32.965061+0800 login[1240:285949]  | JIGUANG | I - [JIGUANGRegister] 
----- register info -----
Appkey: 79d4c5ad142bba180ac18d2b
token:  
 advertisingIdentifier: E409D462-ED53-4901-8CB1-73807F60AA11
2019-08-09 11:10:34.058410+0800 login[1240:285949]  | JIGUANG | I - [JIGUANGTcpEventController] 
----- register result -----
uid: 29023815771
registrationID:13165ffa4e7673d8bd8
2019-08-09 11:10:34.066755+0800 login[1240:285928] 初始化结果 result:{
    code = 8000;
    content = "init success";
}
2019-08-09 11:10:34.107601+0800 login[1240:285949]  | JIGUANG | I - [JIGUANGTcpEventController] 
----- login result -----
uid:29023815771 
registrationID:13165ffa4e7673d8bd8 
2019-08-09 11:10:34.132452+0800 login[1240:285949]  | JIGUANG | I - [JIGUANGIDFAReport] upload advertisingIdentifier  E409D462-ED53-4901-8CB1-73807F60AA11
2019-08-09 11:10:35.080778+0800 login[1240:285950]  | JIGUANG | I - [JIGUANGTcpEventController] upload advertisingIdentifier  success
2019-08-09 11:10:36.113310+0800 login[1240:285950]  | JIGUANG | I - [JIGUANGConnectManager] Action - disConnect
2019-08-09 11:10:36.113575+0800 login[1240:285950]  | JIGUANG | I - [JIGUANGConnectManager] Action - closeConection
  • After the successful integration can click a button to set a good interface corresponding to (get tonken, requesting authorization, prefetch number, login) to experience one-click login
  • If you do not like the default login page, Aurora certification SDK provides an interface to customize page, you can modify the UI according to their own design draft document reference:
    https://docs.jiguang.cn/jverification/client/android_api/#sdkui

These are the iOS SDK integration steps a key sign in the practical operation down really easy! Want to improve the user experience and developer of product safety may wish to reference.

Guess you like

Origin www.cnblogs.com/jpush88/p/11599808.html