Skip to content

Commit dd85dad

Browse files
authored
🤝 Merge pull request #29 from Instabug/feature/podSpec
✨ support installation with cocoapods
2 parents 3ea22c3 + cc9387c commit dd85dad

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,32 @@ gem install xcodeproj
3939
```bash
4040
react-native link instabug-reactnative
4141
```
42+
### Installing using Cocoapods
43+
Alternatively, for iOS you can use [CocoaPods](https://cocoapods.org/) for managing dependencies. After following the first step from the installation steps above, add the following to your `Podfile`:
44+
45+
```ruby
46+
pod 'instabug-reactnative', :path => '../node_modules/instabug-reactnative'
47+
pod 'React', :path => '../node_modules/react-native', :subspecs => [
48+
'Core',
49+
'CxxBridge',
50+
'DevSupport'
51+
]
52+
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
53+
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
54+
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
55+
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
56+
```
57+
And add the following post install script at the end of your `Podfile`:
58+
59+
```ruby
60+
post_install do |installer|
61+
installer.pods_project.targets.each do |target|
62+
if target.name == "React"
63+
target.remove_from_project
64+
end
65+
end
66+
end
67+
```
4268

4369
## Using Instabug
4470
1. To start using Instabug, import it into your `index.ios.js` and `index.android.js` file.

instabug-reactnative.podspec

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
require 'json'
2+
package = JSON.parse(File.read('package.json'))
3+
version = JSON.parse(File.read('package.json'))["version"]
4+
5+
Pod::Spec.new do |s|
6+
s.name = package["name"]
7+
s.version = version
8+
s.summary = package["description"]
9+
s.author = package["author"]
10+
s.license = package["license"]
11+
s.homepage = package["homepage"]
12+
s.source = { :git => "https://github.com/Instabug/instabug-reactnative.git", :tag => 'v' + version }
13+
s.source_files = 'ios/RNInstabug/*'
14+
s.platform = :ios, "9.0"
15+
s.static_framework = true
16+
s.ios.vendored_frameworks = 'ios/Instabug.framework'
17+
s.dependency 'React'
18+
end

ios/RNInstabug/RCTConvert+InstabugEnums.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
// Copyright © 2016 Facebook. All rights reserved.
77
//
88

9-
#import <React/RCTConvert.h>
9+
#if __has_include("RCTConvert.h")
10+
#import "RCTConvert.h"
11+
#else
12+
#import <React/RCTConvert.h>
13+
#endif
1014

1115
@interface RCTConvert (InstabugEnums)
1216

0 commit comments

Comments
 (0)