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
Related
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.
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).
I created the my own .pkpass file with dummy data
I need to change the data in the pass according to the data in the app
like boarding pass
if I missed something , could please help me ?
You will require a new .pkpass bundle for every change to the pass.
A new bundle will need to be signed. For security reasons, this should not take place on the device as it risks compromising your Pass Type ID certificate.
When you want to change the data, you should request a new pass bundle from your server and use the PassKit APIs to replace the pass in the Wallet.
You need to implement full loop system according to Apple Passbook/wallet standard or at least you have to like this.
in pkpass file add webService, serialNumber (text and number), authenticationToken (text and number at least 16 characters), passTypeIdentifier and teamIdentifier value (register and download certification file from apple developer account). It has to be https and point to your server.
create push notification system to devices that keep your passes by using certification file (cer) and create p12 and pem files (you can find how to make it here: Update Passbook wallet failed to connect)
create update web service to manage request from device and return new pkpass file to devices
others that: you have to make web service to manage register, update and delete method from devices.
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.
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.