To Configuring App.json file do the following steps
- This file is located in the project root directory.
- Change the name property to your desired app name.
- Similarly change slug(lowercase character only without spaces), version, bundleIdentifier for iOS and package for android.
- [important] For android, the versionCode and for iOS the buildNumber property will be 1 for the first time you’re uploading it to Play store or app store. After that for every new version release, the versionCode / buildNumber will increase by 1. (I.e., for version 1.0.1 versionCode will be 1. And for version 1.0.2 versionCode will be 2).
- Change splash “backgroundColor” property as needed. (This is the screen you see before the app opens).
- Copy and paste your Google maps API Key in “GoogleMapsApiKey” for iOS and “apiKey” for android. (If you use map feature this step is very important)
- Change the app name under ios > infoPlist properties.
app.json file general structure:
{
"expo": {
"name": "Classima",
"slug": "classima",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"plugins": [
[
"expo-document-picker",
{
"appleTeamId": "H65GRBG5",
"iCloudContainerEnvironment": "Production"
}
],
[
"expo-notifications",
{
"icon": "./assets/icon96x96.png",
"color": "#ffffff",
"mode": "production"
}
]
],
"splash": {
"image": "./assets/splash.png",
"backgroundColor": "#f85c70",
"resizeMode": "cover"
},
"notification": {
"icon": "./assets/icon96x96.png",
"color": "#ffffff",
"iosDisplayInForeground": true,
"androidMode": "default"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"bitcode": "Debug",
"usesAppleSignIn": true,
"supportsTablet": true,
"bundleIdentifier": "com.classima",
"buildNumber": "1",
"usesIcloudStorage": true,
"infoPlist": {
"NSCameraUsageDescription": "Classima uses the camera to capture and upload user profile image and Listing Image to the server.",
"NSPhotoLibraryUsageDescription": "Classima needs access to the photo library to select and upload user profile image and Listing Image to the server.",
"NSPhotoLibraryAddUsageDescription": "Classima needs access to the photo library to select and upload user profile image and Listing Image to the server.",
"NSLocationWhenInUseUsageDescription": "Classima usages device location on listing information, Listing search Data and User information.",
"NSLocationAlwaysAndWhenInUseUsageDescription": "Classima usages device location on listing information, Listing search Data and User information.",
"NSLocationAlwaysUsageDescription": "Classima uses device location on listing information, Listing search Data and User information.",
"NSMicrophoneUsageDescription": "Classima uses your microphone while taking video of your product for uploading in listing information.",
"CFBundleAllowMixedLocalizations": true,
"UIBackgroundModes": [
"remote-notification"
]
},
"config": {
"googleMapsApiKey": "2bLSVyGX5GEfggT2wARP0noZInG_AIzaSyCs0TJ"
}
},
"android": {
"package": "com.classima",
"config": {
"googleMaps": {
"apiKey": "2bLSVyGX5GEfggT2wARP0noZInG_AIzaSyCs0TJ"
}
},
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#fff"
},
"permissions": [
"CAMERA",
"CAMERA_ROLL",
"MEDIA_LIBRARY",
"READ_EXTERNAL_STORAGE",
"WRITE_EXTERNAL_STORAGE",
"RECORD_AUDIO",
"READ_PHONE_STATE",
"READ_CONTACTS",
"LOCATION",
"ACCESS_COARSE_LOCATION",
"ACCESS_FINE_LOCATION",
"RECEIVE_BOOT_COMPLETED",
"android.permission.INTERNET",
"POST_NOTIFICATIONS"
],
"versionCode": 1
},
"web": {
"favicon": "./assets/favicon.png"
},
"scheme": "classima",
}
}
8. If you see the below marked line in fresh source code, just remove these lines (Only first time). If you do not remove these lines , your build command might fail for the first time. Once you build successfully, these lines will be newly generated for you. You can keep those after first successful build.