()
| 7 | * @returns {Promise<void>} |
| 8 | */ |
| 9 | export default function removeAds() { |
| 10 | return new Promise((resolve, reject) => { |
| 11 | iap.getProducts(["acode_pro_new"], (products) => { |
| 12 | const [product] = products; |
| 13 | |
| 14 | iap.setPurchaseUpdatedListener(...purchaseListener(onpurchase, reject)); |
| 15 | |
| 16 | iap.purchase( |
| 17 | product.productId, |
| 18 | (code) => { |
| 19 | // ignore |
| 20 | }, |
| 21 | (err) => { |
| 22 | alert(strings.error, err); |
| 23 | }, |
| 24 | ); |
| 25 | }); |
| 26 | |
| 27 | function onpurchase() { |
| 28 | resolve(null); |
| 29 | hideAd(true); |
| 30 | // For caching, later verified so no need to worry about |
| 31 | localStorage.setItem("acode_pro", "true"); |
| 32 | config.HAS_PRO = true; |
| 33 | toast(strings["thank you :)"]); |
| 34 | } |
| 35 | }); |
| 36 | } |
no test coverage detected