Skip to content

Commit 575a4d1

Browse files
author
Fran Montiel
committed
Update README.md
- Fix url typo - Update installation instructions for react-native version 0.6 (manual link is not required anymore) - Kept instructions for previous versions - Moved CocoaPods instructions up into the document because being the recommended one should be placed first. - Updated RNBugfender Usage with "showUserFeedback"
1 parent cdaaa35 commit 575a4d1

1 file changed

Lines changed: 31 additions & 18 deletions

File tree

README.md

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You can create a new project using
1212

1313
or if you already started your project using the tool `create-react-native-app` you will need to `eject` your project in order to add native modules.
1414

15-
More info can be found in the [official docs](https://facebook.github.io/react-native/docs/getting-started.html)
15+
More info can be found in the [official docs](https://facebook.github.io/react-native/docs/getting-started)
1616

1717
Before moving to the next point **compile the project and ensure you can execute**.
1818
In this way, we can discard issues in the next steps.
@@ -23,40 +23,31 @@ In this way, we can discard issues in the next steps.
2323

2424
`$ cd path_to_your_project`
2525

26-
**1.** Add the bugfender plugin from npm
26+
Add the bugfender plugin from npm
2727

2828
`$ npm install @bugfender/rn-bugfender --save`
2929

30-
**If you want to use cocoapods (recommended), skip the step 2 and go to the step 3B**.
31-
For manual installation, proceed with the steps 2 and 3A.
30+
### Android
31+
If you are using react-native 0.60 or above, you are done!
3232

33-
**2.** Link to your project
33+
**If using an older version of react-native** you still need to link the module to your project:
3434
```
3535
// Add the classes of the plugin to your android and iOS projects
3636
$ npx react-native link @bugfender/rn-bugfender`
3737
```
3838

39-
### Android
40-
You are done!
41-
4239
### iOS
43-
**3A. Manual installation**
44-
45-
Download the latest release from [Github](https://github.com/bugfender/BugfenderSDK-iOS/releases) and copy `BugfenderSDK.framework` to `YourAwesomeProjectDirectory/ios` (same directory as AwesomeProject.xcodeproj). Then, follow the instructions to setup your project manually:
46-
47-
* Go to your **Project** > **Your Target** > **General** > **Linked Frameworks and Libraries** and drag `BugfenderSDK.framework` there (uncheck the "Copy items if needed" checkbox).
48-
49-
* Make sure you have linked `SystemConfiguration.framework`, `Security.framework`, `MobileCoreServices.framework` and `libc++.tbd` as well.
40+
You can finish the installation manually or via CocoaPods (recommended)
5041

51-
**3B. Cocoapods (recommended)**
42+
**CocoaPods (recommended)**
5243

5344
1. Ensure your iOS project contains a Podfile, otherwise you need to add it now:
5445
```
5546
$ cd path_to_your_project/ios
5647
$ pod init
5748
```
5849

59-
2. Link your project:
50+
2. Link your project (**only on react-native versions prior 0.60**):
6051
```
6152
// Add the classes of the plugin to your android and iOS projects
6253
$ npx react-native link @bugfender/rn-bugfender`
@@ -80,12 +71,20 @@ When the installation has finished you should be able to run your project in iOS
8071

8172
`pod 'React', path: '../node_modules/react-native'`
8273

83-
If you created your project with the react-native cli from React Native 0.60 or newer your podfile should be already prepared. For older versions of react-native you must ensure to override it. Otherwise, cocoapods will download and install a new version in your iOS folder and you will end up with all the React libraries duplicated.
74+
If you created your project with the react-native cli from React Native 0.60 or newer your podfile should be already prepared. For older versions of react-native you must ensure to override it. Otherwise, CocoaPods will download and install a new version in your iOS folder and you will end up with all the React libraries duplicated.
8475

8576
*At the end of this document you can find a **[recommended podfile](#recommended-podfile)**. You can use it as an example*.
8677

8778
If you have any problems compiling or executing, try our [Troubleshooting section](#cocoapods-troubleshooting) at the end of this document.
8879

80+
**Manual installation (alternative to CocoaPods)**
81+
82+
Download the latest release from [Github](https://github.com/bugfender/BugfenderSDK-iOS/releases) and copy `BugfenderSDK.framework` to `YourAwesomeProjectDirectory/ios` (same directory as AwesomeProject.xcodeproj). Then, follow the instructions to setup your project manually:
83+
84+
* Go to your **Project** > **Your Target** > **General** > **Linked Frameworks and Libraries** and drag `BugfenderSDK.framework` there (uncheck the "Copy items if needed" checkbox).
85+
86+
* Make sure you have linked `SystemConfiguration.framework`, `Security.framework`, `MobileCoreServices.framework` and `libc++.tbd` as well.
87+
8988
## RNBugfender Usage
9089
```javascript
9190
import Bugfender from '@bugfender/rn-bugfender';
@@ -113,6 +112,20 @@ Bugfender.sendIssue ("New issue", "This will create a new issue in Bugfender");
113112
// Send user feedback
114113
Bugfender.sendUserFeedback ("New feedback", "This will create a new feedback in Bugfender");
115114

115+
// Show user feedback native screen
116+
Bugfender.showUserFeedback(
117+
'Feedback',
118+
'Please send us your feedback',
119+
'This is the reason',
120+
'This is the full message',
121+
'Send',
122+
'Cancel',
123+
).then(url => {
124+
console.log('RN: feedback sent with url:', url);
125+
}).catch(error => {
126+
console.log('RN: feedback not sent');
127+
});
128+
116129
// Set values
117130
Bugfender.setDeviceString ("device.key.string", "fake.string.value");
118131
Bugfender.setDeviceBoolean ("device.key.boolean", true);

0 commit comments

Comments
 (0)