tschoffelen / php-pkpass

💳 PHP class for creating passes for Wallet on iOS.
https://includable.com
MIT License
916 stars 186 forks source link

How i can add thumanil@2x.png option #135

Closed skjangid closed 11 months ago

skjangid commented 11 months ago

I want to show user prpfile image in the wallet, the option is available when i pass thumnail@2x,png in node.js but how i can use in php ?

tschoffelen commented 11 months ago

You can use the addFile method to add files to your pass, like the example here:

https://github.com/includable/php-pkpass/blob/ee6df67e8d6d8be056227d7c19636431132d5046/examples/starbucks_sample/index.php#L75

skjangid commented 11 months ago

$pass->addFile function is allowing absolute image path ? like the web image url ?

tschoffelen commented 11 months ago

It won't allow web image URLs, you'd have to first download them to the filesystem.

The function accepts either relative or absolute local paths:

$pass->addFile('icon.png'); // icon.png in same folder as your script

// or:
$pass->addFile('/var/local/web/.../icon.png');