-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from schjonhaug/support-3x-images
Add support for 3x images
- Loading branch information
Showing
3 changed files
with
122 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,9 +64,11 @@ public static async Task GenerateSamplePass(IPassKitHelper passKitHelper) | |
var package = await passKitHelper.CreateNewPassPackage(pass) | ||
.Icon(await File.ReadAllBytesAsync("images/icon.png")) | ||
.Icon2X(await File.ReadAllBytesAsync("images/[email protected]")) | ||
.Icon3X(await File.ReadAllBytesAsync("images/[email protected]")) | ||
.Logo(await File.ReadAllBytesAsync("images/logo.jpg")) | ||
.Strip(await File.ReadAllBytesAsync("images/strip.jpg")) | ||
.Strip2X(await File.ReadAllBytesAsync("images/[email protected]")) | ||
.Strip3X(await File.ReadAllBytesAsync("images/[email protected]")) | ||
.SignAndBuildAsync(); | ||
|
||
await File.WriteAllBytesAsync("Sample.pkpass", package.ToArray()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ Helper library for all your Apple PassKit (Apple Wallet, Apple Passbook) needs: | |
|
||
**Attention:** Apple Developer Account required! | ||
|
||
[![NuGet](https://img.shields.io/nuget/v/PassKitHelper.svg?maxAge=86400&style=flat)](https://www.nuget.org/packages/PassKitHelper/) | ||
[![NuGet](https://img.shields.io/nuget/v/PassKitHelper.svg?maxAge=86400&style=flat)](https://www.nuget.org/packages/PassKitHelper/) | ||
|
||
## Features | ||
|
||
|
@@ -88,9 +88,11 @@ var pass = passKitHelper.CreateNewPass() | |
var passPackage = passKitHelper.CreateNewPassPackage(pass) | ||
.Icon(await File.ReadAllBytesAsync("images/icon.png")) | ||
.Icon2X(await File.ReadAllBytesAsync("images/[email protected]")) | ||
.Icon3X(await File.ReadAllBytesAsync("images/[email protected]")) | ||
.Logo(await File.ReadAllBytesAsync("images/logo.jpg")) | ||
.Strip(await File.ReadAllBytesAsync("images/strip.jpg")) | ||
.Strip2X(await File.ReadAllBytesAsync("images/[email protected]")); | ||
.Strip2X(await File.ReadAllBytesAsync("images/[email protected]")) | ||
.Strip3X(await File.ReadAllBytesAsync("images/[email protected]")); | ||
|
||
MemoryStream packageFile = await passPackage.SignAndBuildAsync(); | ||
|
||
|
@@ -168,19 +170,20 @@ WebServiceURL is hostname of your server and path that equal to one in `UsePassK | |
|
||
When users install your pass packge to their iOS and Mac devices - Apple server call your `RegisterDeviceAsync`. Save `pushToken` value in database, and when you need to update pass on user device - call `IPassKitHelper.SendPushNotificationAsync(pushToken)`. | ||
|
||
|
||
## Installation | ||
|
||
Use NuGet package [PassKitHelper](https://www.nuget.org/packages/PassKitHelper/) | ||
## Dependencies | ||
|
||
For `netcoreapp3.1`: | ||
|
||
* Microsoft.Extensions.Http, v3.1.1 | ||
* Newtonsoft.Json, v12.0.2 | ||
* System.Security.Cryptography.Pkcs, v4.6.0 | ||
|
||
For `netstandard2.0`: | ||
|
||
* Microsoft.AspNetCore.Http.Abstractions, v2.1.1 | ||
* Microsoft.Extensions.DependencyInjection.Abstractions, v2.1.1 | ||
* Microsoft.Extensions.Logging.Abstractions, v2.1.1 | ||
|
@@ -197,4 +200,4 @@ Tests can be run with `dotnet test`. | |
## Credits | ||
|
||
* Thanks for inspiration to Tomas McGuinness and his [dotnet-passbook](https://github.com/tomasmcguinness/dotnet-passbook) package. | ||
* Thanks to [maxpixel.net](https://www.maxpixel.net) for sample kitten images. | ||
* Thanks to [maxpixel.net](https://www.maxpixel.net) for sample kitten images. |