ios_receipt 1.1.0 copy "ios_receipt: ^1.1.0" to clipboard
ios_receipt: ^1.1.0 copied to clipboard

PlatformiOS

The IosReceipt package allows you to easily fetch the App Store receipt in your Flutter application on the iOS platform.

example/lib/main.dart

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

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  Future<void> _getReceipt() async {
    try {
      final receiptInBase64 = await IosReceipt.getAppleReceipt();
      print(receiptInBase64);
    } on PlatformException {
      print('PlatformException');
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: ElevatedButton(
            onPressed: _getReceipt,
            child: const Text('Get receipt'),
          ),
        ),
      ),
    );
  }
}
4
likes
140
points
349
downloads

Publisher

unverified uploader

Weekly Downloads

The IosReceipt package allows you to easily fetch the App Store receipt in your Flutter application on the iOS platform.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on ios_receipt

Packages that implement ios_receipt