Hi all,
I am running a Flutter app in Production (Android only) with real users and real revenue.
My issue is that the "Paywall Encounters" chart in RevenueCat shows 0, while the "Revenue" charts are populating correctly.
I am using the `PaywallView` widget from `purchases_ui_flutter`.
Technical Details:
- Platform: Android (Production)
- Framework: Flutter
- SDK Versions:
- purchases_flutter: ^9.1.0
- purchases_ui_flutter: ^9.1.0
- Behavior:
- Users can successfully view the paywall and purchase products.
- Revenue is tracked correctly in the dashboard.
- Paywall Encounters: 0.(no matter what “encounter timeframe” is)
My Implementation:
I am manually fetching the offering in a `StatefulWidget` and passing the resulting object to the `PaywallView`. I am **not** letting the `PaywallView` fetch the offering itself.
Here is a simplified version of my code:
class MyPaywallScreen extends StatefulWidget {
@override
_MyPaywallScreenState createState() => _MyPaywallScreenState();
}
class _MyPaywallScreenState extends State<MyPaywallScreen> {
Offering? _offering;
@override
void initState() {
super.initState();
_fetchOfferings();
}
Future<void> _fetchOfferings() async {
try {
// Direct RevenueCat SDK call
final offerings = await Purchases.getOfferings();
if (mounted) {
setState(() {
_offering = offerings.current;
});
}
} catch (e) {
// Handle error
}
}
@override
Widget build(BuildContext context) {
if (_offering == null) {
return const Center(child: CircularProgressIndicator());
}
return Scaffold(
body: PaywallView(
offering: _offering, // <-- Passing the manually fetched object here
onPurchaseStarted: (pkg) { /* ... */ },
onPurchaseCompleted: (custInfo, storeTx) { /* ... */ },
onDismiss: () { /* ... */ },
),
);
}
}
What I have verified:
- Production Data: I am looking at the "Production" toggle in charts (not Sandbox).
- Offering is not null: The code handles nulls (loading state), and users are successfully buying, so the object is valid.
- Layout: The `PaywallView` is full-screen.
My Questions:
1. Does passing a manually fetched `Offering` object to `PaywallView` (instead of letting it fetch internally) break the "Encounter" event tracking?
2. Is there a known race condition on Android where `PaywallView` mounts but fails to fire the "View" event before the user interacts?
Any guidance on why the UI events are silently failing while transaction events work perfectly would be appreciated.
