Нет описания

Alex Trofimov 2664507aca Minor update 7 лет назад
__tests__ dec5ff82dc v.1.2.0 - upgrade to the latest ReactNative version 7 лет назад
android 539b3e3de9 Icon and Splash using react-native-splash-screen & react-native-make 7 лет назад
img 7f6e7df6a0 Fix in images names 7 лет назад
ios 2664507aca Minor update 7 лет назад
.buckconfig 301d39a0a9 Initial commit 7 лет назад
.eslintrc.js dec5ff82dc v.1.2.0 - upgrade to the latest ReactNative version 7 лет назад
.flowconfig e7c33a0227 v.1.3.0 - upgrade to the latest ReactNative version 7 лет назад
.gitattributes 301d39a0a9 Initial commit 7 лет назад
.gitignore e7c33a0227 v.1.3.0 - upgrade to the latest ReactNative version 7 лет назад
.prettierrc.js e7c33a0227 v.1.3.0 - upgrade to the latest ReactNative version 7 лет назад
.watchmanconfig 301d39a0a9 Initial commit 7 лет назад
App.js 3195d01ec0 Removing OneSignal App ID 7 лет назад
README.md bebe2eb092 Update README.md 7 лет назад
app.json dec5ff82dc v.1.2.0 - upgrade to the latest ReactNative version 7 лет назад
babel.config.js dec5ff82dc v.1.2.0 - upgrade to the latest ReactNative version 7 лет назад
index.js dec5ff82dc v.1.2.0 - upgrade to the latest ReactNative version 7 лет назад
metro.config.js dec5ff82dc v.1.2.0 - upgrade to the latest ReactNative version 7 лет назад
package-lock.json 539b3e3de9 Icon and Splash using react-native-splash-screen & react-native-make 7 лет назад
package.json 539b3e3de9 Icon and Splash using react-native-splash-screen & react-native-make 7 лет назад
process-icon.sh dec5ff82dc v.1.2.0 - upgrade to the latest ReactNative version 7 лет назад
process-splash.sh dec5ff82dc v.1.2.0 - upgrade to the latest ReactNative version 7 лет назад
yarn.lock e7c33a0227 v.1.3.0 - upgrade to the latest ReactNative version 7 лет назад

README.md

UNA Mobile Apps

This is source code of UNA mobile apps for iOS and Android based on ReactNative.
Mobile apps need to have Nexus UNA app installed.

Run

You need to have npm, react-native along with Android SDK and/or XCode along withg CocoaPods installed to build apps.

After downloading source code, unpacking it, then run:

npm install 

Then you can already try to run Andoid app with the following commands (Android emulator must be already running):

export ANDROID_HOME=/path/to/android/sdk
react-native run-android

or iOS app (on Mac OSX only):

cd ios; pod install; cd ..
react-native run-ios

Changing display name and bundle identifier

Lest assume that you want to rename app to Kookaburra and site name is kookaburra.io.
Then you need to change the following strings:

UNA.IO => Kookaburra
com.una.android => com.kookaburra.android
com.una.ios => com.kookaburra.ios
una.io => kookaburra.io
una => kookaburra

In the following files and some files need to be renamed:

App.js
app.json
package.json

ios/Podfile
ios/una/AppDelegate.m

android/app/src/main/res/values/strings.xml
android/app/src/main/java/com/una/android/MainActivity.java => android/app/src/main/java/com/kookaburra/android/MainActivity.java
android/app/src/main/java/com/una/android/MainApplication.java => android/app/src/main/java/com/kookaburra/android/MainApplication.java
android/app/src/main/AndroidManifest.xml
android/app/BUCK
android/app/build.gradle

In XCode change the following (make sure to open una.xcworkspace):

Change images to your own

Change all images to your own in /img/ folder, leaving the same images dimensions.

To change launcher and icons for iOS and Android apps it's recommended to use special script, it can be installed using the following command:

npm i -D @bam.tech/react-native-make

Then you can generate app icons for Android using the following command:

react-native set-icon --platform android --path ./img/icon-android.png

To generate splash for Android, some trick is needed (make sure that you replace Kookaburra with your own app name):
Change "name": "kookaburra" in package.json file to "name": "kookaburra/android".
Then run the following command:

react-native set-splash --platform android --path ./img/background.png --resize contain

Then change "name": "kookaburra/android" back to "name": "kookaburra" in package.json file.

Changing splash and app icon for iOS app requires similar trick:
Change "name": "kookaburra" in package.json file to "name": "una".
Then run the following commands:

react-native set-icon --platform ios --path ./img/icon.png
react-native set-splash --platform ios --path ./img/background.png --resize contain

Then change "name": "una" back to "name": "kookaburra" in package.json file.

3rd-party guides