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

Save your wallet passes on both iOS & Android

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

Usage #

You can check if the Wallet API is available on the device :

PlatformWallet.instance.isWalletApiAvailable();

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);
}

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);
}
1
likes
0
points
320
downloads

Publisher

verified publisherdoggo-saloon.net

Weekly Downloads

Save your wallet passes on both iOS & Android

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dio, flutter, plugin_platform_interface

More

Packages that depend on platform_wallet