Post

Replies

Boosts

Views

Activity

Unexpected App Store Server Notification offerIdentifier
My server receives App Store Server Notification v2 notifications. Recently, it has been receiving notifications for offer codes under offers that have been deactivated. The custom code value may be the same in the active offer as the deactivated offer. When a user redeems the custom offer code for a deactivated offer, the notification payload's offerIdentifier value now contains the UUID associated with that offer in the URL in App Store Connect (like https://appstoreconnect.apple.com/apps/my-app-id/distribution/subscriptions/my-subscription-id/pricing/offer-codes/offer-uuid) The notification payload contains: {"offerIdentifier": "offer-uuid"} instead of {"offerIdentifier": "<My offer identifier from App Store Connect>"} Is it possible for a deactivated offer to be redeemed? If not, is this a known issue? We need the actual offer identifier to understand which offers users are redeeming. Is this replacement with a UUID a known issue?
2
0
226
Oct ’24
StoreKit2 - How to get actual price paid for subscription via Transaction?
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.
2
0
522
Mar ’24
UIViewCompositionalLayout side-by-side orthogonal sections
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.
0
0
385
Nov ’23
Local notification image attachment not displayed for App Store builds
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)") } }
1
1
994
Nov ’23