Profile picture

Muhammad Zeeshan

Yeah! it's me ;)

Apple Promotional Offer Signature Generator
PROMOTIONAL OFFER

Signature Generator!

Apple Promotional Offer Signature Generator

This tool allows you to generate a promotional offer signature for testing that developer need to send in the SKPaymentDiscount during a purchase of In App subscription via StoreKit.

APP BUNDLE IDENTIFIER

KEY IDENTIFIER

PRODUCT IDENTIFIER

OFFER IDENTIFIER

USERNAME -OR- ACCOUNT TOKEN

Note:

Make sure to set the same before adding to payment queue otherwise use will receive SKErrorDomain error 12

let payment = SKMutablePayment(product: product)
payment.applicationUsername = "xyz"

NONCE

TIMESTAMP

P8 KEY

Information

This tool is utilising the logic from the sample project provided by Apple Here. For purchasing promotional offers developer needs some additional paramters to pass in for SKPayment before adding it in the payment queue. For example:

let discount = SKPaymentDiscount(identifier: offerIdentifier,
keyIdentifier: keyIDentifier,
nonce: UUID(uuidString: nonce),
signature: signature,
timestamp: NSNumber(value: timeStamp))
payment.paymentDiscount = discount

SKPaymentQueue.default().add(payment)

NB: This tool works within a browser locally and does not sync keys. You can always revoke your keys from App Store Connect.Server side is required to get the additional parameters mainly because adding your private key inside your app's bundle isn't a good idea.

Want to get in touch? Feel free to contact me at

mzeeshanid@yahoo.com

Muhammad Zeeshan

Copyright © 2021