Skip to content

feat(app):添加移动端对iOS及iPadOS的支持 - #1908

Open
LouisLu010 wants to merge 71 commits into
ClassIsland:develop/v2/misha-alphafrom
LouisLu010:develop/v2/ios
Open

feat(app):添加移动端对iOS及iPadOS的支持#1908
LouisLu010 wants to merge 71 commits into
ClassIsland:develop/v2/misha-alphafrom
LouisLu010:develop/v2/ios

Conversation

@LouisLu010

Copy link
Copy Markdown

这个 Pull Request 做了什么?

基于/develop/v2/android分支,移植了iOS版本,上下课时有系统通知,代码通过 ClassIsland.Platforms.Abstraction 提供的纯 C# API 调用实时活动与灵动岛。
同时,在Github Action中添加“Build iOS”,用来构建未签名的ipa,实际安装仍需用户自行签名

检查清单

  • 我已经在本地测试过这个 PR,确保欲实现的功能或修复的问题能正常工作。

Copilot AI review requested due to automatic review settings July 13, 2026 08:35
@LouisLu010
LouisLu010 requested review from a team, Doctor-yoi, DryIce-cc and HelloWRC as code owners July 13, 2026 08:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 864a83f841

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ClassIsland/App.axaml.cs
PhonyRootWindow.Show();
PlatformServices.WindowPlatformService.SetWindowFeature(PhonyRootWindow, WindowFeatures.ToolWindow | WindowFeatures.SkipManagement | WindowFeatures.Transparent, true);
UriSource = new Uri(args[0]),
ShowAsMonochrome = args.Length >= 2 && bool.TryParse(args[2], out var r1) && r1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the second bitmap argument for monochrome parsing

When a bitmap icon expression supplies the optional monochrome flag as the second argument, e.g. bitmap(uri,true), args.Length is 2 but this indexes args[2], causing the handler to throw and IconExpressionHelper.TryParse to return false. In that scenario the icon expression silently fails instead of applying the flag; this should read the second argument (args[1]).

Useful? React with 👍 / 👎.

Comment thread ClassIsland/App.Services.xaml.cs Outdated
VerticalSafeAreaPx = 20
});
// 教程
if (System.OperatingSystem.IsWindows() || System.OperatingSystem.IsMacOS() && System.OperatingSystem.IsLinux())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Register tutorials on non-Windows desktop platforms

On macOS and Linux this condition can never pass, because a process cannot be both IsMacOS() and IsLinux(). As a result the built-in getting-started tutorial group is only registered on Windows, so desktop users on macOS/Linux lose the tutorial despite the surrounding platform checks elsewhere treating all three as desktop platforms.

Useful? React with 👍 / 👎.

<ApplicationTitle>ClassIsland</ApplicationTitle>
</PropertyGroup>
<PropertyGroup Condition="'$(BrandType)' == 'Beta'">
<ApplicationId>cn.classisland.android,beta</ApplicationId>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Replace the comma in the Android beta application ID

When building the Android project with BrandType=Beta, this sets the application ID to cn.classisland.android,beta; Android application/package IDs cannot contain commas, so beta APK packaging/manifest validation will fail or produce an unusable package for that build flavor. This looks like the production/dev pattern intended cn.classisland.android.beta.

Useful? React with 👍 / 👎.

@HelloWRC
HelloWRC changed the base branch from develop/v2/platform/osx to develop/v2/misha-alpha July 13, 2026 08:44
@HelloWRC

Copy link
Copy Markdown
Member

@codex review

