64 lines
1.7 KiB
Markdown
Raw Normal View History

2016-10-03 20:20:59 +02:00
2016-10-17 17:41:42 +02:00
# instabug-reactnative
## Dependencies
`react-native` version `>0.26`
2016-10-03 20:20:59 +02:00
2016-10-11 12:29:34 +02:00
## Installation
2016-10-03 20:20:59 +02:00
2016-10-17 17:41:42 +02:00
#### iOS
2016-10-04 11:41:36 +02:00
`$ npm install https://github.com/Instabug/instabug-reactnative --save`
2016-10-03 20:20:59 +02:00
2016-10-09 14:50:04 +02:00
`$ rnpm link instabug-reactnative`
2016-10-03 20:20:59 +02:00
2016-10-09 14:50:04 +02:00
1. Open your app `.xcodeproj` file
2016-10-17 17:41:42 +02:00
2. Add the following line to your "Podfile": `pod 'Instabug', '~> 6.0.0'`
3. run `pod install`
4. Run your project (`Cmd+R`)<
2016-10-03 20:20:59 +02:00
2016-10-11 12:29:34 +02:00
#### Android (Pending)
2016-10-03 20:20:59 +02:00
2016-10-17 17:41:42 +02:00
`$ npm install https://github.com/Instabug/instabug-reactnative --save`
`$ rnpm link instabug-reactnative`
2016-10-03 20:20:59 +02:00
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
2016-10-04 11:41:36 +02:00
- Add `import com.instabug.reactlibrary.RNInstabugReactnativePackage;` to the imports at the top of the file
2016-10-03 20:20:59 +02:00
- Add `new RNInstabugReactnativePackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
```
2016-10-04 11:41:36 +02:00
include ':instabug-reactnative'
project(':instabug-reactnative').projectDir = new File(rootProject.projectDir, '../node_modules/instabug-reactnative/android')
2016-10-03 20:20:59 +02:00
```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
```
2016-10-04 11:41:36 +02:00
compile project(':instabug-reactnative')
2016-10-03 20:20:59 +02:00
```
## Usage
```javascript
2016-10-12 12:30:37 +02:00
import Instabug from'instabug-reactnative';
2016-10-03 20:20:59 +02:00
2016-10-09 14:50:04 +02:00
class testApp extends Component {
constructor() {
super();
2016-10-13 12:37:33 +02:00
Instabug.startWithToken('YOUR_TOKEN', Instabug.constants.invocationEvent.floatingButton);
2016-10-09 14:50:04 +02:00
}
...
}
2016-10-03 20:20:59 +02:00
```
2016-10-17 18:03:04 +02:00
### iOS
If your app doesn't already access the microphone or photo library, you'll need to add the following 2 keys to your app's info.plist file:
NSMicrophoneUsageDescription
NSPhotoLibraryUsageDescription
2016-10-04 11:41:36 +02:00
## License
This software is released under <a href="https://opensource.org/licenses/mit-license.php">MIT License</a>.
© 2016 Instabug. All rights reserved.