Giter Club home page Giter Club logo

react-native-mbaichuan's Introduction

react-native-mbaichuan

升级到SDK为4.X

NPM 安装完以后,必须下载本仓库中的百川SDK(iOS),由于百川SDK中用了SystemLink,NPM中的百川SDK包不完整,Android不受影响

开始

$ npm install react-native-mbaichuan --save

自动配置

$ react-native link react-native-mbaichuan

手动配置

iOS

  1. 打开XCode工程中, 右键点击 LibrariesAdd Files to [your project's name]
  2. node_modulesreact-native-mbaichuan 目录添加 RNReactNativeMbaichuan.xcodeproj
  3. 在工程 Build PhasesLink Binary With Libraries 中添加 libRNReactNativeMbaichuan.a

Android

  1. 打开 android/app/src/main/java/[...]/MainActivity.java
  • 在顶部添加 import com.reactlibrary.RNReactNativeMbaichuanPackage;
  • getPackages() 方法后添加 new RNReactNativeMbaichuanPackage()
  1. 打开 android/settings.gradle ,添加:
    include ':react-native-mbaichuan'
    project(':react-native-mbaichuan').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-mbaichuan/android')
    
  2. 打开 android/app/build.gradle ,添加:
      compile project(':react-native-mbaichuan')
    
    以及添加
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }
    

其他配置

iOS

  1. /node_modules/react-native-mbaichuan/ios 下的 BaichuanSDK 引入到项目中,并替换 yw_1222.jpg
  2. URL Schemes 添加 tbopen + 百川APPID
  3. LSApplicationQueriesSchemes 添加 tmalltbopen
  4. 记得把examples/ios/BaichuanSDK/mtopsdk_configuration.plist 文件拖到项目中去,否则initSDK失败闪退

Android

  1. 复制百川安全图片 yw_1222.jpgandroid/app/src/main/res/drawable/yw_1222.jpg

使用方法

import * as mBaichuan from 'react-native-mbaichuan';

// TODO: What to do with the module?

react-native-mbaichuan's People

Contributors

bashen1 avatar

Watchers

James Cloos avatar

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.