Posts

Post not yet marked as solved
1 Replies
451 Views
Need some help here. I've got an iPhone 11 PM on 16.6.1 and I'm trying to test Family Sharing IAPs. However, I can't seem to test via the Sandbox environment (which I need to validate receipt handling for Family Sharing). The app is running locally on my device and was built straight from Xcode. When I tap to make a purchase in my app (which uses StoreKit2, if that makes any difference) a sheet pops up with a purchase button which, when tapped, immediately completes and I get the following dialog box: "Your purchase was successful" [Environment: Xcode] How do I get my app to use the Sandbox environment? All documentation suggestions when I tap my purchase button I should simply be presented with a login modal and then, after the purchase has completed, be able to see my Sandbox credentials under Settings -> App Store. At the moment no dialog is presented (the purchase completes immediately) and the entire "Sandbox Account" section is missing from Settings -> App Store. Any help will be greatly appreciated!
Posted Last updated
.
Post not yet marked as solved
0 Replies
299 Views
I currently have an iOS app on the App Store which requires an up-front payment to buy and download. For my upcoming release I would like to change the app to free to download but with one non-consumable IAP to fully unlock. Without the IAP the number of entries you can add is limited but otherwise the app is fully-functional, in effect working as trial/demo software. For users who previously purchased the app they will not need to purchase the IAP (which will be priced the same). From a technical perspective this is tested and working within the app using StoreKit 2 APIs. However, as the app is currently paid, what I would like to do is make it free AND make my IAP available when I publish the next release but it's not clear to me if this is possible/will happen automatically. Within App Store Connect I can only see the ability to schedule a price change by date and not with a new release, which suggests they will happen independently of each other. Is what I am trying to achieve possible? The only other option I have thought is to release the new version without a price change, and once it's updated on the App Store then change the pricing model to free. However, this would be less than ideal as, for a limited time, it would technically require two purchases to unlock. If anyone has navigated this issue and has any tips/advice I'd be most grateful.
Posted Last updated
.
Post not yet marked as solved
1 Replies
590 Views
Maybe I'm going about this completely the wrong way but I've got two stores loaded in my app: private and shared. I've got zone-wide sharing enabled and I can update records that exist in the shared database (on the participant device), and see updates sync when changed by the owner. However, is it possible to save a new object specifically to the shared database as the participant? If I create a new object in my managed object context it saves it to the private database. Can provide code if needed but it's more conceptual at this stage.
Posted Last updated
.
Post not yet marked as solved
1 Replies
440 Views
I've built an app and got it working nicely with CoreData, and now I want to integrate it with CloudKit. I have made some minor changes to my code (namely updating NSPersistentContainer to NSPersistentCloudKitContainer and CloudKit works - I can see records appearing in the iCloud dashboard and I can modify records from the iCloud dashboard and the changes reflect on my device. Great. However, if I disable iCloud syncing via Settings on my device (without force-quitting my app) I notice a couple of things: When switching back to my app if I try and edit an entity I sometimes get an app crash If I quit and reload the app all my data has disappeared from my device (it still remains in iCloud). Is this expected behaviour? Ideally, what I would like, is that the data persists locally if a user has added records but then later decides to disable iCloud syncing on the app. Here's my code in case I've done anything funky with the implantation. It feels pretty simple, but maybe that's the problem. CoreDataManager.swift: class CoreDataManager { static let shared = CoreDataManager() lazy var persistentContainer: NSPersistentCloudKitContainer = { setupPersistentContainer() }() private func setupPersistentContainer() -> NSPersistentCloudKitContainer { print("setup") let container = NSPersistentCloudKitContainer(name: "TestApp") guard let storeDescription = container.persistentStoreDescriptions.first else { fatalError("Could not load store description.") } storeDescription.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey) storeDescription.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey) container.loadPersistentStores { (_, error) in if let error = error as NSError? { fatalError("Unresolved error when loading CoreData persistent stores: \(error), \(error.userInfo)") } } container.viewContext.automaticallyMergesChangesFromParent = true container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy return container } } The CoreDataManager class is then called from my main App.swift file when assigning the MOC: @main struct Main: App { // // MARK: Properties // @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate // CoreData context let moc = CoreDataManager.shared.persistentContainer.viewContext // // MARK: Initialisation // var body: some Scene { WindowGroup { Test() .environment(\.managedObjectContext, moc) } } } And finally the Test.swift (as a very basic example) struct Test: View { @FetchRequest(sortDescriptors: []) var people: FetchedResults<Person> var body: some View { List(people) { person in Text(person.name ?? "Unknown") } } } Any sage advice would be welcome as I'm tearing my hair out over this. Is my approach even correct/what's the expected behaviour here?
Posted Last updated
.