Launch a React Native packager for your extension.
- Open a DoubleDutch extension project folder that is set up for
baseBundleVersion
0.59.3
. - From the
mobile
folder, runnpm start
(which simply invokesreact-native start --port 8081
)
You can choose to use either the iOS or Android simulator (or both) as follows:
- Clone this repository
git clone [email protected]:doubledutch/simulator.git
cd
into cloned project folder.npm i
to install dependencies- Open XCode and open
ios/extensionsimulator.xcodeproj
- Near the top left of the XCode window, select a simulator iPhone target, e.g.
iPhone XS
. - Click the RUN icon.
This will build and install the DoubleDutch simulator app to your selected iPhone simulator. You should no longer need to build the simulator project in XCode. In the future, simply open the DoubleDutch simulator app from the iOS Simulator device. You will at first likely see a red error screen due to not having a React Native packager running.
Note: WE RECOMMEND XCODE 10
- Download the latest release of the DoubleDutch Simulator APK
- Open Android Studio, open the AVD manager (icon in top right), and launch an Android virtual device of your choice.
- Drag the APK onto the virtual Android device to install.
- Open the installed DoubleDutch Simulator
Refresh the extension in the simulator (command-R
), which will attempt to reload the
bundled Javascript from the packager now listening on port 8081. You can reload after making code
edits to your Javasript.
If you work on multiple extensions, you can switch between them by simply stopping the
React Native packager for one extension and starting it (npm start
from the mobile
folder)
for another extension. Refresh the simulator (command-R
) to load this extension.
The following steps were taken to create this project. NodeJS v11.2 was used.
react-native init extensionsimulator
- Update iOS Info.plist with strings from DoubleDutch iOS strings:
Base.lproj/InfoPlist.strings
- NSCameraUsageDescription
- NSPhotoLibraryUsageDescription
- NSPhotoLibraryAddUsageDescription:
This allows us to add the photos you take to your camera roll.
- Install react-native-camera
- Follow setup steps for this module.
npm i --save react-native-camera
react-native link react-native-camera
- Pin version in
package.json
(remove ^, e.g."react-native-camera": "1.4.3"
)
- Install rn-fetch-blob
npm i --save rn-fetch-blob
RNFB_ANDROID_PERMISSIONS=true react-native link rn-fetch-blob
- Pin version in
package.json
- Install react-native-video
npm i --save react-native-video
- Pin version in
package.json
- Install react-native-youtube
npm i --save react-native-youtube
react-native link react-native-youtube
cp ./node_modules/react-native-youtube/assets/YTPlayerView-iframe-player.html ios/extensionsimulator.xcodeproj/
- Pin version in
package.json
- Run on iOS:
react-native run-ios
- Update @doubledutch/cli
- Versions in bundles/make/package.json
- Review bundles/make/base.js