# Conflicts:
#	.github/workflows/build_release.yml
#	ClassIsland.Platforms.Abstractions/PlatformServices.cs
#	ClassIsland.Platforms.Abstractions/Services/ILauncherService.cs
#	ClassIsland.Platforms.Abstractions/Services/IPlatformFilePickerService.cs
#	ClassIsland.Platforms.Abstractions/Stubs/Services/AvaloniaDefaultPlatformFilePickerService.cs
#	ClassIsland/App.axaml.cs
#	ClassIsland/Controls/EditMode/EditModeView.axaml.cs
#	ClassIsland/Helpers/ProfileTransferHelpers/CsesExportHelper.cs
#	ClassIsland/PluginLoadContext.cs
#	ClassIsland/Services/DiagnosticService.cs
#	ClassIsland/Services/UriNavigationService.cs
#	ClassIsland/Views/CrashWindow.axaml.cs
#	ClassIsland/Views/DataTransferPage.axaml.cs
#	ClassIsland/Views/ProfileSettingsWindow.axaml.cs
#	ClassIsland/Views/RecoveryPages/HomePage.axaml.cs
#	ClassIsland/Views/SettingPages/AboutSettingsPage.axaml.cs
#	ClassIsland/Views/SettingPages/AutomationSettingsPage.axaml.cs
#	ClassIsland/Views/SettingPages/ComponentsSettingsPage.axaml.cs
#	ClassIsland/Views/SettingPages/PluginsSettingsPage.axaml.cs
#	ClassIsland/Views/SettingPages/StorageSettingsPage.axaml.cs
#	ClassIsland/Views/SettingPages/ThemesSettingsPage.axaml.cs
#	ClassIsland/Views/SettingsWindowNew.axaml.cs
#	ClassIsland/Views/TutorialEditorWindow.axaml.cs
#	build/Build.App.cs
#	build/Build.cs
@LouisLu010

Copy link
Copy Markdown
Author

目前基本功能已正常,在本人ipad上已测试1天,系统通知与实时活动功能正常

@LouisLu010

Copy link
Copy Markdown
Author

工作流已整合,但是ios构建可能比较慢

@DryIce-cc
DryIce-cc removed their request for review July 16, 2026 13:11
@LouisLu010

Copy link
Copy Markdown
Author

根据新的pr准则,补充实现思路:
iOS/iPadOS 版采用“共享 C# 主体 + 极薄 Swift 系统桥接”的方案。
UI、课表逻辑、设置、数据模型和大部分服务继续复用 ClassIsland 的 Avalonia/C# 代码;ClassIsland.iOS 只作为 net10.0-ios 宿主,负责注册 iOS 平台服务和生命周期。iPadOS 不另做一套,沿用同一 Avalonia 移动端界面与导航。
只有 Apple 必须由原生 API 完成的能力放到 ClassIsland.iOS.Native:Swift/Xcode 项目负责 ActivityKit、WidgetKit、通知授权、Files/Document Picker、URL 打开等。C# 通过 P/Invoke 调用一个稳定的 C ABI,传递简单 DTO/JSON;业务开发者只需要调用 C# 服务,不需要写 Swift。
实时活动与灵动岛由 Swift Bridge 创建/更新/结束 ActivityKit Activity;C# 负责判断当前课程、阶段、标题和时间区间。倒计时应尽量由 ActivityKit 根据时间区间在系统侧渲染,避免每秒跨 C#/Swift 调用。主应用最低 iOS 15,实时活动在 iOS/iPadOS 16.1 及以上启用,低版本自动降级为普通通知。
通知使用 UserNotifications 本地计划任务:首次启动请求权限,课程变动、校时或前后台切换时重新同步。文件导入使用 iOS Document Picker,应用数据目录通过 Files App 的 Documents/ClassIsland 暴露;桌面专属功能则在移动端隐藏或改为符合 iOS 规范的替代行为。
需要明确的边界是:iOS 不允许 JIT 或任意动态加载未签名程序集,因此插件不能像 Windows/Android 一样在运行时加载并执行。
CI 通过 Xcode + .NET iOS workload 构建 unsigned IPA,并校验 Live Activity Extension、Swift Bridge、miniaudio framework、版本号、隐私清单和 IPA 内容。产物仅提供 unsigned IPA,实际安装仍需外部签名。

@LouisLu010
LouisLu010 requested a review from Copilot July 21, 2026 03:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@LouisLu010 LouisLu010 changed the title (feat)添加移动端对iOS及iPadOS的支持 feat(iOS):添加移动端对iOS及iPadOS的支持 Jul 21, 2026
@LouisLu010 LouisLu010 changed the title feat(iOS):添加移动端对iOS及iPadOS的支持 feat(app):添加移动端对iOS及iPadOS的支持 Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants