Skip to content
Branch: develop
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
ios
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Pigzbe App

Installation

Use node version 8.10.0 (the project supports nvm).

Use yarn to manage dependencies.

Install Android Studio if required.

Install react-native dependencies:

sudo gem install cocoapods
brew install watchman
brew tap AdoptOpenJDK/openjdk
brew cask install adoptopenjdk8
npm install -g react-native-cli

Add an env.json file, using env.json.template as a base.

Install project dependencies:

yarn

Link native dependencies:

yarn linklibs

Build game bundle

First copy src/screens/game/url.sample.js, and rename to src/screens/game/url.js. This file can be modified to load the game from a local server for dev.

make build-game

Build coins animation

make build-coins

Usage

Run iOS App

On iOS, build from xcode first time you build

yarn ios

Run iOS App in specific simulators

yarn ipad
yarn iphoneSE
yarn iphone8

Run Android App

Add Android platform-tools to your path:

echo 'export ANDROID_HOME=/Users/$USER/Library/Android/sdk' >> ~/.bash_profile
echo 'export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools' >> ~/.bash_profile

Open an Android simulator (or connect a physical device) before running. Configure and launch simulators from Android Studio > Tools > AVD Manager.

Create a file called local.properties in the android directory with the content sdk.dir = /users/{username}/Library/Android/sdk, substituting {username} for your OS username.

Signing:

Save the keystore.jks file locally, and take note of the path.

Add following to the gradle.properties file in ~/.gradle/gradle.properties (if that file doesn't exist you can create an empty one), substituting the values.

PIGZBE_RELEASE_STORE_FILE=/path/to/keystore.jks
PIGZBE_RELEASE_KEY_ALIAS={keyAlias}
PIGZBE_RELEASE_STORE_PASSWORD={storePass}
PIGZBE_RELEASE_KEY_PASSWORD={keyPass}

Common errors:

export JAVA_HOME=/usr/libexec/java_home -v 1.8\ or export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)

yarn android

Storybook

Storybook configuration and stories are in the /storybook directory. Add any new stories to /storybook/stories/ and require them in the loadStories function in /storybook/index.js.

Start storybook and then start a simulator (or physical device). Stories will run on the device, with the menu of stories loading in a browser window.

yarn storybook
yarn ios

Webview for kids game

Setup

make build-game

Dev

# For development on an attached Android device allow access to port 8080
adb reverse tcp:8080 tcp:8080
adb reverse tcp:8081 tcp:8081

make run-game

Build

make build-game

Build Release

In order to build the webview packaged inline, copy android files in the correct folders, and enable ATS for iOS:

make release

This will generate the AAB file for Android. For iOS use Xcode > Product > Archive after running this command.

Icons

Install Imagemagick if not already installed:

brew install imagemagick

Update app icons based off assets/icon-1024.png as the source:

make icons

Testing

Run Linter

yarn lint

Run Tests

yarn test
You can’t perform that action at this time.