This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shared_secret = None | |
use_sandbox = False | |
try: | |
opts, args = getopt.getopt(sys.argv[2:],"s:", ["secret=", "use_sandbox"]) | |
except getopt.GetoptError: | |
print(help_message) | |
sys.exit(2) | |
for opt, arg in opts: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
verify_receipt(receipt_data, shared_secret, use_sandbox) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Nami | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
func namiSetup() { | |
let namiConfig = NamiConfiguration(appPlatformID: "YOUR_NAMI_APP_ID_HERE") | |
Nami.configure(namiConfig: namiConfig) | |
} | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
namiSetup() | |
return true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Nami | |
class AboutViewController: UIViewController { | |
@IBAction func donateTapped(_ sender: Any) { | |
NamiPaywallManager.raisePaywall(fromVC: self) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NamiPurchaseManager.register { (purchases, state, error) in | |
if state == .purchased { | |
if let purchase = purchases.first { | |
NamiPurchaseManager.consumePurchasedSKU(skuID: purchase.skuID) | |
} | |
// Make sure Nami paywall is closed before we put up thank you message. | |
NamiPaywallManager.dismissNamiPaywallIfOpen(animated: true) { | |
let alertController = UIAlertController(title: "Thank You", message: "Thank you so much for your donation! We will work hard to continue to bring you great updates.", preferredStyle: .alert) | |
let okAction = UIAlertAction(title: "OK", style: .default) { alertAction in | |
self.dismiss(animated: true, completion:{}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"environment": "Sandbox", | |
"receipt": { | |
"receipt_type": "ProductionSandbox", | |
"adam_id": 0, | |
"app_item_id": 0, | |
"bundle_id": "com.namiml.NamiRadio", | |
"application_version": "25", | |
"download_id": 0, | |
"version_external_identifier": 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"status": 21100, | |
"is-retryable": 1, | |
"environment": "Sandbox", | |
"receipt": {}, | |
"latest_receipt": "", | |
"latest_receipt_info": [{}], | |
"pending_renewal_info": [{}], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
def billing_version = "3.0.0" | |
implementation "com.android.billingclient:billing:$billing_version" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
def billing_version = "3.0.0" | |
implementation "com.android.billingclient:billing-ktx:$billing_version" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"receipt": { | |
"receipt_type": "ProductionSandbox", | |
"adam_id": 0, | |
"app_item_id": 0, | |
"bundle_id": "com.namiml.NamiRadio", | |
"application_version": "25", | |
"download_id": 0, | |
"version_external_identifier": 0, | |
"receipt_creation_date": "2020-07-23 19:32:51 Etc/GMT", |