Last updated:
0 purchases
platform wallet
platform_wallet #
Save your wallet passes on both iOS & Android.
Why this plugin ? #
The plugin add_to_wallet, used to save passes on iOS, blocks builds on Android. Since I needed to build on both platforms, I made this simple plugin to allow both platforms to use passes and allow builds.
Installation #
Install this plugin by running
flutter pub add platform_wallet
copied to clipboard
Usage #
You can check if the Wallet API is available on the device :
PlatformWallet.instance.isWalletApiAvailable();
copied to clipboard
iOS #
final Uri uri = Uri.parse("https://example.com/pass.pkpass");
try {
final PKPass pass = await PKPass.fromUrl(
uri,
headers: {"Authorization": "Bearer ..."},
);
pass.save();
} on PlatformWalletException catch (e) {
print("Something went wrong...");
print(e);
}
copied to clipboard
Android #
final Uri uri = Uri.parse("https://pay.google.com/gp/v/save/ey...");
try {
final GooglePass pass = GooglePass.fromUrl(uri);
pass.save();
} on PlatformWalletException catch (e) {
print("Something went wrong...");
print(e);
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.