exp.json 配置

exp.json 包含你 app 里除了代码以外的配置。下面是所有支持的属性:

name

Required. Exponent 客户端里 app 的名字,还有 standalone app 主屏的名字。

description

简短描述下你的 app 是什么, 为什么会让人觉得很棒。

slug

Required. 发布时候友好的 url name, 比如: exp.host/@your-username/slug.

sdkVersion

Required. App 用到的 Exponent sdkVersion。应该和 package.json 里定义的版本同步。

version

你的 app 版本,你可以用任何喜欢的版本号规范。

orientation
锁定app, ``portrait`` 或者 ``landscape``。默认不锁定,支持 default, portrait, landscape。
primaryColor
在 Android 上,代表多任务时 app 的颜色。当前不支持 iOS, 但是以后可能会用到。
16进制颜色代码, 比如: ``'#000000'``
iconUrl

App 的图标链接。我们推荐你用一张透明的 512x512 png。会显示在主屏,还有 Exponent 客户端里。

notification

推送通知配置。

iconUrl

推送通知图标链接。48x48 png, 灰阶透明。

color

推送通知图标显示在通知中心时候的 Tint color. 16 进制颜色代码,比如: '#000000'

androidMode

单独显示每次通知 (default), 或者折叠成一个 (collapse). 默认 collapse。

androidCollapsedTitle

如果 androidMode 设置为 collapse 的话, 用来显示折叠信息的标题。 比如: '#{unread_notifications} new interactions'.

loading

当用户打开 app 时的加载 (拉取,缓存 Javascript bundle 还有 assets) 页面配置。

iconUrl

启动 app 时候显示的图标。大小比例不限制,必须是 .png。 Url that points to the icon to display while starting up the app. Image size and aspect ratio are up to you. Must be a .png.

exponentIconColor

如果没有提供 icon 的话,我们会默认显示 Exponent logo。你可以选择 white 或者 blue.

exponentIconGrayscale

类似 exponentIconColor, 但是指明灰阶 (1) 或者不是灰阶 (0)。

backgroundImageUrl

加载页面背景图片。大小比例不限制,必须是 .png。

backgroundColor

加载页面背景颜色。 16 进制颜色代码,比如: '#000000'

hideExponentText

Exponent 默认在加载页面末端显示一些文字。设置为 true 可以不显示。

appKey
Exponent 默认选择用 AppRegistry 注册的 ``main`` application。你可以修改这个属性如果需要更改的话。
androidStatusBarColor

16 进制颜色代码,比如: '#000000'

androidHideExponentNotificationInShellApp
Exponent 默认为你的 app 添加一个通知,包含刷新按钮还有 debug 信息。设为 ``true`` 来关闭通知。
scheme

Standalone Apps Only. 廉价到你的 app 的 url scheme。比如, 如果设为 'rnplay' 的话, 点击 rnplay:// 链接就会打开你的 app。

entryPoint

你的 main Javascript 的相对路径。

extra

你想传给你的 experience 的额外参数。

rnCliPath
packagerOpts
ignoreNodeModulesValidation
nodeModulesPath
ios

Standalone Apps Only. iOS standalone app 相关配置

bundleIdentifier

你的 iOS standalone app 的 bundle identifier。必须在 App Store 上保证唯一。可以看 这个 StackOverflow question.

iOS bundle identifier 的命名,比如: host.exp.exponent, exp.host 是我们的域,Exponent 是我们的一个 app。

buildNumber

你的 iOS standalone app 的 Build number。

config
fabric

Twitter Fabric keys, 来支持 Crashlytics 和其他服务。

apiKey

你的 Fabric API key

buildSecret

你的 Fabric build secret

googleSignIn

Google Sign-In iOS SDK keys, standalone app 需要的.

reservedClientId

保留的 client id url scheme。 可以在 GoogeService-Info.plist 里找到。

android

Standalone Apps Only. Android standalone app 相关配置。

package

你的 Android standalone app package name。必须在 Play Store 上保证唯一。可以看: 这个 StackOverflow question. Reverse DNS notation unique name for your app. For example, host.exp.exponent, where exp.host is our domain and Exponent is our app.

package name 是一个倒置 DNS 标记, 比如: host.exp.exponent, exp.host 是我们的域,Exponent 是我们的一个 app。

versionCode

Google Play 需要的版本号。每次发布递增 1, https://developer.android.com/studio/publish/versioning.html.

config
fabric

Twitter Fabric keys, 来支持 Crashlytics 和其他服务。

apiKey

你的 Fabric API key

buildSecret

你的 Fabric build secret

googleMaps

Google Maps Android SDK key, standalone app 需要。

apiKey

你的 Google Maps Android SDK API key。

googleSignIn

Google Sign-In Android SDK keys, standalone app 需要。

apiKey

Android API key. 可以在 developer console 的 credentials 里或者 google-services.json 找到。

certificateHash

用来 build apk 的签名证书的 SHA-1 hash, 不能包含 :, 可以在 google-services.json 里找到. https://developers.google.com/android/guides/client-auth