Posts

Post marked as solved
2 Replies
257 Views
My app listens for transactions using: for await result in Transaction.updates { // check verification and process Transaction } The result coming from these updates has a jwsRepresentation field, which when decoded server-side reveals the price the user paid, discounted in the case of a custom offer code. How can I get this value without a server roundtrip? Transaction does not have price field, and the subscription product's price does not seem to include custom offer code pricing.
Posted
by j_ptron.
Last updated
.
Post not yet marked as solved
0 Replies
250 Views
Slightly different than this question, I'm looking to build a single vertically scrolling collection view with three sections. In portrait orientation, Sections 0 and 1 should scroll orthogonally and all sections should be vertically arranged. This is easily achieved with UICollectionViewCompositionalLayout. In landscape orientation, Section 0 and Section 1 should be laid out side by side, each 50% of the width of the collection view. Section 0 and Section 1 should scroll orthogonally (horizontally). Section 2 will be laid out below them. (Mock image shown below) Is this layout possible with a single collection view and UICollectionViewCompositionalLayout? If not, is this layout possible with a single collection view and a custom layout? I'd hate to have to throw three separate collection views into a scroll view if there is a simpler implementation.
Posted
by j_ptron.
Last updated
.
Post not yet marked as solved
0 Replies
600 Views
I have an app that schedules a handful of local notifications with trigger dates 1 to 4 weeks in the future. Each notification has a single image attachment with a JPEG sourced from the app's main bundle. In development builds via Xcode, or builds via TestFlight, the notifications do appear in the notification center and they do display an image. However, in App Store builds, the notifications appear, but they do not display an image. I have ruled out the following: Images may not be included in the bundle Images may be too large or unsupported (they are ~50KB 480x480 JPEGs, and the docs say validation happens at scheduling time) The iOS device may have no free disk space I'm leaning towards either: Differences in file protection in App Store builds (though the docs say the app process must have access to the image and images in the bundle are copied) The notifications are scheduled too far in the future and if the image is copied from the bundle to temporary storage, it gets wiped before display Does anyone have any insight? Sample code to schedule the notification below: let dateComponents = // Some date in the future let content = UNMutableNotificationContent() content.title = // Some title string content.body = // Some body string content.userInfo = // Some app-specific dict if let path = Bundle.main.path(forResource: "my-image-file-name", ofType: "jpg") { let url = URL(fileURLWithPath: path) do { let imageAttachment = try UNNotificationAttachment(identifier: "", url: url) // Note the empty string identifier - the docs say one will be provided. content.attachments = [imageAttachment] } catch { print("Failed to add image to local notification") } } let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false) let request = UNNotificationRequest( identifier: "my-notification-id-here", content: content, trigger: trigger) UNUserNotificationCenter.current().add(request) { error in if let error = error { print("Failed to add notification request: \(error)") } }
Posted
by j_ptron.
Last updated
.