fix(compras): revocar el PRO tras un reembolso sin penalizar a quien pago
Verificacion silenciosa en segundo plano con queryPastPurchases, al abrir o volver a la app y al cargar Android Auto. Solo revoca tras dos respuestas validas de Play sin la compra separadas 12h; sin red o con error no toca nada. Reactiva el PRO automaticamente si Play confirma la compra.
This commit is contained in:
+12
-2
@@ -20,6 +20,7 @@ import 'servicios/servicio_compras.dart';
|
||||
import 'servicios/servicio_consentimiento.dart';
|
||||
import 'servicios/servicio_ecualizador.dart';
|
||||
import 'servicios/servicio_presets_personalizados.dart';
|
||||
import 'servicios/verificacion_licencia.dart';
|
||||
import 'tema/pluriwave_tokens.dart';
|
||||
|
||||
const _anchoMinimoLandscape = 600.0;
|
||||
@@ -146,6 +147,16 @@ Future<void> main() async {
|
||||
// injected into every state/service below.
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
||||
// Silent license re-verification (refund revocation) for the Android Auto
|
||||
// path: this engine may be the headless one, with no widget tree and so no
|
||||
// `EstadoEntitlement`. The browse root triggers it fire-and-forget; the
|
||||
// shared in-flight guard in `verificarLicencia` keeps it to one query at a
|
||||
// time even when the phone UI checks too.
|
||||
registrarVerificacionLicenciaAuto(
|
||||
() =>
|
||||
verificarLicencia(consultar: compras.consultarPropiedad, prefs: prefs),
|
||||
);
|
||||
|
||||
// User-saved EQ presets for the car's Ecualizador folder, same
|
||||
// injectable-prefs DI convention and same pre-init placement as the two
|
||||
// registrations above (neither depends on the AudioHandler). Passed as a
|
||||
@@ -354,8 +365,7 @@ bool debeInvalidarArbolAutoAlReanudar({
|
||||
required AppLifecycleState estado,
|
||||
required bool hayCocheSuscrito,
|
||||
required bool yaInvalidado,
|
||||
}) =>
|
||||
!yaInvalidado && hayCocheSuscrito && estado == AppLifecycleState.resumed;
|
||||
}) => !yaInvalidado && hayCocheSuscrito && estado == AppLifecycleState.resumed;
|
||||
|
||||
/// Root wrapper that keeps the orientation policy applied and owns the
|
||||
/// Android Auto browse-tree recovery hook.
|
||||
|
||||
Reference in New Issue
Block a user