Post not yet marked as solved
let hotspotConfig = NEHotspotConfiguration(ssid: "SSID", passphrase: "PASSWORD", isWEP: false)
hotspotConfig.hidden = true
let hotspotMgr = NEHotspotConfigurationManager.shared
hotspotMgr.apply(hotspotConfig) { error in
}
This works on the watchos before, but does not work on the latest watchos 10.2, if given incorrect password, the error returns .invalidWPAPassphrase, it's right. However, when given the correct password, the error returns .unknown and no wifi connect request alert shows on the watch.
The code works ok on the iPhone, but not works on the watchos.
Post not yet marked as solved
Any way to make launch screen work with dark mode but also compatible with ealier iOS version. When I use named color with Assets.xcassets, however it can not compatible with iOS before 11, so how to?
Post not yet marked as solved
let paymentRequest:PKPaymentRequest = PKPaymentRequest()
let label = selectedTier == 0 ? "Tier 0 Membership" : "Tier 1 Membership"
let amount = selectedTier == 0 ? NSDecimalNumber(value: 99.0) : NSDecimalNumber(value: 189.0)
let summary1 = PKPaymentSummaryItem(label: label, amount: amount, type: .final)
let total = PKPaymentSummaryItem(label: "total", amount: amount, type: .final)
paymentRequest.paymentSummaryItems = [summary1, total]
paymentRequest.supportedNetworks = [.visa, .masterCard, .amex, .discover]
paymentRequest.merchantCapabilities = [.capability3DS, .capabilityEMV, .capabilityDebit, .capabilityCredit]
paymentRequest.currencyCode = "USD"
paymentRequest.countryCode = "US"
paymentRequest.merchantIdentifier = APPLEPAY_MERCHANTID
paymentRequest.applicationData = "ID:123456" .data(using: .utf8)
guard let authorizationVC:PKPaymentAuthorizationViewController = PKPaymentAuthorizationViewController(paymentRequest: paymentRequest) else{
return
}
authorizationVC.delegate = self
let delay = DispatchTime.now() + .milliseconds(300)
DispatchQueue.main.asyncAfter(deadline: delay) {
self.present(authorizationVC, animated: true, completion: nil)
}As title post, When I intergrated the Apple Pay, I got some trouble and can not continue.func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void)the delegate didAuthorizePayment never callback, and when I entered passcode to confirm the payment, it always shows that "Payment Not Completed". And I got no error, so what can I go on ...