wepin_flutter_pin_pad 1.0.0 copy "wepin_flutter_pin_pad: ^1.0.0" to clipboard
wepin_flutter_pin_pad: ^1.0.0 copied to clipboard

A Flutter package of Wepin Pin Pad Library



wepin_flutter_pin_pad #

mit licence

pub package

platform - android platform - ios

Wepin Pin Pad libarary for Flutter. This package is exclusively available for use in Android and iOS environments.

⏩ Get App ID and Key #

After signing up for Wepin Workspace, navigate to the development tools menu, and enter the required information for each app platform to receive your App ID and App Key.

⏩ Requirements #

  • Android: API version 21 or newer is required.
    • Set compileSdkVersion to 34 in the android/app/build.gradle file.
  • iOS: Version 13 or newer is required.
    • Update the platform :ios version to 13.0 in the ios/Podfile of your Flutter project. Verify and modify the ios/Podfile as needed.
  • Dart version 3.5.0 or newer is required.
  • Flutter version 3.24.0 or newer is required.

⚠️ Important Notice for v1.0.0 Update

🚨 Breaking Changes & Migration Guide 🚨

This update includes major changes that may impact your app. Please read the following carefully before updating.

🔄 Storage Migration from flutter_secure_storage to Native Storage • In previous versions, this package used flutter_secure_storage for secure data storage.

• Starting from v1.0.0, data is now stored using a native implementation (iOS Keychain / Android EncryptedSharedPreferences).

• Any existing data stored with flutter_secure_storage will automatically migrate to the new native storage during the first app launch after updating.

• ⚠️ Downgrading to an older version after updating to v1.0.0 may prevent access to previously stored data.

• Recommended: Backup your data before updating to avoid any potential issues.

⏩ Install #

Add the wepin_flutter_pin_pad dependency in your pubspec.yaml file:

dependencies:
  wepin_flutter_pin_pad: ^1.0.0
copied to clipboard

or run the following command:

flutter pub add wepin_flutter_pin_pad
copied to clipboard

⏩ Getting Started #

⚠️ Android-Specific Requirement

To ensure proper functionality on Android, you must disable Android’s automatic backup feature.

🔧 How to Disable Backup (Android)

Modify your AndroidManifest.xml file:

<application
    android:allowBackup="false"
    android:fullBackupContent="false"
    ...
>
copied to clipboard

🔹 If android:allowBackup is true, the migration process may not work correctly, leading to potential data loss or storage issues.

To enable OAuth login functionality (login.loginWithOauthProvider), you need to configure the Deep Link Scheme.

Deep Link scheme format : wepin. + Your Wepin App ID

Android

When a custom scheme is used, the WepinWidget SDK can be easily configured to capture all redirects using this custom scheme through a manifest placeholder in the build.gradle (app) file:

// For Deep Link => RedirectScheme Format: wepin. + Wepin App ID
android.defaultConfig.manifestPlaceholders = [
  'appAuthRedirectScheme': 'wepin.{{YOUR_WEPIN_APPID}}'
]
copied to clipboard

iOS

You must add the app's URL scheme to the Info.plist file. This is necessary for redirection back to the app after the authentication process.

The value of the URL scheme should be 'wepin.' + your Wepin app id.

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLName</key>
        <string>unique name</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>wepin.{{YOUR_WEPIN_APPID}}</string>
        </array>
    </dict>
</array>
copied to clipboard

⏩ Import SDK #

import 'package:wepin_flutter_pin_pad/wepin_flutter_pin_pad.dart';
import 'package:wepin_flutter_pin_pad/wepin_flutter_pin_pad_types.dart';
copied to clipboard

⏩ Initialize #

WepinPinPad wepinPinPad = WepinPinPad(wepinAppKey: wepinAppKey, wepinAppId: wepinAppId);
copied to clipboard

init #

await wepinPinPad.init(String? language)
copied to clipboard

Parameters

  • language <String> - The language to be displayed on the widget (default: 'en'). Currently, only 'ko', 'en', and 'ja' are supported.

Example

await wepinPinPad.init('ko')
copied to clipboard

isInitialized #

wepinPinPad.isInitialized()
copied to clipboard

The isInitialized() method checks if the Wepin PinPad Libarary is initialized.

Returns

  • Future<bool> - Returns true if Wepin PinPad Libarary is already initialized, otherwise false.

changeLanguage #

wepinPinPad.changeLanguage(String language)
copied to clipboard

The changeLanguage() method changes the language and currency of the widget.

Parameters

  • language <String> - The language to be displayed on the widget. Currently, only 'ko', 'en', and 'ja' are supported.

Returns

  • void

Example

wepinPinPad.changeLanguage('ko');
copied to clipboard

⏩ Method & Variable #

Methods and Variables can be used after initialization of Wepin PinPad Libarary. Wepin PinPad Libarary

login #

The login variable is a Wepin login library that includes various authentication methods, allowing users to log in using different approaches. It supports email and password login, OAuth provider login, login using ID tokens or access tokens, and more. For detailed information on each method, please refer to the official library documentation at wepin_flutter_login_lib.

Available Methods

  • loginWithOauthProvider
  • signUpWithEmailAndPassword
  • loginWithEmailAndPassword
  • loginWithIdToken
  • loginWithAccessToken
  • getRefreshFirebaseToken
  • loginWepin
  • getCurrentWepinUser
  • logout
  • getSignForLogin

These methods support various login scenarios, allowing you to select the appropriate method based on your needs.

For detailed usage instructions and examples for each method, please refer to the official library documentation. The documentation includes explanations of parameters, return values, exception handling, and more.

Example

