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.
Post
Replies
Boosts
Views
Activity
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 ?
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 ?
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 ?
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 ?
in https://developer.apple.com/passkeys/ "What’s new", it mentions "Password manager apps can save and offer passkeys on iOS, iPadOS, and macOS." Does it means Apple provide api for developer to do that?
"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)
}
}
}
I run a Xcode project (designed for ipad) to M1 Mac and want to know how to delete the app like I did on an iPhone device so that next time I run the project on M1 Mac again will like a new install. (without any saved values in usersdefault)
Due to COVID-19 pandemic, I need to work from home.
I'm using remote desktop to access my office iMac and ad hoc distribute iOS app using web deploy on my iPhone. However, is it possible to get the debug console output messages ? (those messages are printed out from my iOS app, before they are viewed in XCode's debug console)