Samsung Wallet Sample 1.0

Samsung Wallet Sample for Flutter

support flutter >= 3.0, dart >= 2.14.0, < 4.0.0

More Information

You can get more information the Samsung Wallet documentation.

References

This package based on the Android sample code from Samsung Wallet. If you need the reference code, you can click here to access it.

How to use

  1. add dependency

Add dependency to your pubspec.yaml file.

dependencies:
  samsung_wallet: newest_version
  1. Add Permission

Add permission to your AndroidManifest.xml file.

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

If you want more information, check this

  1. Set main

Please add 'WidgetsFlutterBinding.ensureInitialized();' code to your main in main.dart file

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(MyApp());
}
  1. Initialization SamsungWallet

Initialization SamsungWallet Object

  final samsungWalletPlugin = SamsungWallet(
      countryCode: countryCode,
      partnerCode: partnerCode,
      impressionURL: impressionUrl);

If you initialize the SamsungWallet object, it will automatically check SamsungWallet support immediately.

The results can be viewed in the debug console log.

  1. Add Card

If Samsung wallet is supported, you can add card.

samsungWalletPlugin.addCardToSamsungWallet(
        cardID: cardId, cData: cdata, clickURL: clickUrl);

You can get cdata JWT Generator. Please check here about JWT Generator

Issues

Please file any issues, bugs or feature request as an issue on my GitHub page.