我的控制器上有一个按钮,您可以购买完整版。
我将方法称为<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<title>Beach Photo </title>
</head>
<body>
<h1>Photo of Beach </h1>
<h4>Click button below to see a photo of a beach</h4>
<br>
<div class="container">
<form id="show">
<button type="submit" class="btn btn-primary btn-margin">Show</button>
<br>
</form>
<br>
<div id="img">
</div>
<div class="image1">
<img src="https://kongdeetourthai.com/wp-content/uploads/2018/06/apple-icon.png" alt="photo of beach" id="img1">
<img src="https://freeiconshop.com/wp-content/uploads/edd/google-flat.png" alt="photo of lake" id="img2">
</div>
</div>
</body>
</html>
此方法将其添加到paymentQueue,然后创建交易。
在我的控制器上,我有一个IAPService.shared.purchase(product: .noAds)
,在页面加载时,我检查了它们是否已购买(如果是),设置为true。
如何返回交易状态,然后将其设置为true,或者如果成功重新加载var didPurchase: Bool = false
,则将其设置为触发器?我需要安置观察员或其他什么东西吗?