ios_device_check 2.0.0+1 copy "ios_device_check: ^2.0.0+1" to clipboard
ios_device_check: ^2.0.0+1 copied to clipboard

discontinued
PlatformiOS

Flutter plugin for accessing the iOS DeviceCheck. Only supported on iOS 11.0 or newer.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:ios_device_check/ios_device_check.dart';

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

class MyApp extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => MyAppState();
}

class MyAppState extends State<MyApp> {
  dynamic _result;

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

  void _generateToken() async {
    if (!(await IosDeviceCheck.isSupported())) {
      setState(() => _result = 'Not supported');
      return;
    }

    try {
      String token = await IosDeviceCheck.generateToken();
      setState(() => _result = token);
    } on PlatformException catch (e) {
      setState(
          () => _result = '[Error]: ${e.code} / ${e.message} / ${e.details}');
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('IosDeviceCheck Plugin Example'),
        ),
        body: SafeArea(
          child: Column(
            children: [
              Expanded(
                flex: 8,
                child: Container(
                  decoration: BoxDecoration(border: Border.all()),
                  margin: EdgeInsets.all(8),
                  padding: EdgeInsets.all(8),
                  child: SingleChildScrollView(
                    child: Text('${_result ?? ''}'),
                  ),
                ),
              ),
              Flexible(
                flex: 2,
                child: ElevatedButton(
                  child: Text('generateToken'),
                  onPressed: _generateToken,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
7
likes
130
pub points
78%
popularity

Publisher

verified publishernaokiokada.com

Flutter plugin for accessing the iOS DeviceCheck. Only supported on iOS 11.0 or newer.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on ios_device_check