Skip to content

Commit

Permalink
(ios) Add podspec support
Browse files Browse the repository at this point in the history
  • Loading branch information
ivpusic committed Mar 5, 2018
1 parent ba4d84e commit c6d43b7
Show file tree
Hide file tree
Showing 17 changed files with 4,251 additions and 5,330 deletions.
76 changes: 56 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,43 +150,55 @@ ImagePicker.clean().then(() => {

# Install

## Install package
## Step 1

```bash
npm i react-native-image-crop-picker --save
```

Link the package using react-native link:

```bash
react-native link react-native-image-crop-picker
```

## Post-install steps
## Step 2

### iOS

#### Step 1:

In Xcode open Info.plist and add string key `NSPhotoLibraryUsageDescription` with value that describes why you need access to user photos. More info here https://forums.developer.apple.com/thread/62229. Depending on what features you use, you also may need `NSCameraUsageDescription` and `NSMicrophoneUsageDescription` keys.

#### Step 2:

##### Cocoapods (Highly recommended)
#### - If you use Cocoapods which is highly recommended:

```bash
cd ios
pod init
```

After this you have to add pod dependencies to `Podfile`. Open `Podfile` with your editor, and add or adjust example configuration:
After this edit Podfile. Example content is following:

```bash
platform :ios, '8.0'

target '<your_project_name>' do
pod 'RSKImageCropper'
pod 'QBImagePickerController'
target 'example' do
rn_path = '../node_modules/react-native'

pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
pod 'React', path: rn_path, subspecs: [
'Core',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket'
]

pod 'RNImageCropPicker', :path => '../node_modules/react-native-image-crop-picker'
end

post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
```
Expand All @@ -196,7 +208,31 @@ After this run:
pod install
```
##### Manual
After this use `ios/<project_name>.xcworkspace`. **Do not use** `ios/<project_name>.xcodeproj`.
#### - If you are not using Cocoapods which is not recommended:
```bash
react-native link react-native-image-crop-picker
```
### Android
```bash
react-native link react-native-image-crop-picker
```
## Post-install steps
### iOS
#### Step 1
In Xcode open Info.plist and add string key `NSPhotoLibraryUsageDescription` with value that describes why you need access to user photos. More info here https://forums.developer.apple.com/thread/62229. Depending on what features you use, you also may need `NSCameraUsageDescription` and `NSMicrophoneUsageDescription` keys.
#### Step 2
##### Only if you are not using Cocoapods
- Drag and drop the ios/ImageCropPickerSDK folder to your xcode project. (Make sure Copy items if needed IS ticked)
- Click on project General tab
Expand Down
17 changes: 17 additions & 0 deletions RNImageCropPicker.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
version = package['version']

Pod::Spec.new do |s|
s.name = "RNImageCropPicker"
s.version = version
s.summary = package["description"]
s.requires_arc = true
s.license = 'MIT'
s.homepage = 'n/a'
s.authors = { "ivpusic" => "" }
s.source = { :git => "https://github.com/ivpusic/react-native-image-crop-picker", :tag => 'v#{version}'}
s.source_files = 'ios/src/*.{h,m}'
s.platform = :ios, "8.0"
s.dependency 'RSKImageCropper'
s.dependency 'QBImagePickerController'
end
30 changes: 30 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
platform :ios, '8.0'

target 'example' do
rn_path = '../node_modules/react-native'

pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
pod 'React', path: rn_path, subspecs: [
'Core',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket'
]

pod 'RNImageCropPicker', :path => '../..'
end

post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
69 changes: 69 additions & 0 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
PODS:
- QBImagePickerController (3.4.0)
- React/Core (0.54.0):
- yoga (= 0.54.0.React)
- React/fishhook (0.54.0)
- React/RCTActionSheet (0.54.0):
- React/Core
- React/RCTAnimation (0.54.0):
- React/Core
- React/RCTBlob (0.54.0):
- React/Core
- React/RCTGeolocation (0.54.0):
- React/Core
- React/RCTImage (0.54.0):
- React/Core
- React/RCTNetwork
- React/RCTLinkingIOS (0.54.0):
- React/Core
- React/RCTNetwork (0.54.0):
- React/Core
- React/RCTSettings (0.54.0):
- React/Core
- React/RCTText (0.54.0):
- React/Core
- React/RCTVibration (0.54.0):
- React/Core
- React/RCTWebSocket (0.54.0):
- React/Core
- React/fishhook
- React/RCTBlob
- RNImageCropPicker (0.19.3):
- QBImagePickerController
- RSKImageCropper
- RSKImageCropper (2.0.0)
- yoga (0.54.0.React)

DEPENDENCIES:
- React/Core (from `../node_modules/react-native`)
- React/RCTActionSheet (from `../node_modules/react-native`)
- React/RCTAnimation (from `../node_modules/react-native`)
- React/RCTGeolocation (from `../node_modules/react-native`)
- React/RCTImage (from `../node_modules/react-native`)
- React/RCTLinkingIOS (from `../node_modules/react-native`)
- React/RCTNetwork (from `../node_modules/react-native`)
- React/RCTSettings (from `../node_modules/react-native`)
- React/RCTText (from `../node_modules/react-native`)
- React/RCTVibration (from `../node_modules/react-native`)
- React/RCTWebSocket (from `../node_modules/react-native`)
- RNImageCropPicker (from `../..`)
- yoga (from `../node_modules/react-native/ReactCommon/yoga/yoga.podspec`)

EXTERNAL SOURCES:
React:
:path: ../node_modules/react-native
RNImageCropPicker:
:path: ../..
yoga:
:path: ../node_modules/react-native/ReactCommon/yoga/yoga.podspec

SPEC CHECKSUMS:
QBImagePickerController: d54cf93db6decf26baf6ed3472f336ef35cae022
React: c237e42de9c70e5cac6eeb52b4cfd3a0910c1f00
RNImageCropPicker: a637beb8f4c76bf9fe8a89d404ad65a33c4215ac
RSKImageCropper: d9a1acbc0600bf8decc8f0d21895872c99a9e4cf
yoga: 55da126afc384965b96bff46652464373b330add

PODFILE CHECKSUM: b75025773b0aeae55b2be89eb9a053b9ad2f70ae

COCOAPODS: 1.4.0
Loading

0 comments on commit c6d43b7

Please sign in to comment.