Automatically Download Apple Wallet Pass After Redemption - ios

Is it possible to download a second wallet pass automatically after redeeming a wallet pass. We have seen that this is possible but could not find any solution for this. As i know our api can only return one kind of pass to our servers with wether you update or renewing the pass. We have attached a video where you can see that they download a second pass automatically without adding the card. As far we know the Apple Api only returns a get when want to download a new pass with a push notification
In this video you can see that
the wallet is downloading a next pass (5:39)
WalletPass Video
Would really appreciate help in this
Regards,
Oktay

The product in the video is our product. All changes are made by updating a pass already in the wallet. As long as the passTypeIdentifier and serialNumber remain the same, you can change any other content in a pass.
We have a redeem API endpoint that marks the first pass as being used, and sends an update to remove the barcode. 15 seconds later, a second update is automatically sent with the new pass details. The new details replace the old details of the original pass. The user only ever has one pass in their wallet. It is not possible to push a second pass (with a different passTypeIdentifier and serialNumber).

Related

Is it possible to send changeMessage notification at wallet creation?

I have a website with Symfony for create IOS wallet and i want to know if is it possible to send a changeMessage notification to my users when they install wallet on their phones like : Welcome on your wallet !
Is it possible ?
For informations, my changeMessage notification work when i update my user wallet, i create notification parameter to send a notification message with 255 characters Max and my changeMessage call this parameter when pass is update.
Thanks in advance
Yes, it is possible but it takes a bit of work.
When a user first installs your pass, iOS will call the web service to register. Once registered it will immediately make a call to get the latest version of the pass.
If the pass returned is different to the pass originally installed then the change message will trigger.
Since this will happen just once at the time the pass is installed, you should achieve the same experience you describe in your question.

Apple Mobile Wallet - how to send updated new pass coupon

Reference links & spacial THANKS to #Passkit:
1: how-to-make-a-push-notification-for-a-pass
2: how-to-use-changemessage-key-in-pass-json
im missing one part please i need guidance.
i'll send push notification using APNS service. im not able to figure-out, how i'll send my new pass.pkpass file or bundle to my costumer ? if answer is my web-service then how i'll know this request is for new or updated card request. Right now my web-service only updating database when any card removed or install.
im using passkit library and PHP to generate pass coupons dynamically. My API is in coldfusion.
This is a three step process.
When a user installs a pass on their iOS device and there is a webserviceUrl value specified, the device will register itself, providing a push token.
When the device receives the push notification, it will reach out to your API asking for a list of passes that have changed (using a timestamp). You return the serial numbers of all the passes that have been updated (for your pass type identifier).
iOS will then request the new pass for each of the serial numbers. If will diff the passes and display the relevant changeMessage values.
This is explained in more details in the developer guide: https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/PassKit_PG/Updating.html#//apple_ref/doc/uid/TP40012195-CH5-SW1

Apple Passbook(Wallet) device Registration not by app

I'm trying to build up a web service to push discount information to end-users. My question is that I know we can push coupon by my own app but is there any possible way to avoid end-user installing our app? Is there any possible way that we only use web service to get device_library_identifier from our users to push notification to apple passbooks?
Very Thanks!
Pkpass files can be downloaded from web pages, attached to emails or loaded via QR code, for example. You don't need to use an app to deliver them.
When a .pkpass file is added to a user's wallet, it will register itself with your webService and you can then push updates to the pass.
This web service is outlined in Apple's documentation and covers what you need to record the pass:
https://developer.apple.com/library/ios/documentation/PassKit/Reference/PassKit_WebService/WebService.html
The section under "Update a Pass" in Apple's Wallet Overview, explains how this works in the context of a pass
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/PassKit_PG/Updating.html#//apple_ref/doc/uid/TP40012195-CH5-SW1
If normally you have new promotion to send coupon to customer time to time, you may start with member pass first so you can send link to download new coupon with notification to your member to load new coupon when they want without coming to your place to download new coupon.

Passes in Passbook: location and time sensitive

As I understand for the moment, the location and time sensitive passes in Passbook only support time and/or location based notifications. So at the correct time and location, the user will get a notification for the pass.
I was wondering if these properties also can be used to change the pass. For example, if you are in some specific store, the coupon provides a 50% reduction instead of a 20% reduction. If it is not possible to do this locally on the iOS device, is it possible to send a request to the server based on location and/or date to achieve the same thing?
Sorry to be the bearer of bad news, but it's not possible to accomplish this.
Firstly, the data within the pass is fixed at any point in time. As you've said, it can be fixed to a list of locations and/or a date.
Secondly, the pass cannot communicate with a server except to request an update in response to a push notification. This means you will never know where a pass is.
The only option way to achieve something like this would be to generate passes using an app that is location aware, but I don't think this is what you're after.
You can send a push update to a Pass at a specific time. This way you can (for example) convert a 10%-off coupon to 20%-off on Fridays (and then switch it back after Friday).
After a user has initially 'Added' your Pass promotion into their Passbook you can update it at any time without requiring the user to 're-approve' your update.
Your server does not know when a Passbook user has triggered a location alert - otherwise you could track their movements via Passbook. Apple does not want their customer's security to be compromised in this way.
However, you could issue a coupon that is normally 20%-off (for most stores, or online) but that the location alert for a specific store said 'Get 50% Off at this store'. When the customer comes in to have their Pass scanned & activated, your server will then know the customer's location and can apply the 50% reduction.

Prevent installing passbook on multiple devices

Not exactly a programming question but here it goes:
How can a company who is distributing passbook passes via email or web prevent a pass from being installed on more than one device?
I can not find anything about this on Apple docs. The only I can think of is to check on the device registration webservice whether the combination of pass type and serial has a device already registered and delete it , but I am not aware of any command to delete the pass remotely.
Another option would be to check if it is already registered prior to generating the pass but this would only work for URL distribution, not for email.
Is there any way to delete a pass remotely via push notification + update? Any ideas on how to solve this issue?
Mail and Mobile Safari will present any pass they are given and the user can decide to add them to their Passbook. There is nothing the pass creator can do to prevent it except to be careful about how the .pkpass files get handed around.
If you really only want to deliver a specific pass to a specific device you might consider a companion app that uses a custom API to communicate with the the backend and request the pass for that device that way. Then you have much more control than distribution via email or url links.
Apple frowns on trying to delete a pass programmatically; only users are supposed to delete passes because they added them. You can, however, update a pass to make it clear that is not valid and should be deleted. For example you can remove the bar code, if any, and use a background image with a big red "INVALID" on it.
Just to extend #ohmi's answer:
You cannot prevent passes from being installed on more than one
device - e.g. if user enables iCloud for Passbook, the passes will get
synced automatically across devices.
Considering your links to pkpasses are public, you may want to consider
introducing one-time download links, but while it can fill your
needs just fine, users can be really disappointed if it's impossible to re-add
passes that they manually deleted. So I wouldn't recommend such solution.
You can make you pkpass links kind of private, so only GET request originating from your application and carrying a specific value for specific header field (e.g. auth_token), will receive a pkpass file, however this way you almost disable pass distribution via email or via sharing URLs to passes and make pass updating probably impossible.

Resources