samsung_wallet 1.1.0 samsung_wallet: ^1.1.0 copied to clipboard
Samsung Wallet Example Flutter plugin project. This plugin based Samsung Wallet Android java package file.
Samsung Wallet 1.1.0 #
Samsung Wallet for Flutter
Requirement #
support flutter >= 3.0, dart >= 2.17.0, < 4.0.0
compileSdkVersion 34
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 #
- add dependency
- Add dependency to your
pubspec.yaml
file.
dependencies:
samsung_wallet: newest_version
- 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, Please check this
- Set main
- Please add 'WidgetsFlutterBinding.ensureInitialized();' code to your main in
main.dart
file
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(MyApp());
}
- 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.
- Create onTapMethod for add Card
- If Samsung wallet is supported, you can add card.
function onTap(){
samsungWalletPlugin.addCardToSamsungWallet(
cardID: cardId, cData: cdata, clickURL: clickUrl);
}
- Add Samsung Wallet Button Widget
AddToSamsungWalletButton(onTapAddCard: onTap)
More #
- Add to Wallet Test Tool
- If you want Using 'Add to Wallet Test Tool', try this widget
AddToSamsungWalletButton.testTool()
More information about 'Add to Wallet Test Tool' Please check this
- How to make Cdata
- You can make cdata using JWT Generator. Please check here about JWT Generator
Issues #
Please file any issues, bugs or feature request as an issue on my GitHub page.