Post

Replies

Boosts

Views

Activity

When testing promotional offer purchase in the sandbox environment, an error occurred.
Testing Promotional offer purchase in sandbox environment, error reported below: Purchase did not return a transaction: Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={NSUnderlyingError=0x282752dc0 {Error Domain=AMSErrorDomain Code=301 "Invalid Status Code" UserInfo={NSLocalizedDescription=Invalid Status Code, AMSURL=https://sandbox.itunes.apple.com/WebObjects/MZBuy.woa/wa/inAppBuy?REDACTED, AMSStatusCode=500, NSLocalizedFailureReason=The response has an invalid status code}}, storefront-country-code=JPN, client-environment-type=Sandbox} The steps are as follows: Receive the nonce, signature, and timestamp from our app server. However, the error occurred when I initiated a purchase request. let result = try await product.purchase(options:[.promotionalOffer(offerID: offerID, keyID: keyID, nonce: nonce, signature: signature, timestamp:timestamp)]) switch result { case .success(let verificationResult): switch verificationResult { case .verified(let transaction): return .success(transaction) case .unverified(let transaction, _): return .unverified(transaction) } case .userCancelled: return .userCancelled case .pending: return .pending @unknown default: return .other(detail: "unknown error") } Is it because promotional offers cannot be tested in the sandbox environment?
0
2
507
Aug ’23
How can independent App make URL session requests through iPhone Proxy?
I have tried URL session requests in the following three ways: Proxy through iPhone: Request failure "ErrorDomain =NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." Connecting to a known network: Request successful Connecting using cellular data: Request successful These tests were all conducted on the Apple Watch Series 6 watchOS 9.4. Does "watch-only App "not support URL session request through iPhone Proxy? Here is my current URL session request handler: let config = URLSessionConfiguration.ephemeral config.waitsForConnectivity = true config.requestCachePolicy = .reloadIgnoringLocalCacheData config.urlCache = nil config.allowsCellularAccess = true config.allowsConstrainedNetworkAccess = true config.allowsExpensiveNetworkAccess = true let session = URLSession(configuration: config, delegate: nil, delegateQueue: .main) let task = session.dataTask(with: url) { (data, response, error) in guard error == nil else { print(error!) self.error = "\(error!)" return } } task.resume() Info.plist <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> <key>NSAllowsLocalNetworking</key> <true/> </dict>
1
1
718
May ’23
Networking error on Independent Apple Watch Apps
I created a project with "watch-only App" template in XCode, running on Apple Watch Series 6, the console output network error: ErrorDomain =NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." However, It works fine on the Apple watch Ultra. I try the following: I added the following code, but doesn't work. configuration.allowsCellularAccess = true configuration.waitsForConnectivity = true Tried using the Alamofire framework, but it didn't work. import Alamofire var body: some View { VStack { Text("hello world") .task { URLCache.shared.removeAllCachedResponses() AF.request("https://api.thecatapi.com/v1/images/search?limit=1").response { response in print( response) } } } } Turn off the Wi-Fi and Bluetooth of the mobile phone. The Watch Series 6 can successfully request through Wi-Fi. But that's not an option. I can't ask my users to turn off Wi-Fi and Bluetooth before using my app. Here is my code: VStack { Text("hello world") } .onAppear { guard let url = URL(string: "https://api.thecatapi.com/v1/images/search?limit=1") else { print("Invalid URL") self.error = "Invalid URL" return } let dataTask = URLSession.shared.dataTask(with: url) {(data, response, error) in guard error == nil else { print(error) return } print(data) } dataTask.resume() } What can I do? My Apple Watch Series 6 version is watchOS 9.0. I noticed when lauching my app first time on the Apple Watch Series 6. It doesn't ask for 'allow "Settings" to use wireless data’.But I was asked about it on the Apple Watch Ultra.
3
1
1.2k
May ’23