How to create a discount card for Apple Wallet? - ios

How can I create (and is it possible at all) discount cards for a coffee shop using Apple Wallet and iOS APIs?
The effect I want to get is the following: iOS users should have a personal card in Apple Wallet which they will bring to the coffee shop. In the coffee shop there will be a scanner which can add score for each scan and nullify it when the score reaches let's say 7 scans (so users will have each 7-th cup of coffee for free).

Creating a Apple Wallet pass is described here: Apple Docs
You edit the pass.json describing your pass, then you can sign it using Apples signpass tool after you have registered a pass type identifier and found your Team ID. If you want to update the pass to display the information to customers, you would need a server that implements the web service API.
As Paulw11 has said, you will need some sort of scanner to read the data from customers passes. One way is QR codes, in which your cashier will hold a camera to the QR code on the pass to read the customer info, usually it will just be a unique ID which you have mapped to a customer account. Another possibility is using NFC so the customer taps their phone to a NFC reader which will transmit their unique ID for you to process.
If you would like to try reading passes using NFC, see PassNinja.
Here is a video of it in action:
NFC Pass Solution for Mobile Wallets
Disclosure: I work for Flomio, the company behind PassNinja.

Related

Adding dashboard to Apple Wallet Pass like Apple Card

I am currently trying to find if it is possible to create a dashboard to my companies loyalty pass, similar to the one that Apple has created for their own Apple Card.
I have been able to add just a text on the card that updates whenever I send the notification, but I am looking to display more stats about customers purchases. I have not been successful in finding guidance about this on documentation, so it could be that Apple doesn't allow that yet to anyone else. Is my idea possible, if so how to add GUI elements under the pass?

Is it possible to have the ability to let customers purchase streaming content from itunes from within your ios app?

I wanted to add a feature to my app that allows you to purchase content from itunes from within the app. Is this possible, and if it is does Apple give some type of reference fee for finding customers to purchase the content?
Use SKStoreProductViewController. You specify the product's iTunes id to display that product. If you are part of the Affiliate program, you can also specify your affiliate id to get a commission.
See the code in this answer for an example of using SKStoreProductViewController. You would need to add the use of the SKStoreProductParameterAffiliateToken key to add your affiliate id.

Apple Pay :Is it possible to get name on card which is selected by user from apple pay tray?

I am working on Integrating Apple Pay in my app. I need following details to post to api :
1. Name on the card,
2. last 4 four digits,
3. type of card (VISA, AMEX etc)
Is there a way to retrieve those from the card selected by user in Apple Pay tray ?
You cannot get the name on the card via ApplePay. This is one of the reasons why a lot of merchants have resisted it. But Apple did this to protect users' privacy: you should be able to buy something without telling someone your name. If someone doesn't know your name then how can they identity fraud you?
If you want the customer's name, ask them, or have employees check their ID and require that the name be entered into the system. If you can't be asked to bother asking the customer to identify themselves, then, since the customer has not voluntarily given you their name, why do you deserve to have it?

iTunes Affiliate Program: Confirm if purchase is successful

In my application I am listing some songs and users can tap on download and Itunes open and user can download the music. This far its working perfect.
Now I need to know if user have successfully purchased the music. I have some logic to be implemented based on whether the purchase is successful or not.
Is there anyway we can find a successful iTunes purchase? At-least when we use our affiliate ID?
Take a look at how Ebates does this. They link to the iTunes store through Apple's program in the LinkShare network (so you'll need to find analogous instructions for whichever network you use with iTunes: PHG, TradeDoubler, LinkShare, etc).
Notice that your outbound click to the iTunes store from Ebates contains a URL parameter u1 with a unique ID that looks like ebs1234567890sbe. That's what's called a "Signature" or "ShopperID" or "SID value". That ID gets attached to the user so that when they complete a purchase and you get your commission, your reporting will have this ID attached to the transaction. That's how cashback affiliates know to give the right cashback to the right user and you can use that same feature for your needs.
So, some steps for you:
Find the documentation for sending SID values for the affiiliate network you're using to send traffic to iTunes. Here's the documentation for LinkShare (pdf).
Pass a user id with clicks to iTunes
Integrate with your affiliate network's commissions API so that your servers know when a sale has been completed and which user id completed the sale
EDIT: iTunes affiliates working through the PHG network will find these resources useful:
This PDF is PHG's quick start guide. Follow the instructions for "Sub-ID tracking parameters."
PHG's API Docs discuss reporting methods.
Thanks to #Deepukjayan, here is the precise API query syntax for getting your pubref value back from PHG's iTunes API: https://login:pass#itunes-api.performancehorizon.com/reporting/report_publisher/publisher/YOUR_ID/conversion.json?publisher_reference=YOUR_PUBREF_STRING

iOS In-App Purchase, sending to another account (gifting?)

I have a client that needs to have its volunteers purchase an IAP (A data package that is downloaded), then somehow reimburse them. The problem is that there is no easy way to do this that I think Apple will approve of. Especially for over 1500 people. I've come up with several ways of doing this with their pros and cons, which one would be best to implement and does anyone have any other suggestions on how to do this?
1) Have the client send out iTunes gift cards via email. The IAP is $7, and you can't send a gift card less than $10. Also, they would have to send them one at a time, there is no way to send bulk. Not going to work
2) Create gift codes like iTunes gift cards. My client can purchase codes in bulk via IAP (so Apple still gets their money), and store them on my web server securely. I can then implement a system to send all the codes to a single email, or individually to multiple emails. Then the volunteers can use the codes to unlock that single IAP. This would be more work on my part, but easier for my client. Something tells me Apple probably would not approve of this method.
3) Create "Credits" that the client can purchase in bulk via IAP (so Apple still gets their money), then gift either the credits or send the IAP info itself to the volunteers via a p2p bluetooth connection created with game kit. This would be harder for the client, as they would have to send each "Credit" individually. But I think Apple would be more likely to approve this.
4) Have the client send me a list of UUIDs for each of the volunteers devices. I add the UUIDs to a secure list on my server. During the purchase the a check is preformed to see if the devices UUID matches one on my server. If it is, they are marked as "all ready paid" and given the IAP data. I don't know about this one, as the only way I can see the money transfer happening is myself getting paid directly, and Apple being left out (So they probably wouldn't approve of this. I have no problem giving Apple their 30% if I could find a way to get that to work with this.
I'd go with Option 5, and create my own IAP system. Much like Option 3, but bypassing Apple all together. Add a Custom URL Scheme to you application, give it to your client to distribute. When your app is launched by its Custom URL Scheme have it open to a promo code entry page.
Your client would be able to purchase/create codes as necessary via a website that you set up for them. You would then store the codes (or create an algorithm to check generated codes against), and validate the codes as the users enter them.
Then your clients users would enter their unique code and have everything unlocked/downloaded as needed.
I have done a similar set up with promo codes to unlock the full version of my applications so I could create my own promotions, without making the upgrades free for everyone by removing/altering the IAP.

Resources