Post

Replies

Boosts

Views

Activity

offer code for auto-renew subscription
We would like to provide auto-renew subscription in our app and we have these questions: when provide offer codes for auto-renewable subscriptions using presentCodeRedemptionSheet() to let the user enter redeem code is it ok we put the redeem code in clipboard so that user just need to paste to enter ? we should present a screen that let user to choose which duration to subscribe, so that we can provide proper redeem code for user to use in system redeem sheet (call out by presentCodeRedemptionSheet()), am I right ? if user apply the redeem code, the system redeem sheet will emit the resulting transaction as if purchase the corresponding subscription by in-app purchase, am I right ? P.S. As we can't test redeem an offer code for an auto-renewable subscription in sandbox, so we don't know the exact flow of it and need to ask in forum.
4
0
284
Aug ’24
auto-renew subscription on introductory offers and offer code
We would like to provide auto-renew subscription in our app and we have these questions: when provide introductory offers: Free Trial for auto-renewable subscriptions, is user no need to pay if choose to stop the auto-renew during free trial period ? when provide offer codes for auto-renewable subscriptions using presentCodeRedemptionSheet() to let the user enter redeem code is it ok we put the redeem code in clipboard so that user just need to paste to enter ? seems the system redeem sheet will emit the resulting transaction as if purchase the corresponding subscription in-app purchase in case user apply the redeem code, am I right ? seems the system redeem sheet won't show the offer details e.g. discounted price and original price in case the offer is pay up front, so does it means our app should present these details before present the system redeem sheet ?
2
0
321
Jul ’24
Invalid bundle structure when submit to AppStore Connect as Frameworks contain .a file
XCode Version: 15.0 (15A240d) macOS version: 13.6 (22G120) I have an OpenSSL.xcframeworks (headers and .a included for different platforms e.g. iOS, iOS simulator on arm64/x86) included in my xcode project folder: Frameworks. It run without issues on iPhone device or iPhone simulator, however, when submit to AppStore Connect, it fail with Upload failed with errors: "Invalid bundle structure, ???.a file is in Frameworks directory, but the Swift runtime libraries are the only files permitted in that directory" How to solve the issue ?
4
0
1.5k
Oct ’23
watchOS 10. GPS locked to Watch - Developer has no choice to select phone's GPS?
Under watchOS10, seems like Apple Watch always uses watch GPS and cannot use iPhone's GPS, previously developer somehow can use either Apple Watch or iPhone's GPS, when iPhone is around the Watch and if developer choose to use iPhone's GPS, then iPhone's GPS will be used in watch app. However, watchOS10 behavior is different where Watch's GPS is always used. Is it the new behavior for watchOS10 ?
0
0
336
Sep ’23
How to use CMBatchedSensorManager
"for try await dataArray in bsm.deviceMotionUpdates()" generate error: Error Domain=CMErrorDomain Code=109 "(null)" Environment iOS 17.0 (21A5277j) watchOS 10.0 (21R5295g) XCode 15.0 beta 4 (15A5195m) Mac Studio 2022, macOS 13.4.1 (22F82) Details I create a swift project with code: File 1: let healthStore = HKHealthStore() var workoutSession: HKWorkoutSession! func workoutSession(_ workoutSession: HKWorkoutSession, didChangeTo toState: HKWorkoutSessionState, from fromState: HKWorkoutSessionState, date: Date) { } func workoutSession(_ workoutSession: HKWorkoutSession, didFailWithError error: Error) { } func requestAuthorization() { // The quantity type to write to the health store. let typesToShare: Set = [ HKQuantityType.workoutType() ] // The quantity types to read from the health store. let typesToRead: Set = [ HKQuantityType.quantityType(forIdentifier: .heartRate)!, HKQuantityType.quantityType(forIdentifier: .activeEnergyBurned)!, HKQuantityType.quantityType(forIdentifier: .distanceWalkingRunning)! ] // Request authorization for those quantity types healthStore.requestAuthorization(toShare: typesToShare, read: typesToRead) { success, error in // Handle error. } } // before call startWatch(), will request authorization to access Healthkit func startWatch(_ startWatchFor:Int) -> MotionManager? { let configuration = HKWorkoutConfiguration() let motionMgr: MotionManager? configuration.activityType = .golf configuration.locationType = .outdoor do { workoutSession = try HKWorkoutSession(healthStore: healthStore, configuration: configuration) workoutSession.startActivity(with: Date()) } catch { // Handle any exceptions. return nil } workoutSession.delegate = self ... // in turn, a func startUpdates() in another swift file will be called. } File 2: var batchedSensorManager: Any? @available(watchOSApplicationExtension 6.0.0, *) func batchedSensorUpdates() async { if #available(watchOSApplicationExtension 10.0, *), let bsm = batchedSensorManager as? CMBatchedSensorManager { bsm.startDeviceMotionUpdates() do { for try await dataArray in bsm.deviceMotionUpdates() { if !processDMEntry { break } ... // process data } } catch let error as NSError { print("batchedSensorManager.deviceMotionUpdates() fail", error.description) } } }
1
0
792
Jul ’23
StoreKit testing in XCode
I'm trying to use StoreKit testing in XCode, but not work. It go through all steps in iPhone side on the purchase workflow e.g. prompt that telling me the purchase won't charge me as it is for testing only (purchase a consumable item through our app) but it fail finally. The problem is we follow Apple workflow: iphone post the receipt to our server and our server will send the receipt to https://sandbox.itunes.apple.com/verifyReceipt for validation, however, we receives a non-zero status value from apple (21002). Any idea what we missing in setup ?
1
0
865
Jun ’23