All Projects → RoJoHub → react-native-smart-code

RoJoHub / react-native-smart-code

Licence: other
Support React & ReactNative.In react-native,it's create base64 String,which is qrcode or barcode ,and without webview.In react,we use jsbarcode.

Programming Languages

objective c
16641 projects - #2 most used programming language
javascript
184084 projects - #8 most used programming language
java
68154 projects - #9 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to react-native-smart-code

Tc Lib Barcode
PHP library to generate linear and bidimensional barcodes
Stars: ✭ 165 (+1078.57%)
Mutual labels:  qrcode, barcode
Qrcodereader
Barcode and QR code reader built in Swift
Stars: ✭ 237 (+1592.86%)
Mutual labels:  qrcode, barcode
Nbzxing
🔥 2020年最好用的开源扫码,全方位优化,强烈推荐!! 支持多种常规zxing无法扫出的码,用就完了!! 🔥
Stars: ✭ 184 (+1214.29%)
Mutual labels:  qrcode, barcode
Zxinglite
🔥 ZXing的精简版,优化扫码和生成二维码/条形码,内置闪光灯等功能。扫描风格支持:微信的线条样式,支付宝的网格样式。几句代码轻松拥有扫码功能 ,ZXingLite让集成更简单。(扫码识别速度快如微信)
Stars: ✭ 2,117 (+15021.43%)
Mutual labels:  qrcode, barcode
api2pdf.php
PHP client library for the Api2Pdf.com REST API - Convert HTML to PDF, URL to PDF, Office Docs to PDF, Merge PDFs, HTML to Image, URL to Image, HTML to Docx, HTML to Xlsx, PDF to HTML, Thumbnail preview of office files
Stars: ✭ 42 (+200%)
Mutual labels:  qrcode, barcode
Segno
Python QR Code and Micro QR Code encoder
Stars: ✭ 144 (+928.57%)
Mutual labels:  qrcode, barcode
Qrcoder
A pure C# Open Source QR Code implementation
Stars: ✭ 2,794 (+19857.14%)
Mutual labels:  qrcode, barcode
Sgqrcode
The easy to use bar code and QR code scan library for iOS【支持二维码生成、从相册中读取二维码、条形码和二维码扫描】
Stars: ✭ 1,571 (+11121.43%)
Mutual labels:  qrcode, barcode
barcode-detector
Spec compliant polyfill of the Barcode Detection API 🤳
Stars: ✭ 31 (+121.43%)
Mutual labels:  qrcode, barcode
ZZYQRCode
a scanner for QRCode barCode 最好用的ios二维码、条形码,扫描、生成框架,支持闪光灯,从相册获取,扫描音效等,高仿微信,微博
Stars: ✭ 124 (+785.71%)
Mutual labels:  qrcode, barcode
Barcode
barcode.php - Generate barcodes from a single PHP file. MIT license.
Stars: ✭ 141 (+907.14%)
Mutual labels:  qrcode, barcode
android-zbar-sdk
🔗 android-zbar-sdk, provide jni source, so file and jar file used alone, gradle/maven remote dependencies.
Stars: ✭ 311 (+2121.43%)
Mutual labels:  qrcode, barcode
React Native Qrcode Scanner
A QR code scanner component for React Native.
Stars: ✭ 1,796 (+12728.57%)
Mutual labels:  qrcode, barcode
Rxtool
Android开发人员不得不收集的工具类集合 | 支付宝支付 | 微信支付(统一下单) | 微信分享 | Zip4j压缩(支持分卷压缩与加密) | 一键集成UCrop选择圆形头像 | 一键集成二维码和条形码的扫描与生成 | 常用Dialog | WebView的封装可播放视频 | 仿斗鱼滑动验证码 | Toast封装 | 震动 | GPS | Location定位 | 图片缩放 | Exif 图片添加地理位置信息(经纬度) | 蛛网等级 | 颜色选择器 | ArcGis | VTPK | 编译运行一下说不定会找到惊喜
Stars: ✭ 11,567 (+82521.43%)
Mutual labels:  qrcode, barcode
Zzyqrcode
a scanner for QRCode barCode 最好用的ios二维码、条形码,扫描、生成框架,支持闪光灯,从相册获取,扫描音效等,高仿微信,微博
Stars: ✭ 123 (+778.57%)
Mutual labels:  qrcode, barcode
Escpos Thermalprinter Android
Useful library to help Android developpers to print with (Bluetooth, TCP, USB) ESC/POS thermal printer.
Stars: ✭ 204 (+1357.14%)
Mutual labels:  qrcode, barcode
Zzyqrcodeswift
a scanner for QRCode barCode 最好用的ios二维码、条形码,扫描、生成框架,支持闪光灯,从相册获取,扫描音效等,高仿微信,微博
Stars: ✭ 97 (+592.86%)
Mutual labels:  qrcode, barcode
Swiftscan
A barcode and qr code scanner( 二维码 各种码识别,生成,界面效果)
Stars: ✭ 1,349 (+9535.71%)
Mutual labels:  qrcode, barcode
taro-code
Taro Barcode & QRCode
Stars: ✭ 88 (+528.57%)
Mutual labels:  qrcode, barcode
javascript-barcode
Dynamsoft Barcode Reader JavaScript SDK for package managers. PDF417, QR Code, DataMatrix, MaxiCode and more are supported.
Stars: ✭ 142 (+914.29%)
Mutual labels:  qrcode, barcode

