Solved

Using RevenueCat with flutterflow web

  • 30 December 2023
  • 5 replies
  • 532 views

Badge

In flutterflow it allows for a revenuecat integration. However it seems its just for apple and android while flutterflow also allows for web. Or will the integration work for all platforms and they just need those 2 api’s?

We know revenuecat offers “web payments via stripe” so I was hoping to use that for the flutterflow app web users and the standard app store and play store methods for when the user is using the app on their devices.

 

I also have the firebase revenuecat extension installed which seems like a good idea.

.. So perhaps Im looking at this all wrong and I use the standard stripe apis to add subscriptions etc and that info just gets synced with revenuecat? So basically this way a user will have his entitlements/packages assigned to him across all platforms.

 

Any insight would be appreciated. 

icon

Best answer by Haley Pace 29 January 2024, 20:14

View original

5 replies

Badge

Happy new year everyone

After reading some more I now I understand how RC plays into all this…What a smart service.

So I guess the question still stands, how can I integrate RevenueCat “Web Payments by stripe” with flutterflow , as far as the paywall and actions. 

Perhaps I can use what I have now (RC FF integration) and there is a minor adjustment to the FlutterFlow code to make it work for stripe/web as well?

 

 

 

Badge

Ok so I found marketplace components for FF built by RC

Im assuming this was built before RC introduced “Stripe/web” API…

So I basically need to figure out what should happen with the “if Web” flow. 

 

 

If I remove the “if Web” condition the app breaks with an unexpected NULL error. Even if I change the setting back, the error persists. I need to re-clone to get it working again.

 

Based on this info it seems there is code that needs adjusting in the RC component correct?

Otherwise I guess I have to go direct API with RC?

…..

Or perhaps something in the button which actually loads the paywall can be adjusted to make sure it works for stripe/Web

// Generated code for this PaywallFeatureButton Widget...
Padding(
padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 30),
child: FFButtonWidget(
onPressed: () async {
if (isWeb) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
'Subscriptions are not available on the web. Run on a mobile device to purchasse subscriptions.',
style: TextStyle(
color: Color(0xFFF8FAFF),
),
),
duration: Duration(milliseconds: 4000),
backgroundColor: Color(0xFF0B0D17),
),
);
} else {
final isEntitled = await revenue_cat.isEntitled('premium') ?? false;
if (!isEntitled) {
await revenue_cat.loadOfferings();
}
if (isEntitled) {
await actions.perfomMagic();
FFAppState().update(() {
FFAppState().wColor = FFAppState().wColor;
});
} else {
await showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Color(0x00000000),
barrierColor: Color(0x00000000),
context: context,
builder: (context) {
return GestureDetector(
onTap: () => _model.unfocusNode.canRequestFocus
? FocusScope.of(context).requestFocus(_model.unfocusNode)
: FocusScope.of(context).unfocus(),
child: Padding(
padding: MediaQuery.viewInsetsOf(context),
child: Container(
height: MediaQuery.sizeOf(context).height * 0.6,
child: RevenueCatSubsriptionPaywallWidget(),
),
),
);
},
).then((value) => safeSetState(() {}));
}
}
},

 

Userlevel 4
Badge +8

Hi, sorry for the delay are you still having trouble with this? FlutterFlow currently only supports RevenueCat with iOS and Android apps. In order to use RevenueCat with FlutterFlow Web, you will need to use Stripe and use Stripe’s API. Unfortunately I do not have much insight into how FlutterFlow works so you may need to ask FlutterFlow support for how to use Stripe with FlutterFlow Web if you did not want to use Stripe’s API to see if it could be compatible. Please see our documentation on Stripe here for what you need to setup: https://www.revenuecat.com/docs/stripe

Badge

Hi, sorry for the delay are you still having trouble with this? FlutterFlow currently only supports RevenueCat with iOS and Android apps. In order to use RevenueCat with FlutterFlow Web, you will need to use Stripe and use Stripe’s API. Unfortunately I do not have much insight into how FlutterFlow works so you may need to ask FlutterFlow support for how to use Stripe with FlutterFlow Web if you did not want to use Stripe’s API to see if it could be compatible. Please see our documentation on Stripe here for what you need to setup: https://www.revenuecat.com/docs/stripe

OK thanks and Im still working on this yes. Flutterflow works well with stripe so that wont be an issue (using their API) - Im assuming after I setup stripe in FF all I need to do is send RC data via the  POST receipt endpoint .(At the end of the day I’d user data/subscriptions synced with all 3 devices (ios, android or web).

Userlevel 4
Badge +8

Hi, yes you’ll want to format this as our documentation here shows and also will need to make sure you create the app user id in RevenueCat first before sending the request: https://www.revenuecat.com/docs/stripe#5-send-stripe-tokens-to-revenuecat

Reply