Please follow the guide located in React Native Environment Setup "React Native CLI Quickstart" tab. The following is an overview of the needed tooling.
Basic tooling:
For Android, install:
- Java Development Kit
- Android Studio with Android SDK
For iOS, install:
- XCode with Command Line Tools
- Cocoapods
Once all the tooling is ready:
- On the
example
folder:bundle install
: install required Ruby gems
- On the root folder:
yarn
: this will install dependencies for the library &/example
- Add Bugfender app key in
example
project:cd example/src
cp bugfenderKey.json.example bugfenderKey.json
- Edit
bugfenderKey.json
& add the key
On a terminal window:
cd example
: enter theexample
folderyarn start
: start React Native "server"- Open a new terminal to run the specific example
For Android:
- Open Android Studio and run an emulator
cd example
: enter theexample
folderyarn android
: run in Android
For iOS:
cd example
: enter theexample
folderyarn ios
: run in iOS
For Web:
- Please use this private project and execute
yarn web
Try with the official react native upgrade command:
npx react-native upgrade
If it does not work you can create a new updated library from scratch:
-
Be sure to select a Native library using Java & Objective-C
-
Add the following lines to the
package.json
of the newly created library (be sure to use the latest version):"dependencies": { "@bugfender/common": "1.0.0-alpha.5", "@bugfender/sdk": "^2.1.0" }
-
Add "dom" into the "lib" object on
tsconfig.json
:"lib": [ "esnext", "dom" ],
-
On android/src/build.gradle add the following to the dependencies:
implementation 'com.bugfender.sdk:android:3.+'
-
Copy
RnBugfenderModule.java
andRnBufgenerPackage.java
to android/src/main/java/com.bugfender.react. -
Add the Bugfender dependency to the podspec on the root folder
s.dependency 'BugfenderSDK', '~> 1.10.5'
-
Copy
RnBugefnder.h
&&RnBugefnder.mm
to ios/ -
Copy
App.tsx
& addbugfenderKey.json
into example/src/, seebugfenderKey.json
format below:{ "bugfenderKey": "<your Bugfdender key>" }
-
Run
pod install
under example/ios/ -
You should be ready to run the example using
yarn android
&yarn ios