fix(#1340): run natively on iPad instead of iPhone compatibility mode

The iOS app declared iPhone only (TARGETED_DEVICE_FAMILY = 1), so
iPadOS ran it in a phone-sized window. It now declares iPhone and iPad.
Info.plist already lists every iPad orientation and the icon set already
holds the iPad sizes, so nothing else in the bundle changes.

A Mac now runs the iPad version, so the iPhone-on-Mac notice drops its
"fixed phone-sized window" claim.

CI fails if the built app, or the signed IPA, lacks iPad in
UIDeviceFamily, with a negative test on an iPhone-only plist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pull/1341/head
diffwireauto 21 hours ago
parent 5ae3fe73a5
commit 67372cb684

@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Fails unless the iOS app declares iPad (UIDeviceFamily 2). Without it,
# iPadOS runs the app in iPhone compatibility mode (#1340).
# Usage: ios-assert-ipad.sh <path to .app>
set -u
PLIST="$1/Info.plist"
i=0
while v="$(/usr/libexec/PlistBuddy -c "Print :UIDeviceFamily:${i}" "${PLIST}" 2>/dev/null)"; do
if [ "${v}" = "2" ]; then
echo "UIDeviceFamily includes iPad (2)."
exit 0
fi
i=$((i + 1))
done
echo "::error::${PLIST} does not declare iPad in UIDeviceFamily (#1340)."
/usr/libexec/PlistBuddy -c "Print :UIDeviceFamily" "${PLIST}" || true
exit 1

@ -153,6 +153,21 @@ jobs:
- name: Assert the app holds its native-asset frameworks (#1037)
if: needs.classify.outputs.docs_only != 'true'
run: bash .github/scripts/ios-assert-frameworks.sh "build/ios/iphoneos/Offband MeshCore.app"
- name: "Negative: the iPad assertion refuses an iPhone-only app"
if: needs.classify.outputs.docs_only != 'true'
run: |
set -u
ONLY="${RUNNER_TEMP}/iphone-only.app"
mkdir -p "${ONLY}"
/usr/libexec/PlistBuddy -c "Add :UIDeviceFamily array" -c "Add :UIDeviceFamily:0 integer 1" "${ONLY}/Info.plist"
if bash .github/scripts/ios-assert-ipad.sh "${ONLY}" > /dev/null; then
echo "::error::The iPad assertion passed on an iPhone-only app."
exit 1
fi
echo "Refused, as required."
- name: Assert the app runs natively on iPad (#1340)
if: needs.classify.outputs.docs_only != 'true'
run: bash .github/scripts/ios-assert-ipad.sh "build/ios/iphoneos/Offband MeshCore.app"
# ios-signed.yml cannot run on a PR, so its output check is proven here,
# with no secrets: every case that must not count as success (#1040).
- name: "Negative: the altool check refuses anything but success"

@ -208,6 +208,9 @@ jobs:
- name: Assert the IPA holds its native-asset frameworks (#1037)
run: bash .github/scripts/ios-assert-frameworks.sh "${APP}"
- name: Assert the IPA runs natively on iPad (#1340)
run: bash .github/scripts/ios-assert-ipad.sh "${APP}"
- name: Assert the IPA's identity and version
run: |
set -eu

@ -435,7 +435,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = 1;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Profile;
@ -562,7 +562,7 @@
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = 1;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
@ -615,7 +615,7 @@
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = 1;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;

@ -544,8 +544,8 @@
"sponsorPrompt_anytime": "You can support Offband anytime from About in Settings, or at offband.org/donate.",
"sponsorPrompt_notNow": "Not now",
"sponsorPrompt_never": "Never Show Again",
"iosOnMac_title": "iPhone app on a Mac",
"iosOnMac_body": "This is the iPhone version of Offband MeshCore. It's made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.",
"iosOnMac_title": "iPad app on a Mac",
"iosOnMac_body": "This is the iPhone and iPad version of Offband MeshCore. It's made for touch screens, so on a Mac some things may look or work differently.",
"settings_aboutLinkFailed": "Could not open the link",
"settings_aboutOpenMeteoAttribution": "LOS elevation data: Open-Meteo (CC BY 4.0)",
"settings_aboutPresetsAttribution": "Regional radio presets: MeshCore's suggested settings, maintained by Liam Cottle (api.meshcore.nz), with Offband additions.",

@ -1837,13 +1837,13 @@ abstract class AppLocalizations {
/// No description provided for @iosOnMac_title.
///
/// In en, this message translates to:
/// **'iPhone app on a Mac'**
/// **'iPad app on a Mac'**
String get iosOnMac_title;
/// No description provided for @iosOnMac_body.
///
/// In en, this message translates to:
/// **'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.'**
/// **'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.'**
String get iosOnMac_body;
/// No description provided for @settings_aboutLinkFailed.

@ -1027,11 +1027,11 @@ class AppLocalizationsBg extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1022,11 +1022,11 @@ class AppLocalizationsDe extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1013,11 +1013,11 @@ class AppLocalizationsEn extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1023,11 +1023,11 @@ class AppLocalizationsEs extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1027,11 +1027,11 @@ class AppLocalizationsFr extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1025,11 +1025,11 @@ class AppLocalizationsHu extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1025,11 +1025,11 @@ class AppLocalizationsIt extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -998,11 +998,11 @@ class AppLocalizationsJa extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -998,11 +998,11 @@ class AppLocalizationsKo extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1019,11 +1019,11 @@ class AppLocalizationsNl extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1027,11 +1027,11 @@ class AppLocalizationsPl extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1025,11 +1025,11 @@ class AppLocalizationsPt extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1024,11 +1024,11 @@ class AppLocalizationsRu extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1019,11 +1019,11 @@ class AppLocalizationsSk extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1016,11 +1016,11 @@ class AppLocalizationsSl extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1014,11 +1014,11 @@ class AppLocalizationsSv extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -1022,11 +1022,11 @@ class AppLocalizationsUk extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -990,11 +990,11 @@ class AppLocalizationsZh extends AppLocalizations {
String get sponsorPrompt_never => 'Never Show Again';
@override
String get iosOnMac_title => 'iPhone app on a Mac';
String get iosOnMac_title => 'iPad app on a Mac';
@override
String get iosOnMac_body =>
'This is the iPhone version of Offband MeshCore. It\'s made for iPhone and iPad, so on a Mac it runs in a fixed phone-sized window.';
'This is the iPhone and iPad version of Offband MeshCore. It\'s made for touch screens, so on a Mac some things may look or work differently.';
@override
String get settings_aboutLinkFailed => 'Could not open the link';

@ -8,8 +8,9 @@ import '../storage/prefs_manager.dart';
import '../utils/app_logger.dart';
import '../utils/platform_info.dart';
/// Tells a Mac user they are running the iPhone app (#1140). Shown once per
/// app version. No link to the macOS download, by the owner's decision.
/// Tells a Mac user they are running the iPhone and iPad app (#1140, #1340).
/// Shown once per app version. No link to the macOS download, by the owner's
/// decision.
class IosOnMacNotice {
static const String shownForKey = 'ios_on_mac_notice_shown_for';
static const MethodChannel _channel = MethodChannel('offband/platform');

@ -45,7 +45,7 @@ Future<void> _launch(
await tester.pumpAndSettle();
}
final _title = find.text('iPhone app on a Mac');
final _title = find.text('iPad app on a Mac');
Future<void> _dismiss(WidgetTester tester) async {
await tester.tap(find.text('OK'));
@ -58,6 +58,9 @@ void main() {
) async {
await _launch(tester, await _prefs());
expect(_title, findsOneWidget);
// With iPad support a Mac runs the iPad version, so no window-size claim.
expect(find.textContaining('phone-sized'), findsNothing);
expect(find.textContaining('iPhone and iPad version'), findsOneWidget);
expect(find.byType(TextButton), findsOneWidget); // the test's own button
expect(find.byType(FilledButton), findsOneWidget);
await _dismiss(tester);

Loading…
Cancel
Save

Powered by TurnKey Linux.