capacitor.config.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import { CapacitorConfig } from '@capacitor/cli';
  2. const config: CapacitorConfig = {
  3. appId: 'com.example.app',
  4. appName: 'wallet_app',
  5. webDir: 'dist',
  6. // 开发服务器配置(热更新用)
  7. // server: {
  8. // url: 'http://192.168.0.59:5173',
  9. // cleartext: true, // 允许HTTP明文通信(仅开发环境)
  10. // allowNavigation: ['*'] // 允许任意URL导航
  11. // },
  12. server: {
  13. allowNavigation: [
  14. "*.angeltokens.io",
  15. "*.your-api.com"
  16. ]
  17. }
  18. // 插件配置
  19. plugins: {
  20. SplashScreen: {
  21. launchShowDuration: 3000,
  22. launchAutoHide: true,
  23. backgroundColor: '#ffffffff', // ARGB格式白色背景
  24. androidScaleType: 'CENTER_CROP',
  25. showSpinner: false,
  26. androidSpinnerStyle: 'large',
  27. iosSpinnerStyle: 'small',
  28. spinnerColor: '#999999',
  29. splashFullScreen: true,
  30. splashImmersive: true,
  31. androidSplashResourceName: 'splash',
  32. useDialog: false
  33. },
  34. CapacitorAssets: {
  35. iconBackgroundColor: '#ffffff' // 应用图标背景色
  36. },
  37. // 注意:原JSON中嵌套了重复的"plugins"键,已修正
  38. PushNotifications: {
  39. presentationOptions: ['badge', 'sound', 'alert']
  40. }
  41. },
  42. // 资源文件配置
  43. // assets: {
  44. // splash: {
  45. // src: 'assets/splash.png', // 启动图路径
  46. // android: true,
  47. // ios: true
  48. // }
  49. // },
  50. // iOS专属配置
  51. ios: {
  52. scheme: 'App',
  53. scrollEnabled: true,
  54. },
  55. // Android专属配置
  56. android: {
  57. allowMixedContent: true, // 允许混合HTTP/HTTPS内容
  58. useLegacyBridge: true, // 使用旧版桥接(兼容性)
  59. // 签名证书配置(建议通过环境变量注入敏感信息)
  60. buildOptions: {
  61. keystorePath: 'f62.keystore',
  62. keystoreAlias: 'f62', // // 生成时指定的别名
  63. keystorePassword: 'LkSvN1Ys', // 从环境变量读取
  64. keystoreAliasPassword: 'LkSvN1Ys'
  65. }
  66. }
  67. };
  68. export default config;