fireflutter_in_app_purchase 0.0.2
fireflutter_in_app_purchase: ^0.0.2 copied to clipboard
FireFlutter in-app-purchase package. This package is a submodule of fireflutter.
In app purchase module for Fireflutter #
In app purchase for fireflutter
Setup #
- Create an instance of
Payment
class some where in global space.
final Payment payment = Payment();
copied to clipboard
- Let the in-app-purchase plugin know that we are using it.
import 'package:in_app_purchase/in_app_purchase.dart';
void main() {
// Let the plugin know that this app supports pending purchases.
InAppPurchaseConnection.enablePendingPurchases();
runApp(MyApp());
}
copied to clipboard
- Inititiate
Payment
instance with productIds of App/Play store.
class _MyAppState extends State<MyApp> {
@override
void initState() {
payment.init(productIds: {'product1', 'product2', 'lucky_box'});
super.initState();
}
copied to clipboard