// Login using an OAuth provider
final oauthResult = await wepinPinPad.login.loginWithOauthProvider(provider: 'google', clientId: 'your-client-id');

// Sign up and log in using email and password
final signUpResult = await wepinPinPad.login.signUpWithEmailAndPassword(email: 'example@example.com', password: 'password123');

// Log in using an ID token
final idTokenResult = await wepinPinPad.login.loginWithIdToken(idToken: 'your-id-token', sign: 'your-sign');

// Log in to Wepin
final wepinLoginResult = await wepinPinPad.login.loginWepin(idTokenResult);

// Get the currently logged-in user
final currentUser = await wepinPinPad.login.getCurrentWepinUser();

// Logout
await wepinPinPad.login.logout();
copied to clipboard

For more details on each method and to see usage examples, please visit the official wepin_flutter_login_lib documentation.

generateRegistrationPINBlock #

await generateRegistrationPINBlock(BuildContext context)
copied to clipboard

Generates a pin block for registration.

Parameters

  • context <BuildContext> - The BuildContext parameter is essential in Flutter as it represents the location of a widget in the widget tree. This context is used by Flutter to locate the widget's position in the tree and to provide various functions like navigation, accessing theme data, and more. When you call generateRegistrationPINBlock, you pass the current context to ensure that the widget is displayed within the correct part of the UI hierarchy.

Returns

  • Future<RegistrationPinBlock>
    • uvd: <EncUVD> - Encrypted PIN
      • b64Data <String> - Data encrypted with the original key in b64SKey
      • b64SKey <String> - A key that encrypts data encrypted with the Wepin's public key.
      • seqNum <int> - optionl Values to check for when using PIN numbers to ensure they are used in order.
    • hint: <EncPinHint> - Hints in the encrypted PIN.
      • data <String> - Encrypted hint data.
      • length <String> - The length of the hint
      • version <int> - The version of the hint

Example

await wepinPinPad.generateRegistrationPINBlock(context);
copied to clipboard

generateAuthPINBlock #

await generateAuthPINBlock(BuildContext context, int? count)
copied to clipboard

Generates a pin block for authentication.

Parameters

  • context <BuildContext> - The BuildContext parameter is essential in Flutter as it represents the location of a widget in the widget tree. This context is used by Flutter to locate the widget's position in the tree and to provide various functions like navigation, accessing theme data, and more. When you call generateAuthPINBlock, you pass the current context to ensure that the widget is displayed within the correct part of the UI hierarchy.
  • count <int> - optional PIN block count (default value is 1).

Returns

  • Future<AuthPinBlock>
    • uvdList: <List
    • otp <String> - optionl If OTP authentication is required, include the OTP.

Example

await wepinPinPad.generateAuthPINBlock(context, 1);
copied to clipboard

generateChangePINBlock #

await generateChangePINBlock(BuildContext context)
copied to clipboard

Generate pin block for changing the PIN.

Parameters

  • context <BuildContext> - The BuildContext parameter is essential in Flutter as it represents the location of a widget in the widget tree. This context is used by Flutter to locate the widget's position in the tree and to provide various functions like navigation, accessing theme data, and more. When you call generateChangePINBlock, you pass the current context to ensure that the widget is displayed within the correct part of the UI hierarchy.

Returns

  • Future<ChangePinBlock>
    • uvd: <EncUVD> - Encrypted PIN
      • b64Data <String> - Data encrypted with the original key in b64SKey
      • b64SKey <String> - A key that encrypts data encrypted with the wepin's public key.
      • seqNum <int> - optionl Values to check for when using PIN numbers to ensure they are used in order
    • newUVD: <EncUVD> - New encrypted PIN
      • b64Data <String> - Data encrypted with the original key in b64SKey
      • b64SKey <String> - A key that encrypts data encrypted with the wepin's public key.
      • seqNum <int> - optionl Values to check for when using PIN numbers to ensure they are used in order
    • hint: <EncPinHint> - Hints in the encrypted PIN
      • data <String> - Encrypted hint data
      • length <String> - The length of the hint
      • version <int> - The version of the hint
    • otp <String> - optionl If OTP authentication is required, include the OTP.

Example

await wepinPinPad.generateChangePINBlock(context);
copied to clipboard

generateAuthOTP #

await generateAuthOTP(BuildContext context)
copied to clipboard

generate OTP.

Parameters

  • context <BuildContext> - The BuildContext parameter is essential in Flutter as it represents the location of a widget in the widget tree. This context is used by Flutter to locate the widget's position in the tree and to provide various functions like navigation, accessing theme data, and more. When you call generateAuthOTP, you pass the current context to ensure that the widget is displayed within the correct part of the UI hierarchy.

Returns

  • Future<AuthOTP>
    • code <String> - optionl The OTP entered by the user.

Example

await wepinPinPad.generateAuthOTP(context);
copied to clipboard

finalize #

await wepinPinPad.finalize()
copied to clipboard

The finalize() method finalizes the Wepin PinPad Libarary, releasing any resources or connections it has established.

Parameters

  • None - This method does not take any parameters.

Returns

  • Future<void> - A future that completes when the SDK has been finalized.

Example

await wepinPinPad.finalize();
copied to clipboard
0
likes
130
points
150
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.12 - 2025.03.27

A Flutter package of Wepin Pin Pad Library

Homepage
Repository (GitHub)

Topics

#wepin #wepin-pin-pad

Documentation

API reference

License

MIT (license)

Dependencies

flutter, wepin_flutter_common, wepin_flutter_login_lib, wepin_flutter_modal, wepin_flutter_network, wepin_flutter_storage

More

Packages that depend on wepin_flutter_pin_pad