From 671cd6554a786e7bec1368ceee600df7ecc5d0cb Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Wed, 2 May 2018 19:41:46 -0300 Subject: [PATCH 1/2] add podspec --- RNDeviceBrightness.podspec | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 RNDeviceBrightness.podspec diff --git a/RNDeviceBrightness.podspec b/RNDeviceBrightness.podspec new file mode 100644 index 0000000..32d2c85 --- /dev/null +++ b/RNDeviceBrightness.podspec @@ -0,0 +1,29 @@ +require "json" + +package = JSON.parse(File.read(File.join(__dir__, "./package.json"))) +version = package["version"] +giturl = package["repository"]["url"] + +Pod::Spec.new do |s| + s.name = "RNDeviceBrightness" + s.version = version + s.summary = "react-native-device-brightness" + s.description = <<-DESC + Control device screen brightness from React-Native applications + DESC + s.homepage = giturl + s.license = "MIT" + # s.license = { :type => "MIT" } + s.author = { "Calvin Huang" => "calvin.peak@capslock.tw" } + s.platform = :ios, "10.2" + s.source = { :git => giturl + ".git", :tag => version } + s.source_files = "RNDeviceBrightness/*.{h,m}" + s.requires_arc = true + + + s.dependency "React" + #s.dependency "others" + +end + + From 256814b584584515f4dcf1cb34f53b6210dc3e78 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Sat, 5 May 2018 18:10:00 -0300 Subject: [PATCH 2/2] README: document CocoaPod usage The CocoaPod should be used from the local `node_modules` and not published to the cocoapods repository. --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index a0a9623..4273dc5 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,31 @@ Run your project (Cmd+R) (Thanks to @brysgo for writing the instructions) +### iOS (with CocoaPods) +In your `ios/Podfile` make sure to use `RNDeviceBrightness` from the local +`node_modules/`. With that, only your project Pod needs to be linked and +no extra configuration is required: + +```ruby +target 'MyReactApp' do + # Make sure you're also using React-Native from ../node_modules + pod 'React', :path => '../node_modules/react-native', :subspecs => [ + 'Core', + 'RCTActionSheet', + # ... whatever else you use + ] + # React-Native dependencies such as yoga: + pod 'yoga', path: '../node_modules/react-native/ReactCommon/yoga' + + # The following line uses RNDeviceBrightness, linking with + # the library and setting the Header Search Paths for you + pod 'RNDeviceBrightness', :path => '../node_modules/react-native-device-brightness' +end +``` + +Remember to run `cd ios && pod install` to update files used by Xcode. + + ### Android - in `android/app/build.gradle`: