Posts

Sort by:
Post not yet marked as solved
18 Views

Mixed in-app purchase business cases

I have reviewed the App Store Review Guidelines and have some questions around when In-App Purchases are required. Our app is primarily used by members of a gym to purchase memberships for in-person fitness classes, as well as to register for upcoming classes. Our website offers all functionality and content offered within the app. As part a membership, users may gain access to digital content, such as nutrition plans or a selection of on-demand video content. This content is consumed outside of the app in the user's browser. And again, this content is secondary to the in-person classes. The guidelines state that physical services cannot use IAP, but it's not clear about cases when the user receives both physical and virtual services. Similar to the above, some gyms offer a mix of video and in-person classes under the same membership. These are one-to-many classes, so 3.1.3(d) would apply, but because the membership grants access to a mix of physical and virtual services, I'm not sure how what is allowed. Finally, in section 3.1.3 the guidelines state "Apps in this section cannot, within the app, encourage users to use a purchasing method other than in-app purchase." Does this mean in the case of selling physical services (3.1.3(e)) or person-to-person services (3.1.3(d)), we cannot direct the user to our website to complete their purchase? Thanks!
Asked
Post not yet marked as solved
6 Views

Is it possible to dynamically update the currency formatting of SwiftUI TextField?

I'd like to be able to dynamically update the format of a SwiftUI TextField based on a user's selection from a Picker, but what I've tried doesn't seem to be working. I have a TextField where the user enters an amount, and a Picker from which the user selects a currency, and I'd like the formatting of the TextField to match the Picker's currency selection. TextField has a format property (at least in macOS 12/iOS 15) which allows it to be formatted as a specified currency. That mostly works as expected for whatever currency I initially pass to it, but if I change the currency after the View loads the formatting doesn't change. That is despite passing it the same variable that I pass to the Picker's selected argument, and despite the fact that the View regularly updates when the TextField's value changes. Below is a simplified version of my code to illustrate the issue. The TextField's value will initially be formatted to show a localised representation of GBP £0.00. If you type “100” in the field it will update to format it as British pounds. All good. But if you change the currency from the Picker to, say, USD, or any other currency, the amount will continue to be formatted as GBP. For the avoidance of any doubt, I know from my actual code (though it can't be seen in this example) that the value of currency (that is being passed to the Picker and the TextField's format property) is changing based on the Picker selection. So that's not the issue. It's just that the TextField doesn't seem to be aware or care that it has changed. So it seems like whatever is passed to the TextField's format parameter on initialisation sticks forever and cannot be changed. But if I'm doing something wrong or there's a workaround I'd be really grateful for any pointers. PS: The issue is best illustrated on macOS, but iOS has the same issue only the formatting appears to change as expected when you first change the selected currency in the Picker, but then reverts once you edit the amount field. PPS: There's a separate issue relating to formatting EUR which I'll post about separately as it seems to be a separate issue. import SwiftUI struct ContentView: View { @State private var amount = Decimal() @State private var currency: Currency = .GBP     var body: some View { CurrencyAmount( title: "Some label", amount: $amount, currency: $currency)     } } struct CurrencyAmount: View { let title: String @Binding var amount: Decimal @Binding var currency: Currency let prompt: String = "" var body: some View { HStack { TextField( title, value: $amount, //FIXME: The currency code used in the format does not update when the user selects a different currency from the Picker. format: .currency(code: currency.rawValue), prompt: Text(prompt)) CurrencyPicker(selected: $currency) } } } struct CurrencyPicker: View { @Binding var selected: Currency var label = "Currency" var body: some View { Picker(selection: $selected,   label: Text(label) ) { ForEach(Currency.allCases) { code in Text(code.rawValue).tag(code) } } } } enum Currency: String, CaseIterable, Identifiable { case AUD, CAD, EUR, GBP, NZD, USD var id: String { self.rawValue } }
Asked
by @Nic.
Post not yet marked as solved
6 Views

The Default SwiftUI Core Data app is generating a Warning

I'm running Xcode v 13.2.1 in the iPhone 13 Pro Max simulator. I created a new SwiftUI Core Data project with Xcode and when I run it, it generates an Error/Warning. I have not changed any of the code that was generated. The name of the test app is "DELETE_ME_NOW_ALSO" The run-time error/warning says: 2022-01-17 15:19:20.498339-0700 DELETE_ME_NOW_ALSO[85036:7758906] [error] warning:  View context accessed for persistent container DELETE_ME_NOW_ALSO with no stores loaded Is there a way I can fix this error/warning? Is this a bug in Xcode? Thanks -Bill
Asked
by BillHause.
Post not yet marked as solved
8 Views

NSTableView full reload works, partial reload doesn't

I'm using an NSTableView (and DifferenceKit, but that's likely irrelevant). This is all programmatic, no Interface Builder at all. I'd previously implemented only tableView(_:objectValueFor:row) in order to get values into my table. At that point I could apply full and partial reloads and everything worked fine. Now I've added an implementation of tableView(_:viewFor:row:) in order to format some columns differently, and it's affected reloading. A full reloadData() still works, but a call to reloadData(forRowIndexes:columnIndexes) doesn't call either my datasource or delegate methods; the reload seems to simply disappear. I also tried removing the datasource method and running only with tableView(_:viewFor:row:) but no dice. A partial reload still doesn't call the delegate method. Has anyone come across this? Is there a nuance of NSTableView I'm missing? My (truncated) code: init() { ... tableView.dataSource = self tableView.delegate = self myColumnDefinitions.forEach { tableView.addTableColumn($0) } } func tableView( _ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int ) -> Any? { ... return someStringProvider(column, row) } func tableView( _ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int ) -> NSView? { ... let identifier = someDerivedValue(column) if let existingView = tableView.makeView(withIdentifier: identifier, owner: self) as? NSTableCellView { existingView.textField?.stringValue = someStringProvider(column, row) return existingView } let textField = NSTextField() ... textField.stringValue = someStringProvider(column, row) let view = NSTableCellView() view.identifier = identifier view.addSubview(textField) view.textField = textField view.addConstraints([ ... (pin textField to view) ]) textField.bind( .value, to: view, withKeyPath: "objectValue", options: nil ) return view }
Asked
by ibsh.
Post not yet marked as solved
11 Views

Embedded WindowController inside XPC module

Is it possible we embed a windowcontroller inside an XPC module and pop/hide the window as demanded? right now the window cannot pop due to not in main thread. What is the better alternative under the condition that xpc cannot modify the caller for permission.
Asked
by stang.
Post not yet marked as solved
22 Views

How can a user be logged into iCloud (iCloud Available), but still Not Authenticated?

