mob_smssdk 0.0.7

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 44

smssdk for Flutter #

为开发者提供全球通用的短信验证码工具,开发者可以用其在App植入短信验证码SDK、简单设置即可短信验证,集成快速便捷,且后期易于管理

开始 #

1.Flutter集成文档 SMSSDK-For-Flutter 在线文档

2.iOS平台配置参考 iOS集成文档

  • 实现 "一、注册应用获取appKey 和 appSecret"
  • 实现 "三、配置appkey和appSecret"

3.Android平台集成

######导入SMSSDK相关依赖

  1. 在项目根目录的build.gradle中添加以下代码:
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        **classpath 'com.mob.sdk:MobSDK:+'**
    }
  1. 在app/build.gradle中添加以下代码:
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
// 导入MobSDK
**apply plugin: 'com.mob.sdk'**
  1. 在pubspec.yaml文件中添加smssdk flutter插件:
flutter:
  # This section identifies this Flutter project as a plugin project.
  # The androidPackage and pluginClass identifiers should not ordinarily
  # be modified. They are used by the tooling to maintain consistency when
  # adding or updating assets for this project.
  plugin:
    androidPackage: cn.smssdk.flutter
    pluginClass: SmssdkPlugin

######添加代码

  1. 在MainActivity的onCreate中添加以下代码:
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    GeneratedPluginRegistrant.registerWith(this);
    // 注册SMSSDK Flutter插件
    **SmssdkPlugin.registerWith(registrarFor(SmssdkPlugin.CHANNEL));**
    // 初始化SMSSDK
    **MobSDK.init(this, MOB_APPKEY, MOB_APPSECRET);**
  }
  1. 在MainActivity的onDestory中添加以下代码:
	@Override
	protected void onDestroy() {
		super.onDestroy();
		// 执行回收操作
		**SmssdkPlugin.recycle();**
	}

0.0.7 #

  • TODO: Describe initial release.

example/README.md

smssdk_example #

supported original mob_smssdk minimum version:

  • iOS - v3.0.0
  • Android - v3.0.0

Getting Started #

  • import library
import 'package:mob_smssdk/smssdk.dart';
  • getTextCode
Smssdk.getTextCode("手机号","区号(中国填写86)","模板id", (dynamic ret, Map err){
   if(err!=null){
   
   }
   else
   {
                    
   }
});
  • getVoiceCode
Smssdk.getVoiceCode("手机号","区号(中国填写86)","模板id", (dynamic ret, Map err){
    if(err!=null)
    {
    }
    else
    {
                    
    }
});
  • commitCode
Smssdk.commitCode("手机号","区号(中国填写86)","验证码", (dynamic ret, Map err){
   if(err!=null)
   {
   }
   else
   {
                    
   }
});
  • getSupportedCountries
Smssdk.getSupportedCountries((dynamic ret, Map err){
   if(err!=null)
   {
   }
   else
   {
   }
});
  • getFriends
Smssdk.getFriends((dynamic ret, Map err){
   if(err!=null)
   {
   }
   else
   {
   }
});
  • submitUserInfo
Smssdk.submitUserInfo("3241241", "SmsSDK_Flutter_User_3241241",
              "http://download.sdk.mob.com/510/deb/0c0731ac543eb71311c482a2e2.png",
                    "区号(中国填写86)", "手机号", (dynamic ret, Map err){
   if(err!=null)
   {
   }
   else
   {
   }
});
  • getVersion

Smssdk.getVersion((dynamic ret, Map err){
   if(err!=null)
   {
   }
   else
   {
   }
});
  • enableWarn
Smssdk.enableWarn(true,(dynamic ret, Map err){
   if(err!=null)
   {
   }
   else
   {
   }
});

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  mob_smssdk: ^0.0.7

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:mob_smssdk/smssdk.dart';
import 'package:mob_smssdk/smssdk_interface.dart';
  
Version Uploaded Documentation Archive
0.0.7 Mar 25, 2019 Go to the documentation of mob_smssdk 0.0.7 Download mob_smssdk 0.0.7 archive
0.0.6 Mar 25, 2019 Go to the documentation of mob_smssdk 0.0.6 Download mob_smssdk 0.0.6 archive
0.0.5 Mar 25, 2019 Go to the documentation of mob_smssdk 0.0.5 Download mob_smssdk 0.0.5 archive
0.0.4 Mar 25, 2019 Go to the documentation of mob_smssdk 0.0.4 Download mob_smssdk 0.0.4 archive
0.0.3 Mar 25, 2019 Go to the documentation of mob_smssdk 0.0.3 Download mob_smssdk 0.0.3 archive
0.0.2 Mar 25, 2019 Go to the documentation of mob_smssdk 0.0.2 Download mob_smssdk 0.0.2 archive
0.0.1 Mar 25, 2019 Go to the documentation of mob_smssdk 0.0.1 Download mob_smssdk 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
44
Learn more about scoring.

We analyzed this package on Jun 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.2
  • pana: 0.12.18
  • Flutter: 1.5.4-hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/smssdk.dart.

Run flutter format to format lib/smssdk.dart.

Format lib/smssdk_interface.dart.

Run flutter format to format lib/smssdk_interface.dart.

Maintenance issues and suggestions

Support latest dependencies. (-5 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

The description is too long. (-10 points)

Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters.

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test