flutter_one_pass 0.0.6 icon indicating copy to clipboard operation
flutter_one_pass: ^0.0.6 copied to clipboard

Geetest OnePass plugin, include Androud and iOS platform. use China mobile phone achieve quick log in.

flutter_one_pass #

Pub

极验OnePass插件

Getting Started #

集成极验OnePass SDK,支持 Android 和 iOS

集成 #

dependencies
flutter_one_pass: ^latest version

Android端 #

无需任何操作

iOS端 #

无需任何操作

使用文档 #

Android #

  • 导入包

    import 'package:flutter_one_pass/flutter_one_pass.dart' as flutterOnePass;
    
  • 初始化sdk

    参数参数类型必填描述
    appIdStringappId
    bool status = await flutterOnePass.init(appId: "your appId");
    

    注意:务必在页面销毁的时候释放SDK引用

    bool status = await flutterOnePass.destroy();
    
  • 验证手机号码

    参数参数类型必填描述
    phoneString手机号码
    cacheNumberbool是否缓存手机号码
    flutterOnePass.checkMobile(phone: phone, cacheNumber: true);
    
  • 监听验证结果

    @override
    void initState() {
      super.initState();
      flutterOnePass.response.listen((reponse) {
        flutterOnePass.CheckResultResponse res = response as flutterOnePass.CheckResultResponse;
      });
    }
    

其他接口

  • 获取最近缓存的一条手机号码

    String number = await flutterOnePass.getCachedNumber;
    
  • 获取匹配的手机号码

    参数参数类型必填描述
    numberString待搜索的字符串
    List<dynamic> numbers = await flutterOnePass.getCachedNumbers(number: "search number");
    

iOS #

  • 导入包

    import 'package:flutter_one_pass/flutter_one_pass.dart' as flutterOnePass;
    
  • 初始化sdk

    参数参数类型必填默认参数描述
    appIdStringnullappId
    enableCachePhoneNumberbooltrue是否允许缓存手机号码
    timeoutDouble10.0接口超时
    flutterOnePass.setup(appId: "your appId", enableCachePhoneNumber: true, timeout: 10.0);
    
  • 验证手机号码

    参数参数类型必填描述
    phoneString手机号码
    bool status = flutterOnePass.checkMobile(phone: phone);
    
  • 监听验证结果

    @override
    void initState() {
      super.initState();
      flutterOnePass.response.listen((reponse) {
        flutterOnePass.CheckResultResponse res = response as flutterOnePass.CheckResultResponse;
      });
    }
    

其他接口

  • 获取最近缓存的一条手机号码

    String number = await flutterOnePass.getCachedNumber;
    
  • 获取缓存的手机号码列表

    List<dynamic> numbers = await flutterOnePass.getIosCachedNumbers;
    

验证结果字典 #

参数参数类型描述
errorCodeInt错误码(为0表示验证通过,其他表示验证不通过)
errorInfoString错误描述
processIdStringprocessId
accesscodeStringaccesscode
phoneString手机号码

验证通过之后,需要将processIdaccesscodephone发送到后台进行验证

详细文档 #

文档地址

1
likes
130
pub points
36%
popularity

Publisher

unverified uploader

Geetest OnePass plugin, include Androud and iOS platform. use China mobile phone achieve quick log in.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_one_pass