AndroidManifest.xml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:tools="http://schemas.android.com/tools">
  4. <application
  5. android:allowBackup="true"
  6. android:icon="@mipmap/ic_launcher"
  7. android:label="@string/app_name"
  8. android:roundIcon="@mipmap/ic_launcher_round"
  9. android:supportsRtl="true"
  10. android:theme="@style/AppTheme">
  11. <activity
  12. android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation|density"
  13. android:name=".MainActivity"
  14. android:label="@string/title_activity_main"
  15. android:theme="@style/AppTheme.NoActionBarLaunch"
  16. android:launchMode="singleTask"
  17. android:exported="true">
  18. <intent-filter>
  19. <action android:name="android.intent.action.MAIN" />
  20. <category android:name="android.intent.category.LAUNCHER" />
  21. </intent-filter>
  22. <!--
  23. 自定义 scheme 深链(2026-11-15)
  24. fmode://chat/<agentId>/<sessionId>
  25. fmode://messages / contacts / workbench / mine
  26. 用途:系统通知点击、微信/企微内点链接、其他 App 跳转,
  27. 都能把用户直接带到对应会话。解析逻辑见 `core/deep-link.service.ts`。
  28. 🔴 上面的 `launchMode="singleTask"` 是这套方案能工作的前提:
  29. 已在运行时,新链接会通过 `onNewIntent` 交给同一个实例(`appUrlOpen` 事件),
  30. 而不是再起一个 App 实例。验证时不要顺手把它改掉。
  31. 🔴 `android:autoVerify` **不加**:那是给 https 的 App Links 用的,
  32. 自定义 scheme 没有域名归属校验,加了反而会产生误导。
  33. -->
  34. <intent-filter>
  35. <action android:name="android.intent.action.VIEW" />
  36. <category android:name="android.intent.category.DEFAULT" />
  37. <category android:name="android.intent.category.BROWSABLE" />
  38. <data android:scheme="fmode" />
  39. </intent-filter>
  40. </activity>
  41. <provider
  42. android:name="androidx.core.content.FileProvider"
  43. android:authorities="${applicationId}.fileprovider"
  44. android:exported="false"
  45. android:grantUriPermissions="true">
  46. <meta-data
  47. android:name="android.support.FILE_PROVIDER_PATHS"
  48. android:resource="@xml/file_paths"></meta-data>
  49. </provider>
  50. </application>
  51. <!--
  52. 🔴 移除 @capacitor/local-notifications 自带的精确闹钟权限(2026-11-15 真机实测)
  53. 该插件在自身 manifest 里声明了 SCHEDULE_EXACT_ALARM。保留的后果:
  54. 用户首次授权通知后,小米系统会**顺带跳转到「闹钟和提醒」设置页**,
  55. 用户会莫名其妙 —— 这是一个即时消息 App,凭什么要闹钟权限?
  56. 我们只用 `schedule()` 发**立即**通知,不需要毫秒级定时,故显式移除。
  57. 将来若真要做定时提醒,再把它加回来并给出用途说明。
  58. -->
  59. <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" tools:node="remove" />
  60. <!-- Permissions -->
  61. <uses-permission android:name="android.permission.INTERNET" />
  62. </manifest>