cafebazaar_flutter 0.1.2 copy "cafebazaar_flutter: ^0.1.2" to clipboard
cafebazaar_flutter: ^0.1.2 copied to clipboard

PlatformAndroid
outdated

CafeBazaar In-App Billing package for flutter this package is just for android applications and not work on ios

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:cafebazaar_flutter/cafebazaar_flutter.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String platformVersion;
    // Platform messages may fail, so we use a try/catch PlatformException.
    bool result = (await CafebazaarFlutter.initPay(
        rsaKey:" MIHNMA0GCSqGSIb3DQEBAQUAA4G7ADCBtwKBrwCnUMP0iJ21ntw4Z3LkUpcoatrGyc/08dcRS5OnU6iTHLcU76xc1Lp1tAkSPBE79JOQ6IwEwwTqPTe8Le965bZlAMT8+0Fc177zr83rXpqioITzJpSzETA3+HpdMVmGWyUR87QbuUtBYBl01u90KtON9X2KzVM0YN8hn0dR/GNtF+K1tjLaqGjb1gGNVG6CrxH4mQKRzqWUU5YFogxhggRmwZdJ5U/2DTGdNydVjHsCAwEAAQ== "))!;
    print("_bazzar_bazzar_bazzar $result");

  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Column(
          children: <Widget>[
            Center(
              child: RaisedButton(
                  child: Text("PayFirst"),
                  onPressed: () async{
                    Map<String,dynamic> result = await CafebazaarFlutter.launchPurchaseFlow(
                        sku: "sss2", consumption: false,payload: "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
                    print("resultresult $result");
                    CafebazaarFlutter.verifyDeveloperPayload(payload: "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ").then((res){
                     print(res);
                   });

                  }),
            ),
            Center(
              child: RaisedButton(
                  child: Text("PaySecond"),
                  onPressed: () async{
                    Map<String,dynamic> result = await CafebazaarFlutter.launchPurchaseFlow(
                        sku: "PaySecond", consumption: true,payload: "yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
                    print("resultresult $result");
                    CafebazaarFlutter.verifyDeveloperPayload(payload: "yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ").then((res){
                      print(res);
                    });
                  }),
            ),
          ],
        ),
      ),
    );
  }

  @override
  void dispose() {
    CafebazaarFlutter.dispose();
    super.dispose();
  }
}
54
likes
130
points
40
downloads

Publisher

verified publisherflutterfarsi.ir

Weekly Downloads

CafeBazaar In-App Billing package for flutter this package is just for android applications and not work on ios

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on cafebazaar_flutter

Packages that implement cafebazaar_flutter