react-native-smart-code

Getting started

$ npm install react-native-smart-code --save

or

$ yarn add react-native-smart-code

Linking (for React Native <= 0.59 only, React Native >= 0.60 skip this as auto-linking should work)

Mostly automatic installation

$ react-native link react-native-smart-code

Mostly automatic install with CocoaPods

  1. npm install react-native-smart-code --save or $ yarn add react-native-smart-code
  2. Add the plugin dependency to your Podfile, pointing at the path where NPM installed it:
pod 'react-native-smart-code', path: '../node_modules/react-native-smart-code/ios/RNCodeGenerator.podspec'
  1. Run pod install

Note: You might need to adjust your Podfile following the example below:

target 'yourTargetName' do
  # See http://facebook.github.io/react-native/docs/integration-with-existing-apps.html#configuring-cocoapods-dependencies
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge', # Include this for RN >= 0.47
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # Needed for debugging
    'RCTAnimation', # Needed for FlatList and animations running on native UI thread
    # Add any other subspecs you want to use in your project
  ]

  # Explicitly include Yoga if you are using RN >= 0.42.0
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  # Third party deps podspec link
+ pod 'react-native-smart-code', path: '../node_modules/react-native-smart-code/ios/RNCodeGenerator.podspec'

end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "React"
      target.remove_from_project
    end
  end
end

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-smart-code and add RNCodeGenerator.xcodeproj
  3. In XCode, in the project navigator, select your project. Add RNCodeGenerator.framework to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.react_native_code_generator.RNCodeGeneratorPackage; to the imports at the top of the file
  • Add new RNCodeGeneratorPackage() to the list returned by the getPackages() method
+ import com.react_native_code_generator.RNCodeGeneratorPackage;

  public class MainApplication extends Application implements ReactApplication {
    //......

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
+         new RNCodeGeneratorPackage(),
          new MainReactPackage()
      );
    }

    ......
  }
  1. Append the following lines to android/settings.gradle:
...
include ':app'
+ include ':react-native-smart-code'
+ project(':react-native-smart-code').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-smart-code/android')
  1. Insert the following lines inside the dependencies block in android/app/build.gradle:
dependencies {
    ...
    compile "com.facebook.react:react-native:+"  // From node_modules
+   compile project(':react-native-smart-code')
}
  1. (optional)

You can override this settings by adding a Project-wide gradle configuration properties for use by all modules in your ReactNative project by adding the below to android/build.gradle file,

buildscript {...}

allprojects {...}

/**
* Project-wide gradle configuration properties for use by all modules
*/
ext {
    compileSdkVersion           = 26
    targetSdkVersion            = 26
    buildToolsVersion           = "26.0.2"
    googlePlayServicesVersion   = "12.0.1"
    googlePlayServicesVisionVersion = "15.0.2"
    supportLibVersion           = "27.1.0"
}

Usage

React Native

import CodeGenerator from 'react-native-smart-code';

const ImageWidth = 300;
const ImageHeight = 100;

const data = await CodeGenerator.generate({
  type: CodeGenerator.Type.Code128,
  code: 'codeValue'
});

<Image
  source={{ uri: data }}
  resizeMode="cover"
  style={{
    height: ImageHeight,
    width: ImageWidth,
    borderColor: 'black',
    borderWidth: 1
  }}
/>;

React

Note: generateAPI width max value is 4,height max value is 150

import CodeGenerator from 'react-native-smart-code';

const IMAGE_WIDTH = 300;
const IMAGE_HEIGHT = 100;

const data = await CodeGenerator.generate({
  type: CodeGenerator.Type.Code128,
  code: 'codeValue'
});

<img src={data} width={IMAGE_WIDTH} height={IMAGE_HEIGHT} />;

HTML

Note: generateAPI width max value is 4,height max value is 150

<script src="../../lib/CodeGenerator.web.js"></script>
<script>
  const promise = CodeGenerator.default.generate({
    type: CodeGenerator.Type.Code128,
    code: 'codeValue'
  })
  promise.then(function (value) {
    console.log(value, (typeof value));
  }, function (error) {
    console.log(error.message)
  });
</script>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].