I'm running Xcode 12.4, testing on iOS 13 and 14. How can a user be logged in/iCloud Available, but still Not Authenticated? When I fetch a record, the CKErrorCode is NotAuthenticated and it prints Couldn't get an authentication token let predicate = NSPredicate(format: "id == %@", id) let query = CKQuery(recordType: RecordType.Media, predicate: predicate) CKContainer.default().publicCloudDatabase.perform(query, inZoneWith: nil) { (ckRecords, error) in if let err = error { let code = err._code // error code is 9 - case NotAuthenticated /* Not authenticated (writing without being logged in, no user record) */ return } // ... } But when I check to see if the user is logged in, I use the code below, and in both situations it prints iCloud Available 1- if FileManager.default.ubiquityIdentityToken != nil { print("iCloud Available") } else { print("iCloud Unavailable") } 2- CKContainer.default().accountStatus { (accountStatus, error) in switch accountStatus { case .available: print("iCloud Available") case .noAccount: print("No iCloud account") case .restricted: print("iCloud restricted") case .couldNotDetermine: print("Unable to determine iCloud status") @unknown default: print("Unable to determine iCloud status") } } FYI, this seems to happen in this order. 1- I'm home on wiFi, logged into iCloud, everything works fine. 2- I leave my house, switch to a hot spot, I'm still logged into iCloud and everything works fine 3- I come back into my house, switch back to wiFi, of course I'm still logged in, then the above issue occurs. It's as if it wants me to log in again even though I'm already logged in and it says iCloud Available. This issue is happening on both the real device and the simulator. UPDATE I just found this post, it seems lots of devs are having this same problem
Asked
by lance145.
Post not yet marked as solved
12 Views

Xcode cloud

Hey guys I’m getting an iMac for the first time will this iMac be compatible with Xcode Cloud it will be a late 2014 model?
Asked
Post not yet marked as solved
11 Views

Apple pay - Showing shipping methods in an array

We have had this issue for nearly 1 year now - and any help would be greatly appreciated. When a customer arrives at the cart they see the Apple pay option and various shipping methods. Orders over £25 qualify for free 48 hrs delivery and orders over £50 its 24 hrs shipping option. These are manual shipping methods we have in place and set up for all UK customers. Our issue is that we also have calculated rates for UPS via Shipstation and easypost and for some reason these appear 1st (Due to the way the ecom platform core code functions) in the apple pay prompt and it auto selects the 1st option and it is a UPS at around £10. As it is an express payment method our customers are maybe in a hurry and they do not notice this and the fact that the shipping method needs to be manually selected even if your order qualifies for free shipping. We are aware that this causes frustration for our customers and a very time consuming process for us as we refund the difference many times a week. Our developers are stuck and provided the following notes - I have implemented this sorting using different approaches, but it looks like changing the order of the shipping options is causing an issue with apple pay. I can't properly test the apple pay button. I can reorder the shipping options on the cart page, this seems to work for the regular checkout but it creates a problem with apple pay. I've tried multiple ways to reorder the list here, but it breaks apple pay. Re the stripe code that the client mentioned - I could be wrong here - but I think shipping options never actually get passed to stripe - only the cart total and the cart items - that's it - null variable for shipping options. There is a changeShippingOptions function in the Stripe code, but i've tested updating the address and shipping options during the cart/checkout process but that part of the code doesn't get called. Regarding the last point raised, all the shipping methods available do show in the apple pay prompt as they would in the regular checkout, so I am not sure what they mean by this. This is in contrast to what stripe have advised - Apologies for the delay in our response on this one, but the shipping options are sequential in the sense that they display in order of how they were passed with the code. Changing your code to include the "free" option first will then make that the default when a customer enters your payment form: shippingOptions: [ // The first shipping option in this list appears as the default // option in the browser payment interface. { ^^ the code above is an example of this. A huge show of appreciation to anyone that can provide any advice or suggestions on this. https://www.waterstreetgallery.co.uk/ This is the stripe script that enables Apple pay In particular the line - var firstShippingOption = shippingOptions[0]; - I think is what is pulling in the options, we just need to tell it to prioritise Some methods over others. An alteration to the code below was written by our developers that showed the shipping methods in an array but when they replaced it the Apple pay would not complete and after about 25 seconds payment not complete. Any suggestions would be much appreciated 😀 `
Asked
Post not yet marked as solved
12 Views

hideDock Presentation option and multi monitor Macs

Hello: I'm having an issue with the .hideDock and multi monitor Macs. Basically, the dock is still accessible by dragging the mouse to the bottom of the secondary monitor. I do         NSApp.presentationOptions = self.lockDownPresentationOptions, where lockDownPresentationOptions is:     var lockDownPresentationOptions: NSApplication.PresentationOptions = [         .hideDock,         .hideMenuBar, ... and a bunch others] I thought it was related to the Full Screen attribute in the window inspector, I tried all of them with .hideDock and was always able to display the dock. Can someone point me to a URL that will show men how to fix this error, so that the dock will not show up on a Mac with any number of monitors? Thanks in advance for your time John
Asked
Post not yet marked as solved
20 Views

WatchOS Development File Debugger

I have been working on a watchOS app that implements file utilization and would like to download and view these files quickly to my laptop. Does a debugger or shell console program equivalent to android debug bridge for android watches exist for the apple watch? Ideally, I would like to connect to the OS of the watch to copy/download/view files saved by the watch. I notice that iOS Development Bridge exists; will this program be capable of local host connection to the watch? Are there other programs that perform these actions?
Asked
by jlawle.
Post not yet marked as solved
15 Views

Animation inside CollectionView Cell not running

I have button inside a CollectionViewCell and when tapped I want to run an animation. The animation doesn't run and I'm not sure why. Inside the Cell class @IBAction func hoursExpandBtnTapped(_ sender: Any) { UIView.animate(withDuration: 3, delay: 0, options: .curveLinear) { [self] in addressLbl.frame = CGRect(x: addressLbl.frame.minX, y: addressLbl.frame.minY, width: 20, height: addressLbl.frame.height)             } completion: { _ in             }     }
Asked
Post marked as solved
31 Views

RealityKit or ARKit? Which is right for me?

I want to create a feature where a user can stick images down my app onto their walls. I want to persist their placements between launches and use pinching a panning gestures to manipulate the images. I see lots of articles going back a few years that show how to do this in ARKit, but going through WWDC videos I’m seeing a trend toward RealityKit, and am starting to think that’s the “right” thing to learn. Is RealityKit to most up to date secret sauce? Is there a sample project like this one but using RealityKit? https://developer.apple.com/documentation/arkit/environmental_analysis/placing_objects_and_handling_3d_interaction
Asked
by J0hn.
Post not yet marked as solved
12 Views

How to get icloud calendar freebusy information?

Hello! I'm trying to figure out how to get information about a user's busyness. My request to the outbox returns a 403 error, although any other request with the same access data is executed correctly. curl --location --request POST 'https://p48-caldav.icloud.com/userID/calendars/outbox/' \ --header 'Content-Type: text/calendar; charset="utf-8"' \ --header 'Authorization: Basic xxxx' \ --data-raw 'BEGIN:VCALENDAR VERSION:2.0 METHOD:REQUEST BEGIN:VFREEBUSY UID:a4ee6514 DTSTAMP:20220113T165506Z DTSTART;VALUE=DATE:20220113T165506Z DTEND;VALUE=DATE:20220113T165506Z ORGANIZER;CN="OM":mailto:mymail@icloud.com ATTENDEE;CN="OM":mailto:mymail@icloud.com END:VFREEBUSY END:VCALENDAR ' I also tried the report free-busy-query request, it returns a 400 error, I took it from https://datatracker.ietf.org/doc/html/rfc4791#section-7.10.1. curl --location --request REPORT 'https://p48-caldav.icloud.com/userID/calendars/work/' \ --header 'Depth: 1' \ --header 'Content-Type: application/xml; charset="utf-8"' \ --header 'Authorization: Basic xxxx' \ --data-raw '<?xml version="1.0" encoding="utf-8" ?> <C:free-busy-query xmlns:C="urn:ietf:params:xml:ns:caldav"> <C:time-range start="20220101T140000Z" end="20220129T220000Z"/> </C:free-busy-query>' I would love to hear your advice and suggestions.
Asked
by kingol6.
Post not yet marked as solved
15 Views

Migrating Sign in with Apple from WebView to Swift

Our app currently uses login with Apple ID inside a webview and due to some AppStore updates, we are now required to use the native Swift implementation. We generate tokens in the web version according to this documentation https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens, passing the client_id and response_type as code id_token in the request because the code and id_token in the response are used on our backend to complete the user's registration procedure (along with the optional name/email). However, when following the guide https://developer.apple.com/documentation/sign_in_with_apple/implementing_user_authentication_with_sign_in_with_apple, we only have the userIdentifier, fullName and email as a response after logging in with Apple. The login works on Apple side but we don't have the necessary info we need. Is there any Swift method or API from Apple's side that would allow me to retrieve a code and id_token (JWT) in conjunction with the userIdentifier? Or should the login procedure be a totally different flow from backend's perspective?
Asked
Post not yet marked as solved
20 Views

Problem with Sandbox Testers

I try adding people as Sandbox Testers to my App, but Apple keeps saying that they already exist on the team, even though they're not. It always show "A user with this email address already exists on the team" It keeps happening with every address I try.
Asked