gpt4 book ai didi

ionic-framework - APP名称在哪里配置合适?

转载 作者:行者123 更新时间:2023-12-04 09:51:55 25 4
gpt4 key购买 nike

每个 Ionic 项目都有一个项目配置文件 ionic.config.json您可以在其中配置应用程序的人类可读名称:

{
// The human-readable name of the app.
"name": "My App",

// The project type of the app. The CLI uses this value to determine which
// commands and command options are available, what to output for help
// documentation, and what to use for web asset builds and the dev server.
"type": "angular",

// The App ID for Ionic Appflow.
"id": "abc123",

// Configuration object for integrations such as Cordova and Capacitor.
"integrations": {
"cordova": {
...
}
},

// Hook configuration--see the Hooks section below for details.
"hooks": {
...
}
}

使用capacitor为我们提供了另一个放置应用程序名称的机会:

{
// The package name for Android and the bundle identifier for iOS.
"appId": "com.company.appname",

// Your app's name.
"appName": "Capacitor Kitchen Sink",

// Sets the directory of your built web assets. This is the directory that will be
// used to run your app in a native environment.
"webDir": "www",

// The JavaScript package manager to use, either npm or yarn.
"npmClient": "npm",
...
}

应用名称的正确位置在哪里?

提前致谢

最佳答案

Capacitor 可与任何框架配合使用,而不仅仅是 Ionic,因此应用程序名称应位于 capacitor.config.json 中。

但正如你所说,Capacitor 秉承“一次编码,到处配置”的理念,因此 appName 仅在您添加 ios 或 android 平台时使用,一旦您添加了它们,您就拥有了从 Xcode(适用于 iOS 应用程序)或从 Android Studio(适用于 Android 应用程序)更改名称。

关于ionic-framework - APP名称在哪里配置合适?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62001641/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com