feat(iap): add freemium unlock via one-time in-app purchase
Adds a permanent, non-consumable premium unlock (EstadoEntitlement + PuertoCompras/ServicioComprasPlayBilling) that removes ads and unlocks alarm vacations, alarms past a 5-alarm free cap, recording start, and full Android Auto browsing. The phone equalizer stays free for everyone. - Entitlement is prefs-backed (compra_premium_v1), fail-open, and resolvable headlessly via esPremiumPersistido() for the Android Auto audio handler, which registers before runApp. - Android Auto reduced mode keeps the real root folder labels for free users; browsing into any of them (and playFromMediaId/playFromSearch/ skipToNext/skipToPrevious) is blocked at the getChildren/servicio_audio choke points, with a locked "Función Premium" item as the backstop. Current-station play/pause/stop stays untouched. A free -> premium transition actively invalidates the head unit's cached browse tree. - Ads (top banner + capped interstitial before adding a station or an alarm) are gated behind entitlement via ServicioAnuncios, using official Google test ad unit IDs pending AdMob provisioning. - Alarm cap UX shows an explanatory message with a secondary unlock action rather than a bare paywall jump; existing data is grandfathered. - 4 new localization keys translated across all 13 supported locales. Co-located tests use strict TDD (RED test before implementation) for every new pure-logic unit; full existing suite passes unchanged.
This commit is contained in:
@@ -240,7 +240,10 @@ void main() {
|
||||
group('ConstructorArbolAuto.raiz', () {
|
||||
test('con incluirMusicaLocal: true devuelve exactamente 4 carpetas no '
|
||||
'reproducibles con los ids esperados', () {
|
||||
final raiz = ConstructorArbolAuto().raiz(incluirMusicaLocal: true);
|
||||
final raiz = ConstructorArbolAuto().raiz(
|
||||
incluirMusicaLocal: true,
|
||||
premium: true,
|
||||
);
|
||||
|
||||
expect(raiz, hasLength(4));
|
||||
final ids = raiz.map((item) => item.id).toSet();
|
||||
@@ -262,7 +265,10 @@ void main() {
|
||||
|
||||
test('con incluirMusicaLocal: false devuelve exactamente 3 carpetas — '
|
||||
'Música Local queda OCULTA, no vacía', () {
|
||||
final raiz = ConstructorArbolAuto().raiz(incluirMusicaLocal: false);
|
||||
final raiz = ConstructorArbolAuto().raiz(
|
||||
incluirMusicaLocal: false,
|
||||
premium: true,
|
||||
);
|
||||
|
||||
expect(raiz, hasLength(3));
|
||||
final ids = raiz.map((item) => item.id).toSet();
|
||||
@@ -286,7 +292,7 @@ void main() {
|
||||
'segunda vuelta de la misma decisión con evidencia real de uso', () {
|
||||
final ids =
|
||||
ConstructorArbolAuto()
|
||||
.raiz(incluirMusicaLocal: true)
|
||||
.raiz(incluirMusicaLocal: true, premium: true)
|
||||
.map((item) => item.id)
|
||||
.toList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user