From 0d32769dac30a4a30f3c90adbd2772c7ce74fb3f Mon Sep 17 00:00:00 2001 From: Jonathan Stanton Date: Sat, 2 Jul 2016 12:01:43 -0700 Subject: [PATCH] Add podspec (#329) * Add podspec file * Add instructions for CocoaPods --- README.md | 14 +++++++++++--- package.json | 2 ++ react-native-camera.podspec | 22 ++++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 react-native-camera.podspec diff --git a/README.md b/README.md index 2b47517..5cc3278 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # react-native-camera [![npm version](https://badge.fury.io/js/react-native-camera.svg)](http://badge.fury.io/js/react-native-camera) [![Gitter](https://badges.gitter.im/lwansbrough/react-native-camera.svg)](https://gitter.im/lwansbrough/react-native-camera) -A camera module for React Native. +A camera module for React Native. -**BREAKING CHANGES:** +**BREAKING CHANGES:** [*April 27*] capture now returns an object instead of a string **NOTE** These docs are for the work in progress v1 release. If you want to use the latest and greatest and can deal with *significant* instability you can install with `npm install --save lwansbrough/react-native-camera`. If you are using older version of this module please refer to the [old readme](https://github.com/lwansbrough/react-native-camera/tree/8cc61edef2c018b81e1c52f13c7d261fe6a35a63). @@ -10,11 +10,19 @@ A camera module for React Native. ![](https://i.imgur.com/5j2JdUk.gif) ## Getting started -### Mostly automatic install +### Mostly automatic install with RNPM 1. `npm install rnpm --global` 2. `npm install react-native-camera@https://github.com/lwansbrough/react-native-camera.git --save` 3. `rnpm link react-native-camera` +### Mostly automatic install with CocoaPods +1. `npm install react-native-camera@https://github.com/lwansbrough/react-native-camera.git --save` +2. Add the plugin dependency to your Podfile, pointing at the path where NPM installed it: +``` +pod 'react-native-camera', path: '../node_modules/react-native-camera' +``` +3. Run `pod install` + ### Manual install #### iOS 1. `npm install react-native-camera@https://github.com/lwansbrough/react-native-camera.git --save` diff --git a/package.json b/package.json index 6bdcee8..c2e198f 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "description": "A Camera component for React Native. Also reads barcodes.", "author": "Lochlan Wansbrough (http://lwansbrough.com)", "nativePackage": true, + "license": "MIT", + "homepage": "https://github.com/lwansbrough/react-native-camera", "keywords": [ "react-native", "react", diff --git a/react-native-camera.podspec b/react-native-camera.podspec new file mode 100644 index 0000000..78c52f5 --- /dev/null +++ b/react-native-camera.podspec @@ -0,0 +1,22 @@ +require 'json' + +package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) + +Pod::Spec.new do |s| + s.name = 'react-native-camera' + s.version = package['version'] + s.summary = package['description'] + s.description = package['description'] + s.license = package['license'] + s.author = package['author'] + s.homepage = package['homepage'] + s.source = { :git => 'https://github.com/lwansbrough/react-native-camera', :tag => s.version } + + s.requires_arc = true + s.platform = :ios, '8.0' + + s.preserve_paths = 'LICENSE', 'README.md', 'package.json', 'index.js' + s.source_files = 'ios/*.{h,m}' + + s.dependency 'React' +end