Adding/posting coupon from web page to my wallet iCloud account

Please find my requirement: "Adding/posting coupon from web page to my wallet iCloud account"



My web page is showing coupons. Now if user clicks on these coupon I want to post this coupon in user's wallet iCloud account. Note: Web page will be opened on any browser e.g. Chrome/Safari/IE/Firefox, etc. on any OS like Windows/Mac/Linux etc.


Once the coupon goes into user's wallet iCloud account, from wallet iCloud coupon will be synched to user's iPhone Wallet Application. This part iCloud will do automatically.


My challenge is how to post coupon into user's wallet iCloud account.


Reference: Google has provided API for posting coupon to Google cloud (https://developers.google.com/wallet/objects/savetowallet).


Are there any similar API from Apple to post coupon/pass from webpage to wallet iCloud account?


Please guide.


Thanks

Replies

Hi there.


You could do something like this in PHP:


function outputPassBundleAsWebDownload() {

/

header("Content-Type: application/vnd.apple.pkpass");

header("Content-Disposition: attachment; ".

"filename=".basename($this->passBundleFile));

header("Content-Transfer-Encoding: binary");

header("Content-Length: ". filesize($this->passBundleFile));

flush();

readfile($this->passBundleFile);

}


Hope that helps.

Thanks for reply,
We want to upload .pkpass file into user's Wallet iCloud account.

NOTE: Pass/coupon is showing on webpage and from webpage we want upload .pkpass file to user's wallet iCloud account.

Can you please guide for solution ?


Thanks,

I guess what you're wanting to do is to update the Pass that's currently on iCloud. Then when the user's iOS device syncs up with iCloud - it would then get the new pass (which contains the coupon).


I took a look at the iCloud API - I don't see anything there that makes reference to injecting a pass into the Wallet on iCloud directly.


https://developer.apple.com/library/ios/documentation/General/Conceptual/iCloudDesignGuide/Chapters/iCloudFundametals.html


If you have a Pass on the iOS device, you could update the pass with the web service update where it would do a push notification to notify the user that the pass has been updated with the coupon. At some point the iOS device would then sync up with iCloud.

As I think about the user experience on what you want to do (update Pass on iCloud) - when would the user know that their pass has been updated? My gut feeling is that you would manually open up Wallet, and then open up the respective Passbook to see the coupon.

"I guess what you're wanting to do is to update the Pass that's currently on iCloud. Then when the user's iOS device syncs up with iCloud - it would then get the new pass (which contains the coupon)"

> We dont want to update Pass on iCloud.


"I took a look at the iCloud API - I don't see anything there that makes reference to injecting a pass into the Wallet on iCloud directly."

>We were looking for Apple API to inject pass into the Wallet directly.

> Is there any other way to injecting pass into the Wallet from webpage(running on any browser)?

Thanks,

Hi Asentech,


Scenario 1

I created a simple PHP web page that has the "Add To Apple Wallet" badge.


From an end-user perspective, when you go to this web page and click on the "Add To Apple Wallet" badge - the Passbook would download and display on your iOS device - you would then be prompted to click on the "Add" button to add it to your Wallet.


Scenario 2

Go to a web page and automatically download the Passbook. The Passbook would display on your iOS device, you would then be prompted to click on the "Add" button to add it to your Wallet.


For both Scenario 1 and Scenario 2, if you are looking to "by-pass" the "Add" - I'm not sure how you can do that. I suspect that's a product security feature from Apple.


Let me know if that is what you are trying to achieve.


- Simon.