+
+A standalone HTML copy is available at `docs/privacy-policy.html` for branded hosting. If it is published on another URL, use the same URL in the app build and Play Console.
## Release review
-Review the name, copy, screenshots, content rating, audience declarations and ad descriptions against the final build. This draft is not a submitted listing. See [Android release preparation](ANDROID_RELEASE.md).
+Review the name, copy, screenshots, content rating, audience declarations and ad descriptions against the final build. Upload-ready assets are in [`store/`](../store/README.md). This draft is not a submitted listing. See [Android release preparation](ANDROID_RELEASE.md).
diff --git a/docs/PRIVACY_POLICY.md b/docs/PRIVACY_POLICY.md
index 6f35f12..e501233 100644
--- a/docs/PRIVACY_POLICY.md
+++ b/docs/PRIVACY_POLICY.md
@@ -8,7 +8,7 @@ The developer and person responsible for the processing described in this policy
## Playing the game
-You do not need an account to play. The app stores your progress, puzzle marks, completed memories, postcards, bookmarks, reading position, daily streaks, language and sound settings on your device. These records let you continue where you left off.
+You do not need an account to play. The app stores your progress, puzzle marks, completed memories, postcards, bookmarks, reading position, daily streaks, language and sound settings, and the broad age-group choice described below on your device. These records let you continue where you left off.
The game does not operate an account service or upload these saved records to a developer-operated game server. Progress does not sync between devices. Story illustrations and recordings are bundled with the app. The app does not request access to your contacts, camera, microphone or precise device location.
@@ -32,17 +32,21 @@ The developer may receive aggregate advertising performance and revenue reports
The app does not include a separate developer-operated analytics or crash-reporting upload service. This does not prevent Google's advertising SDK from processing its own diagnostics and interaction information.
-## Children and families
+## Age group and young players
-The game is intended for children and adults. The current app configuration applies child-directed treatment and a general-audience ad content rating to all ad requests. It also signals to UMP that the user is under the age of consent. It does not ask for a date of birth or collect age information.
+Before any advertising starts, the app asks for a broad age group: **Under 13**, **13–17**, **18 and over**, or **Prefer not to say**. Only this choice is stored on your device. The app does not ask for or store a date of birth.
-These settings instruct Google's advertising service to apply protections for children, including restrictions on personalized advertising. They do not mean that advertising involves no data processing. Technical information may still be processed to deliver appropriate ads, secure the service and prevent fraud.
+If you choose **Under 13** or **Prefer not to say**, advertising is turned off. The app does not start Google's advertising service, request ads, load rewarded or interstitial ads, or request advertising consent. Puzzles, stories, hints and reading breaks remain fully available. You can change the choice later in **Settings → Age group**.
-The developer does not ask children to provide their name, address or other contact information to play. Parents or guardians can remove the game's local records using the deletion steps below. If you believe a child has sent personal information to the developer, please contact softwareapp.hb@gmail.com so the matter can be addressed.
+If you choose **13–17**, ads are enabled with child-directed treatment and a general-audience content rating. The app also tells Google's consent tools that the user is under the age of consent where that applies. If you choose **18 and over**, ads use standard age treatment with the same general-audience content rating. Google's consent tools are applied before ads are requested.
+
+These settings instruct Google's advertising service to apply protections for younger users, including restrictions on personalized advertising. They do not mean that advertising involves no data processing. Technical information may still be processed to deliver appropriate ads, secure the service and prevent fraud.
+
+The game is intended for teenagers aged 13 and above and adults and is not directed at children under 13. The developer does not ask children to provide their name, address or other contact information to play. Parents or guardians can remove the game's local records using the deletion steps below. If you believe a child has sent personal information to the developer, please contact softwareapp.hb@gmail.com so the matter can be addressed.
## Privacy choices
-Open **Settings → Privacy & advertising** to access Google's privacy options when those options are required and available. Availability depends on Google's consent status and the app's age-treatment settings. The current under-age configuration instructs UMP not to request consent from children; a consent form may therefore not appear.
+Open **Settings → Privacy & advertising** to access Google's privacy options when those options are required and available. Availability depends on Google's consent status and the age treatment in effect. If advertising is off because **Under 13** or **Prefer not to say** was chosen, no ad privacy form is needed.
Where processing relies on your consent, you may withdraw it through the applicable privacy controls. Withdrawal does not affect processing that was lawful before withdrawal. Your Android device may also offer controls to reset or delete its advertising ID. Such controls do not remove every form of technical information used by advertising services.
diff --git a/docs/PRIVACY_POLICY_DRAFT.md b/docs/PRIVACY_POLICY_DRAFT.md
index c1adf98..405d0e3 100644
--- a/docs/PRIVACY_POLICY_DRAFT.md
+++ b/docs/PRIVACY_POLICY_DRAFT.md
@@ -2,8 +2,8 @@
The policy text is in [PRIVACY_POLICY.md](PRIVACY_POLICY.md), with a standalone hosting copy in [privacy-policy.html](privacy-policy.html).
-The policy describes the current Android implementation, including child treatment for all ad requests and the absence of age collection. Keep it aligned with the eventual mixed-age flow before submission. It does not establish that the app meets Families, consent or other release requirements.
+The policy describes the current Android implementation, including the local age-group choice, ad-free treatment for Under 13 and Prefer not to say, child-directed treatment for 13–17, standard treatment for 18 and over, and the absence of birth-date collection. Keep it aligned with the final AdMob account configuration and device verification. It does not establish that the app meets Families, consent or other release requirements.
Before hosting, review the stated handling of support correspondence, the actual AdMob account configuration and any ad partners, and applicable legal requirements. Hosting-provider identity, server logging and retention remain unknown; provide separate website disclosures if needed. No claim is made that this policy covers the Gitea host or browser playtest.
-The publisher supplied the operator name Hadrian Burkhardt and contact softwareapp.hb@gmail.com. The final public policy URL is still needed in the app and Play Console. The public HTML has no analytics, scripts or remotely loaded assets.
+The publisher supplied the operator name Hadrian Burkhardt and contact softwareapp.hb@gmail.com. The app currently links to the public repository rendering of the policy; build with `--dart-define=PRIVACY_POLICY_URL=...` after publishing the standalone HTML, and enter the same URL in Play Console. The public HTML has no analytics, scripts or remotely loaded assets.
diff --git a/docs/README.md b/docs/README.md
index 69c32ad..3ad755f 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -9,6 +9,11 @@
| [Project README](../README.md) | Features, artwork, narration, build and verification commands, publishing notes |
| [Roadmap](../ROADMAP.md) | Product direction and the proposed 30–40-leaf campaign |
| [Task list](../TODO.md) | Actionable artwork and asset follow-ups not yet scheduled |
+| [Android release preparation](ANDROID_RELEASE.md) | Age flow, signing, AdMob, privacy URL, build command and submission checklist |
+| [Play Store listing draft](PLAY_STORE_LISTING_DRAFT.md) | Title, descriptions, audience, support and privacy URL |
+| [Data safety worksheet](GOOGLE_PLAY_DATA_SAFETY.md) | Working Play Console answers for SDK and local data |
+| [Android privacy policy](PRIVACY_POLICY.md) | Public policy copy, with a standalone [HTML version](privacy-policy.html) |
+| [Store assets](../store/README.md) | Upload-ready icon, feature graphic, screenshots and app-ads.txt |
| [Artwork provenance](../assets/artwork/README.md) | Prompts, sources and licensing for the bundled watercolours |
| [Narration provenance](../assets/narration/README.md) | Recording scripts, masters, checksums and licensing |
diff --git a/docs/RETENTION_MONETIZATION.md b/docs/RETENTION_MONETIZATION.md
index eb1c2d9..a91c78a 100644
--- a/docs/RETENTION_MONETIZATION.md
+++ b/docs/RETENTION_MONETIZATION.md
@@ -18,6 +18,8 @@ Back returns to the collection or shelf from these activities.
## Ads at breaks
+The local age-group choice is applied before any of these opportunities. Under 13 and Prefer not to say receive no ads, so every break continues immediately. Players who choose 13–17 or 18 and over use the pacing below.
+
- Each completed outing has at most one automatic-ad opportunity, **after** the
player reads the postcard and selects “Keep this postcard”. Closing the
dialog with Back or tapping outside it does not start an ad.
diff --git a/docs/privacy-policy.html b/docs/privacy-policy.html
index f71d45f..8527144 100644
--- a/docs/privacy-policy.html
+++ b/docs/privacy-policy.html
@@ -24,7 +24,7 @@ code { overflow-wrap: anywhere; }
This policy explains how information is handled by the Android app Mara’s Island Notebook, also known in development builds as Lumen. The production Android package is de.softwareapp_hb.lumen.daily.
The developer and person responsible for the processing described in this policy is Hadrian Burkhardt. For privacy questions or requests, contact softwareapp.hb@gmail.com.
Playing the game
-You do not need an account to play. The app stores your progress, puzzle marks, completed memories, postcards, bookmarks, reading position, daily streaks, language and sound settings on your device. These records let you continue where you left off.
+You do not need an account to play. The app stores your progress, puzzle marks, completed memories, postcards, bookmarks, reading position, daily streaks, language and sound settings, and the broad age-group choice described below on your device. These records let you continue where you left off.
The game does not operate an account service or upload these saved records to a developer-operated game server. Progress does not sync between devices. Story illustrations and recordings are bundled with the app. The app does not request access to your contacts, camera, microphone or precise device location.
Local statistics
The app also stores local statistics, including session counts and dates, puzzle completions, advertising opportunities, ad impressions, earned rewards and advertising revenue estimates reported by the ad SDK. The game's local statistics do not include a developer-assigned device identifier and are not automatically uploaded to the developer.
@@ -36,12 +36,14 @@ code { overflow-wrap: anywhere; }
Google uses advertising-service information to deliver and measure ads, maintain its services, and detect fraud and invalid activity. Google's Mobile Ads SDK disclosure explains the SDK's data handling, including configuration-dependent restrictions. Google's own processing, retention and international transfers are also described in its Privacy Policy and advertising technology information.
The developer may receive aggregate advertising performance and revenue reports through AdMob. These reports are separate from your locally saved puzzle marks, bookmarks and reading position.
The app does not include a separate developer-operated analytics or crash-reporting upload service. This does not prevent Google's advertising SDK from processing its own diagnostics and interaction information.
-Children and families
-The game is intended for children and adults. The current app configuration applies child-directed treatment and a general-audience ad content rating to all ad requests. It also signals to UMP that the user is under the age of consent. It does not ask for a date of birth or collect age information.
-These settings instruct Google's advertising service to apply protections for children, including restrictions on personalized advertising. They do not mean that advertising involves no data processing. Technical information may still be processed to deliver appropriate ads, secure the service and prevent fraud.
-The developer does not ask children to provide their name, address or other contact information to play. Parents or guardians can remove the game's local records using the deletion steps below. If you believe a child has sent personal information to the developer, please contact softwareapp.hb@gmail.com so the matter can be addressed.
+Age group and young players
+Before any advertising starts, the app asks for a broad age group: Under 13, 13–17, 18 and over, or Prefer not to say. Only this choice is stored on your device. The app does not ask for or store a date of birth.
+If you choose Under 13 or Prefer not to say, advertising is turned off. The app does not start Google's advertising service, request ads, load rewarded or interstitial ads, or request advertising consent. Puzzles, stories, hints and reading breaks remain fully available. You can change the choice later in Settings → Age group.
+If you choose 13–17, ads are enabled with child-directed treatment and a general-audience content rating. The app also tells Google's consent tools that the user is under the age of consent where that applies. If you choose 18 and over, ads use standard age treatment with the same general-audience content rating. Google's consent tools are applied before ads are requested.
+These settings instruct Google's advertising service to apply protections for younger users, including restrictions on personalized advertising. They do not mean that advertising involves no data processing. Technical information may still be processed to deliver appropriate ads, secure the service and prevent fraud.
+The game is intended for teenagers aged 13 and above and adults and is not directed at children under 13. The developer does not ask children to provide their name, address or other contact information to play. Parents or guardians can remove the game's local records using the deletion steps below. If you believe a child has sent personal information to the developer, please contact softwareapp.hb@gmail.com so the matter can be addressed.
Privacy choices
-Open Settings → Privacy & advertising to access Google's privacy options when those options are required and available. Availability depends on Google's consent status and the app's age-treatment settings. The current under-age configuration instructs UMP not to request consent from children; a consent form may therefore not appear.
+Open Settings → Privacy & advertising to access Google's privacy options when those options are required and available. Availability depends on Google's consent status and the age treatment in effect. If advertising is off because Under 13 or Prefer not to say was chosen, no ad privacy form is needed.
Where processing relies on your consent, you may withdraw it through the applicable privacy controls. Withdrawal does not affect processing that was lawful before withdrawal. Your Android device may also offer controls to reset or delete its advertising ID. Such controls do not remove every form of technical information used by advertising services.
You can play the bundled puzzles and stories without an internet connection. Advertising and online privacy forms require a connection.
Contacting the developer
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index ce851fa..794edaa 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -7,7 +7,7 @@
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleDisplayName
- Lumen
+ Mara’s Island Notebook
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
@@ -15,7 +15,7 @@
CFBundleInfoDictionaryVersion
6.0
CFBundleName
- Lumen
+ Mara's Notebook
CFBundlePackageType
APPL
CFBundleShortVersionString
diff --git a/lib/main.dart b/lib/main.dart
index ad0a734..79ecfc2 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -18,12 +18,16 @@ import 'services/translation.dart';
import 'domain/book.dart';
import 'domain/game.dart';
-import 'domain/puzzle.dart';
import 'domain/postcards.dart';
import 'services/ad_pacing.dart';
import 'services/play_metrics.dart';
import 'ui/postcards.dart';
import 'services/ads.dart';
+import 'services/ad_audience.dart';
+import 'ui/ad_age_group.dart';
+
+import 'package:url_launcher/url_launcher.dart';
+
import 'services/ambience.dart';
import 'services/narrator.dart';
import 'services/progress.dart';
@@ -35,6 +39,14 @@ import 'ui/paper.dart';
part 'ui/mara_story.dart';
+/// Override with `--dart-define=PRIVACY_POLICY_URL=...` for a branded host.
+/// The repository page is publicly reachable and renders the policy as HTML.
+const privacyPolicyUrl = String.fromEnvironment(
+ 'PRIVACY_POLICY_URL',
+ defaultValue:
+ 'https://gitea.softwareapp-hb.de/fishfacegit/logic-puzzle/src/branch/main/docs/PRIVACY_POLICY.md',
+);
+
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
LicenseRegistry.addLicense(() async* {
@@ -161,9 +173,12 @@ class _LumenAppState extends State {
child: child!,
),
theme: ThemeData(
- fontFamilyFallback: kIsWeb
- ? const ['LumenText', 'LumenSymbols', 'LumenSymbols2', 'LumenMath']
- : null,
+ fontFamilyFallback: const [
+ 'LumenText',
+ 'LumenSymbols',
+ 'LumenSymbols2',
+ 'LumenMath',
+ ],
colorScheme: ColorScheme.fromSeed(seedColor: blue, surface: cream),
scaffoldBackgroundColor: cream,
fontFamily: latin ? 'MaraHand' : null,
@@ -240,12 +255,41 @@ class _NotebookState extends State with WidgetsBindingObserver {
_route = route;
WidgetsBinding.instance.addObserver(this);
WidgetsBinding.instance.addPostFrameCallback((_) {
- unawaited(ads.start());
+ unawaited(startAdvertising());
_syncAtmosphere();
if (mounted) _scheduleAutoplay();
});
}
+ Future startAdvertising() async {
+ if (!ads.supported) return;
+ if (!g.store.contains(AdAudience.storageKey)) {
+ await changeAdAgeGroup();
+ return;
+ }
+ await ads.setAudience(
+ AdAudience.fromStored(g.store.text(AdAudience.storageKey)),
+ );
+ }
+
+ Future changeAdAgeGroup() async {
+ if (!ads.supported || !mounted) return;
+ final choice = await chooseAdAgeGroup(context);
+ if (!mounted || choice == null) return;
+ await g.store.set(AdAudience.storageKey, choice.name);
+ await ads.setAudience(choice);
+ }
+
+ Future openPrivacyPolicy() async {
+ final uri = Uri.parse(privacyPolicyUrl);
+ try {
+ if (await launchUrl(uri, mode: LaunchMode.externalApplication)) return;
+ } catch (_) {}
+ if (mounted) {
+ await message('Privacy policy', uri.toString(), close: 'Close');
+ }
+ }
+
void _changed() {
if (!identical(narrator.tracks, g.book.tracks)) {
narrator.replaceTracks(g.book.tracks);
@@ -861,7 +905,9 @@ class _NotebookState extends State with WidgetsBindingObserver {
('Language', chooseLanguage),
('Sound & atmosphere', soundSettings),
('Recording speed', speed),
+ ('Privacy policy', openPrivacyPolicy),
('Privacy & advertising', privacy),
+ if (ads.supported) ('Age group', changeAdAgeGroup),
('Open-source licenses', openSourceLicenses),
if (kDebugMode || appFlavor == 'qa' || appFlavor == 'check')
('Playtest report', playtestReport),
@@ -1916,9 +1962,12 @@ class _NotebookState extends State with WidgetsBindingObserver {
return;
}
if (!await ads.privacy()) {
+ final adsOff = ads.supported && !ads.adsAllowed;
await message(
'Privacy & advertising',
- 'Game progress stays on this device. No account or game backend is used. Google advertising services may process device and ad interaction data when ads are available.\n\nNo advertising privacy options are currently required or available for your region.',
+ adsOff
+ ? 'Advertising is off because this device is set to Under 13 or Prefer not to say. No ads are requested. You can change the age group in Settings.\n\nGame progress stays on this device. No account or game backend is used.'
+ : 'Game progress stays on this device. No account or game backend is used. Google advertising services may process device and ad interaction data when ads are available.\n\nNo advertising privacy options are currently required or available for your region.',
close: 'Close',
);
}
diff --git a/lib/services/ad_audience.dart b/lib/services/ad_audience.dart
new file mode 100644
index 0000000..e3873b5
--- /dev/null
+++ b/lib/services/ad_audience.dart
@@ -0,0 +1,23 @@
+/// Broad age groups used only to choose advertising settings.
+///
+/// Only this choice is stored locally; no birth date is collected. Players who
+/// choose [under13] or [unknown] play without advertising, and the ad SDK is
+/// never initialized for them.
+enum AdAudience {
+ unknown,
+ under13,
+ teen,
+ adult;
+
+ /// The only age information the app persists.
+ static const storageKey = 'ad_age_group_v1';
+
+ bool get allowsAds => this == teen || this == adult;
+
+ /// Teens, under-13s and unknown-age players never receive standard adult
+ /// advertising treatment.
+ bool get restricted => this != adult;
+
+ static AdAudience fromStored(String value) =>
+ values.where((group) => group.name == value).firstOrNull ?? unknown;
+}
diff --git a/lib/services/ads.dart b/lib/services/ads.dart
index 38039a1..401b31c 100644
--- a/lib/services/ads.dart
+++ b/lib/services/ads.dart
@@ -4,6 +4,7 @@ import 'package:flutter/foundation.dart';
import 'package:google_mobile_ads/google_mobile_ads.dart';
import 'ad_pacing.dart';
+import 'ad_audience.dart';
import 'play_metrics.dart';
class Ads {
@@ -13,6 +14,26 @@ class Ads {
final PlayMetrics? metrics;
bool _showing = false;
bool foreground = true;
+ AdAudience _audience = AdAudience.unknown;
+ bool _consentReady = false;
+ int _generation = 0;
+
+ AdAudience get audience => _audience;
+ bool get adsAllowed => supported && _audience.allowsAds;
+
+ Future setAudience(AdAudience audience) async {
+ _audience = audience;
+ await start();
+ }
+
+ void _clearAds() {
+ _reward?.dispose();
+ _interstitial?.dispose();
+ _reward = null;
+ _interstitial = null;
+ _rewardAt = _interstitialAt = null;
+ _rewardLoading = _interstitialLoading = false;
+ }
void _paid(AdWithoutView ad, String format) {
ad.onPaidEvent = (ad, value, precision, currency) {
@@ -42,42 +63,61 @@ class Ads {
(defaultTargetPlatform == TargetPlatform.android ||
defaultTargetPlatform == TargetPlatform.iOS);
Future start() async {
- if (!supported) return;
- // Until neutral age screening is implemented, treat all users as children
- // and configure the SDK before consent or ad initialization.
+ final generation = ++_generation;
+ _consentReady = false;
+ _clearAds();
+ // Under-13 and unknown-age players never initialize the SDK or request ads.
+ if (!supported || _disposed || !_audience.allowsAds) return;
+ // Teenagers receive child-directed treatment; adults receive standard
+ // treatment. Both keep the general-audience rating.
await MobileAds.instance.updateRequestConfiguration(
RequestConfiguration(
- ageRestrictedTreatment: AgeRestrictedTreatment.child,
+ ageRestrictedTreatment: _audience.restricted
+ ? AgeRestrictedTreatment.child
+ : AgeRestrictedTreatment.unspecified,
maxAdContentRating: MaxAdContentRating.g,
),
);
- if (_disposed) return;
+ if (_disposed || generation != _generation) return;
ConsentInformation.instance.requestConsentInfoUpdate(
- ConsentRequestParameters(tagForUnderAgeOfConsent: true),
+ ConsentRequestParameters(tagForUnderAgeOfConsent: _audience.restricted),
() {
- ConsentForm.loadAndShowConsentFormIfRequired((_) => _initialize());
+ if (_disposed || generation != _generation) return;
+ ConsentForm.loadAndShowConsentFormIfRequired(
+ (_) => _initialize(generation),
+ );
},
- (_) => _initialize(),
+ (_) => _initialize(generation),
);
}
- Future _initialize() async {
+ Future _initialize(int generation) async {
if (_disposed ||
- _started ||
+ generation != _generation ||
+ !_audience.allowsAds ||
!await ConsentInformation.instance.canRequestAds()) {
return;
}
- _started = true;
- await MobileAds.instance.initialize();
+ if (_disposed || generation != _generation) return;
+ if (!_started) {
+ _started = true;
+ await MobileAds.instance.initialize();
+ }
+ if (_disposed || generation != _generation) return;
+ _consentReady = true;
await _load();
}
Future _load() async {
if (_disposed ||
+ !_consentReady ||
+ !_audience.allowsAds ||
!supported ||
!await ConsentInformation.instance.canRequestAds()) {
return;
}
+ final generation = _generation;
+ if (_disposed || !_consentReady) return;
final ios = defaultTargetPlatform == TargetPlatform.iOS;
if (_reward == null && !_rewardLoading) {
_rewardLoading = true;
@@ -90,8 +130,12 @@ class Ads {
request: const AdRequest(),
rewardedAdLoadCallback: RewardedAdLoadCallback(
onAdLoaded: (a) {
+ if (generation != _generation) {
+ a.dispose();
+ return;
+ }
_rewardLoading = false;
- if (_disposed) {
+ if (_disposed || !_consentReady) {
a.dispose();
return;
}
@@ -100,6 +144,7 @@ class Ads {
_rewardAt = DateTime.now();
},
onAdFailedToLoad: (_) {
+ if (generation != _generation) return;
_rewardLoading = false;
},
),
@@ -117,8 +162,12 @@ class Ads {
request: const AdRequest(),
adLoadCallback: InterstitialAdLoadCallback(
onAdLoaded: (a) {
+ if (generation != _generation) {
+ a.dispose();
+ return;
+ }
_interstitialLoading = false;
- if (_disposed) {
+ if (_disposed || !_consentReady) {
a.dispose();
return;
}
@@ -127,6 +176,7 @@ class Ads {
_interstitialAt = DateTime.now();
},
onAdFailedToLoad: (_) {
+ if (generation != _generation) return;
_interstitialLoading = false;
},
),
@@ -136,6 +186,8 @@ class Ads {
Future hint(VoidCallback earned) async {
if (!supported ||
+ !_consentReady ||
+ !_audience.allowsAds ||
_disposed ||
_showing ||
!foreground ||
@@ -190,6 +242,8 @@ class Ads {
Future between(VoidCallback next) async {
if (!supported ||
+ !_consentReady ||
+ !_audience.allowsAds ||
_disposed ||
_showing ||
!foreground ||
@@ -239,19 +293,24 @@ class Ads {
}
Future privacy() async {
- if (!supported) return false;
+ // No ads means no ad-privacy form and no reason to touch the SDK.
+ if (!supported || !_audience.allowsAds) return false;
if (await ConsentInformation.instance
.getPrivacyOptionsRequirementStatus() !=
PrivacyOptionsRequirementStatus.required) {
return false;
}
- ConsentForm.showPrivacyOptionsForm((_) {});
+ final generation = ++_generation;
+ _consentReady = false;
+ _clearAds();
+ ConsentForm.showPrivacyOptionsForm((_) => _initialize(generation));
return true;
}
void dispose() {
_disposed = true;
- _reward?.dispose();
- _interstitial?.dispose();
+ _generation++;
+ _consentReady = false;
+ _clearAds();
}
}
diff --git a/lib/ui/ad_age_group.dart b/lib/ui/ad_age_group.dart
new file mode 100644
index 0000000..4a855b7
--- /dev/null
+++ b/lib/ui/ad_age_group.dart
@@ -0,0 +1,33 @@
+import 'package:flutter/material.dart';
+
+import '../services/ad_audience.dart';
+import 'translation.dart';
+
+Future chooseAdAgeGroup(BuildContext context) =>
+ showDialog(
+ context: context,
+ builder: (context) => SimpleDialog(
+ title: const CopyText('Choose your age group'),
+ children: [
+ const Padding(
+ padding: EdgeInsets.fromLTRB(24, 0, 24, 16),
+ child: CopyText(
+ 'We use this only to choose advertising settings. Under 13 and Prefer not to say play without ads. Your choice stays on this device.',
+ ),
+ ),
+ for (final option in const [
+ (AdAudience.under13, 'Under 13'),
+ (AdAudience.teen, '13–17'),
+ (AdAudience.adult, '18 and over'),
+ (AdAudience.unknown, 'Prefer not to say'),
+ ])
+ SimpleDialogOption(
+ onPressed: () => Navigator.pop(context, option.$1),
+ child: CopyText(
+ option.$2,
+ style: const TextStyle(fontFamily: 'LumenText', fontSize: 18),
+ ),
+ ),
+ ],
+ ),
+ );
diff --git a/lib/ui/paper.dart b/lib/ui/paper.dart
index 1f96d2d..4c32529 100644
--- a/lib/ui/paper.dart
+++ b/lib/ui/paper.dart
@@ -3,7 +3,6 @@ import '../services/browser_assets.dart';
import 'dart:math' as math;
import 'package:flutter/material.dart';
-import 'package:flutter/foundation.dart';
import 'translation.dart';
@@ -16,9 +15,12 @@ const ink = Color(0xff36413c),
amber = Color(0xffe0b568);
TextStyle hand(double size, {Color color = ink}) => TextStyle(
fontFamily: 'MaraHand',
- fontFamilyFallback: kIsWeb
- ? const ['LumenText', 'LumenSymbols', 'LumenSymbols2', 'LumenMath']
- : null,
+ fontFamilyFallback: const [
+ 'LumenText',
+ 'LumenSymbols',
+ 'LumenSymbols2',
+ 'LumenMath',
+ ],
fontSize: size,
height: 1.30,
color: color,
diff --git a/pubspec.lock b/pubspec.lock
index 1f61ec4..d695bc9 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -529,6 +529,70 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.12"
+ url_launcher:
+ dependency: "direct main"
+ description:
+ name: url_launcher
+ sha256: e8cc955c97e06df9879140a1fe301f3d493f01b7c62dec7f46834be31d7e9fda
+ url: "https://pub.dev"
+ source: hosted
+ version: "6.3.3"
+ url_launcher_android:
+ dependency: transitive
+ description:
+ name: url_launcher_android
+ sha256: "611e87fb320b70d1dd721dc46af89c98aceccea9b31fde49e084591414e0c610"
+ url: "https://pub.dev"
+ source: hosted
+ version: "6.3.33"
+ url_launcher_ios:
+ dependency: transitive
+ description:
+ name: url_launcher_ios
+ sha256: "8faa1aab294f1ab4040b43660c887b0418d5fa4f0cffef76a484e6aa1092eb4a"
+ url: "https://pub.dev"
+ source: hosted
+ version: "6.4.2"
+ url_launcher_linux:
+ dependency: transitive
+ description:
+ name: url_launcher_linux
+ sha256: "10f86fef4c2c43563fa6c211ff9cf757adf4d3ab762c56bd430664a947d70cd0"
+ url: "https://pub.dev"
+ source: hosted
+ version: "3.2.3"
+ url_launcher_macos:
+ dependency: transitive
+ description:
+ name: url_launcher_macos
+ sha256: "5e835a3b869c2d70325349c81c5a45c28e20791265b67b2669da6b08c5cd5201"
+ url: "https://pub.dev"
+ source: hosted
+ version: "3.2.6"
+ url_launcher_platform_interface:
+ dependency: transitive
+ description:
+ name: url_launcher_platform_interface
+ sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.3.2"
+ url_launcher_web:
+ dependency: transitive
+ description:
+ name: url_launcher_web
+ sha256: "85c81589622fbc87c1c683aaea164d3604a7777495a79d91e39ffcdec39ddb34"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.4.3"
+ url_launcher_windows:
+ dependency: transitive
+ description:
+ name: url_launcher_windows
+ sha256: "6c5ad3f22cd4c38e089b81963b3cd7bb83b111b2df5dce008bb066162f42e429"
+ url: "https://pub.dev"
+ source: hosted
+ version: "3.1.6"
uuid:
dependency: transitive
description:
diff --git a/pubspec.yaml b/pubspec.yaml
index 882169f..a853288 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,7 +1,7 @@
name: lumen
description: Mara's island notebook — an offline illustrated logic puzzle.
publish_to: none
-version: 2.0.2+11
+version: 2.0.3+12
environment:
sdk: '>=3.13.0 <4.0.0'
dependencies:
@@ -11,6 +11,7 @@ dependencies:
sdk: flutter
shared_preferences: ^2.5.6
google_mobile_ads: ^9.2.0
+ url_launcher: ^6.3.2
just_audio: ^0.10.6
audio_session: ^0.2.2
intl: ^0.20.3
diff --git a/scripts/build_android_release.sh b/scripts/build_android_release.sh
new file mode 100755
index 0000000..b015974
--- /dev/null
+++ b/scripts/build_android_release.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+# Build the Play upload bundle with production AdMob IDs and upload signing.
+#
+# Required environment:
+# ADMOB_APP_ID ca-app-pub-...~...
+# ADMOB_REWARDED_ID ca-app-pub-.../...
+# ADMOB_INTERSTITIAL_ID ca-app-pub-.../...
+# LUMEN_UPLOAD_PROPERTIES absolute path to the private signing properties file
+#
+# Optional:
+# PRIVACY_POLICY_URL public policy URL used by Settings → Privacy policy
+set -euo pipefail
+
+: "${ADMOB_APP_ID:?Set ADMOB_APP_ID to the AdMob Android application ID}"
+: "${ADMOB_REWARDED_ID:?Set ADMOB_REWARDED_ID to the rewarded ad unit ID}"
+: "${ADMOB_INTERSTITIAL_ID:?Set ADMOB_INTERSTITIAL_ID to the interstitial ad unit ID}"
+: "${LUMEN_UPLOAD_PROPERTIES:?Set LUMEN_UPLOAD_PROPERTIES to the signing properties file}"
+
+case "$ADMOB_APP_ID" in
+ ca-app-pub-3940256099942544~*) echo "Refusing Google's sample AdMob app ID." >&2; exit 1 ;;
+esac
+case "$ADMOB_REWARDED_ID" in
+ ca-app-pub-3940256099942544/*) echo "Refusing Google's sample rewarded ad unit." >&2; exit 1 ;;
+esac
+case "$ADMOB_INTERSTITIAL_ID" in
+ ca-app-pub-3940256099942544/*) echo "Refusing Google's sample interstitial ad unit." >&2; exit 1 ;;
+esac
+[ -f "$LUMEN_UPLOAD_PROPERTIES" ] || { echo "Signing properties file not found." >&2; exit 1; }
+
+export ORG_GRADLE_PROJECT_ADMOB_APP_ID="$ADMOB_APP_ID"
+export LUMEN_UPLOAD_PROPERTIES
+
+policy_url="${PRIVACY_POLICY_URL:-https://gitea.softwareapp-hb.de/fishfacegit/logic-puzzle/src/branch/main/docs/PRIVACY_POLICY.md}"
+cd "$(dirname "$0")/.."
+
+flutter build appbundle --release --flavor prod \
+ --dart-define=ADMOB_REWARDED_ID="$ADMOB_REWARDED_ID" \
+ --dart-define=ADMOB_INTERSTITIAL_ID="$ADMOB_INTERSTITIAL_ID" \
+ --dart-define=PRIVACY_POLICY_URL="$policy_url"
+
+echo "Built build/app/outputs/bundle/prodRelease/app-prod-release.aab"
diff --git a/store/README.md b/store/README.md
new file mode 100644
index 0000000..cbc257b
--- /dev/null
+++ b/store/README.md
@@ -0,0 +1,54 @@
+# Google Play submission assets
+
+The image assets in this folder are ready to upload through Play Console. Files
+are tracked so the store package survives a clean checkout; `artifacts/` is
+ignored. Listing copy lives in
+[`docs/PLAY_STORE_LISTING_DRAFT.md`](../docs/PLAY_STORE_LISTING_DRAFT.md).
+
+| File | Play Console use | Specification |
+| --- | --- | --- |
+| `app-icon-512.png` | App icon | 512 × 512, 32-bit RGBA PNG (fully opaque), no rounded corners or shadow |
+| `feature-graphic-1024x500.png` | Feature graphic | 1024 × 500 RGB PNG |
+| `phone/01-notebook.png` … `05-bookshelf.png` | Phone screenshots | 1080 × 1920 RGB PNG, 3× captures of the real Flutter UI |
+
+Suggested screenshot order: logic puzzle, story, notebook, postcards, bookshelf.
+
+The captures show the notebook home, a cottage story page, a partly solved
+7×7 logic puzzle, the island-postcard collection and the bookshelf. They were
+produced by `tool/capture_play_store_test.dart` at a 360 × 640 logical viewport
+and 3× output resolution, with advertising disabled and local test data only.
+The in-app cover and heading retain the Lumen name while the store title uses
+Mara’s Island Notebook; both refer to the same app.
+
+Regenerate the screenshots after a visible UI or title change:
+
+```sh
+flutter test tool/capture_play_store_test.dart
+cp artifacts/play-store/phone/*.png store/phone/
+```
+
+The launcher uses the same lighthouse mark. Android adaptive-icon resources live
+in `android/app/src/main/res/mipmap-anydpi-v26/`; legacy density PNGs and round
+icons are generated from `app-icon-512.png`.
+
+## app-ads.txt
+
+AdMob requires the exact publisher line at the domain root of the developer
+website:
+
+```text
+google.com, pub-3909261635234286, DIRECT, f08c47fec0942fa0
+```
+
+The live copy is . Keep it identical to
+the line AdMob shows for the account and do not place it under a subdirectory.
+The website source that publishes it is the separate `softwareapp_website`
+project.
+
+## Requirements
+
+Checked against Google's preview-asset guidance:
+
+
+Upload the individual files; the ZIP in `artifacts/` is only a convenience
+download and is not a Play Console import format.
diff --git a/store/app-ads.txt b/store/app-ads.txt
new file mode 100644
index 0000000..949ed5f
--- /dev/null
+++ b/store/app-ads.txt
@@ -0,0 +1 @@
+google.com, pub-3909261635234286, DIRECT, f08c47fec0942fa0
diff --git a/store/app-icon-512.png b/store/app-icon-512.png
new file mode 100644
index 0000000..2ce1790
Binary files /dev/null and b/store/app-icon-512.png differ
diff --git a/store/feature-graphic-1024x500.png b/store/feature-graphic-1024x500.png
new file mode 100644
index 0000000..dbf4747
Binary files /dev/null and b/store/feature-graphic-1024x500.png differ
diff --git a/store/phone/01-notebook.png b/store/phone/01-notebook.png
new file mode 100644
index 0000000..b1affcb
Binary files /dev/null and b/store/phone/01-notebook.png differ
diff --git a/store/phone/02-story.png b/store/phone/02-story.png
new file mode 100644
index 0000000..743e6b9
Binary files /dev/null and b/store/phone/02-story.png differ
diff --git a/store/phone/03-logic-puzzle.png b/store/phone/03-logic-puzzle.png
new file mode 100644
index 0000000..b2b2cfd
Binary files /dev/null and b/store/phone/03-logic-puzzle.png differ
diff --git a/store/phone/04-island-postcards.png b/store/phone/04-island-postcards.png
new file mode 100644
index 0000000..919c3a0
Binary files /dev/null and b/store/phone/04-island-postcards.png differ
diff --git a/store/phone/05-bookshelf.png b/store/phone/05-bookshelf.png
new file mode 100644
index 0000000..426bc33
Binary files /dev/null and b/store/phone/05-bookshelf.png differ
diff --git a/test/ad_audience_test.dart b/test/ad_audience_test.dart
new file mode 100644
index 0000000..878f0fb
--- /dev/null
+++ b/test/ad_audience_test.dart
@@ -0,0 +1,104 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:lumen/domain/book.dart';
+import 'package:lumen/domain/game.dart';
+import 'package:lumen/main.dart';
+import 'package:lumen/services/ad_audience.dart';
+import 'package:lumen/services/ads.dart';
+import 'package:lumen/services/progress.dart';
+import 'package:lumen/ui/ad_age_group.dart';
+
+/// A supported platform with no consent or SDK initialization.
+class _StandaloneAds extends Ads {
+ _StandaloneAds() : super(enabled: true);
+ @override
+ bool get supported => true;
+}
+
+void main() {
+ test('only teens and adults enable advertising', () {
+ expect(AdAudience.teen.allowsAds, isTrue);
+ expect(AdAudience.adult.allowsAds, isTrue);
+ expect(AdAudience.under13.allowsAds, isFalse);
+ expect(AdAudience.unknown.allowsAds, isFalse);
+ });
+
+ test('every non-adult group gets restricted treatment', () {
+ expect(AdAudience.unknown.restricted, isTrue);
+ expect(AdAudience.under13.restricted, isTrue);
+ expect(AdAudience.teen.restricted, isTrue);
+ expect(AdAudience.adult.restricted, isFalse);
+ });
+
+ test('unknown or malformed stored values fail closed', () {
+ expect(AdAudience.fromStored('teen'), AdAudience.teen);
+ expect(AdAudience.fromStored('adult'), AdAudience.adult);
+ expect(AdAudience.fromStored('under13'), AdAudience.under13);
+ expect(AdAudience.fromStored('unknown'), AdAudience.unknown);
+ expect(AdAudience.fromStored(''), AdAudience.unknown);
+ expect(AdAudience.fromStored('birth-date'), AdAudience.unknown);
+ });
+
+ test('players without ads never request or open an ad', () async {
+ final ads = _StandaloneAds();
+ await ads.setAudience(AdAudience.under13);
+ expect(ads.adsAllowed, isFalse);
+ expect(await ads.hint(() {}), isFalse);
+ var continued = false;
+ await ads.between(() => continued = true);
+ expect(continued, isTrue);
+ expect(await ads.privacy(), isFalse);
+ ads.dispose();
+ });
+
+ testWidgets('the age screen returns each option', (tester) async {
+ AdAudience? chosen;
+ await tester.pumpWidget(
+ MaterialApp(
+ home: Builder(
+ builder: (context) => TextButton(
+ onPressed: () async {
+ chosen = await chooseAdAgeGroup(context);
+ },
+ child: const Text('open'),
+ ),
+ ),
+ ),
+ );
+ for (final option in const {
+ 'Under 13': AdAudience.under13,
+ '13–17': AdAudience.teen,
+ '18 and over': AdAudience.adult,
+ 'Prefer not to say': AdAudience.unknown,
+ }.entries) {
+ chosen = null;
+ await tester.tap(find.text('open'));
+ await tester.pumpAndSettle();
+ expect(find.text('Choose your age group'), findsOneWidget);
+ await tester.tap(find.text(option.key));
+ await tester.pumpAndSettle();
+ expect(chosen, option.value);
+ }
+ });
+
+ testWidgets('first launch stores the age choice before ads start', (
+ tester,
+ ) async {
+ final book = (await tester.runAsync(Book.load))!;
+ final game = Game(book, Progress.memory());
+ final ads = _StandaloneAds();
+ await tester.pumpWidget(
+ MaterialApp(
+ home: Notebook(game: game, adsEnabled: true, ads: ads),
+ ),
+ );
+ await tester.pumpAndSettle();
+ expect(find.text('Choose your age group'), findsOneWidget);
+ await tester.tap(find.text('Under 13'));
+ await tester.pumpAndSettle();
+ expect(game.store.text(AdAudience.storageKey), 'under13');
+ expect(ads.audience, AdAudience.under13);
+ expect(ads.adsAllowed, isFalse);
+ await tester.pumpWidget(const SizedBox());
+ });
+}
diff --git a/tool/capture_play_store_test.dart b/tool/capture_play_store_test.dart
new file mode 100644
index 0000000..a3e75aa
--- /dev/null
+++ b/tool/capture_play_store_test.dart
@@ -0,0 +1,115 @@
+// Real Flutter UI captures at a 360 x 640 logical phone viewport, rendered at 3x.
+// Run: flutter test tool/capture_play_store_test.dart
+import 'dart:io';
+import 'dart:ui' as ui;
+
+import 'package:flutter/material.dart';
+import 'package:flutter/rendering.dart';
+import 'package:flutter/services.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:lumen/domain/game.dart';
+import 'package:lumen/domain/library.dart';
+import 'package:lumen/domain/postcards.dart';
+import 'package:lumen/main.dart';
+import 'package:lumen/services/progress.dart';
+
+void main() {
+ TestWidgetsFlutterBinding.ensureInitialized();
+ testWidgets('capture Play Store phone screens from the real app', (
+ tester,
+ ) async {
+ tester.view.physicalSize = const Size(360, 640);
+ tester.view.devicePixelRatio = 1;
+ addTearDown(tester.view.reset);
+ await tester.runAsync(() async {
+ for (final name in ['sans-serif', 'serif', 'Roboto']) {
+ await (FontLoader(name)
+ ..addFont(rootBundle.load('assets/fonts/NotoSans-Regular.ttf')))
+ .load();
+ }
+ for (final font in {
+ 'MaraHand': 'DancingScript.ttf',
+ 'LumenText': 'NotoSans-Regular.ttf',
+ 'LumenSymbols': 'NotoSansSymbols-Regular.ttf',
+ 'LumenSymbols2': 'NotoSansSymbols2-Regular.ttf',
+ 'LumenMath': 'NotoSansMath-Regular.ttf',
+ }.entries) {
+ await (FontLoader(
+ font.key,
+ )..addFont(rootBundle.load('assets/fonts/${font.value}'))).load();
+ }
+ });
+ await tester.runAsync(() async {
+ await (FontLoader(
+ 'MaterialIcons',
+ )..addFont(rootBundle.load('fonts/MaterialIcons-Regular.otf'))).load();
+ });
+ final library = (await tester.runAsync(StoryLibrary.load))!;
+ final book = (await tester.runAsync(() async {
+ for (final story in library.stories) {
+ await library.open(story.id);
+ }
+ return library.open('mara-island');
+ }))!;
+ final game = Game(
+ book,
+ Progress.memory({'language': 'en', 'ambience_enabled': false}),
+ library: library,
+ );
+ await tester.pumpWidget(
+ RepaintBoundary(
+ key: const ValueKey('store-capture'),
+ child: LumenApp(game: game, adsEnabled: false),
+ ),
+ );
+ Future capture(String name) async {
+ // Resolve asset IO in the real event loop without activating narration timers.
+ for (var i = 0; i < 5; i++) {
+ await tester.runAsync(
+ () => Future.delayed(const Duration(milliseconds: 40)),
+ );
+ await tester.pump();
+ }
+ await tester.pumpAndSettle();
+ expect(tester.takeException(), isNull);
+ final boundary = tester.renderObject(
+ find.byKey(const ValueKey('store-capture')),
+ );
+ await tester.runAsync(() async {
+ final image = await boundary.toImage(pixelRatio: 3);
+ final data = await image.toByteData(format: ui.ImageByteFormat.png);
+ final directory = Directory('artifacts/play-store/phone')
+ ..createSync(recursive: true);
+ File('${directory.path}/$name.png')
+ .writeAsBytesSync(data!.buffer.asUint8List());
+ image.dispose();
+ });
+ }
+
+ game.home();
+ await capture('01-notebook');
+ game.showStory(book.pages.indexWhere((p) => p.id == 'cottage.window'));
+ await capture('02-story');
+ game.showStory(
+ book.pages.indexWhere((p) => p.id == 'cottage.match.puzzle'),
+ );
+ final puzzle = game.puzzle!;
+ for (var i = 0; i < puzzle.size * 2; i++) {
+ if (puzzle.given[i]) continue;
+ game.mark(i);
+ if (puzzle.solution[i] == 0) game.mark(i);
+ }
+ await capture('03-logic-puzzle');
+ for (var slot = 0; slot < 3; slot++) {
+ await game.store.set(
+ 'done_${islandPostcards.first.puzzleKey(slot)}',
+ true,
+ );
+ }
+ game.showPostcards();
+ await capture('04-island-postcards');
+ game.showLibrary();
+ await capture('05-bookshelf');
+ await tester.pumpWidget(const SizedBox());
+ });
+}