Hi,
My app has an IAP and the view that let user to purchase is simply a ProductView. The purchase flow should be handled by the ProductView itself. I have tested the app with xcode storekit configuration, xcode run with sandbox account and also TestFlight environment as well. The purchase is triggered and the app feature is unlocked after purchase. However, I keep getting app review team feedback with the following problem:
Bug description: the purchase button is greyed out after we tapped on it, however, there's no purchase flow popped up
I have tried multiple things. Building with xcode cloud, removing the storekit configuration from the build scheme. But none can get the app review team to get through the problem.
The IAP is not available in certain region. In that case, the app will show a message. However, the app review attached an screenshot which shows the product view.
The view that allow users to purchase
if let product = store.products.first(where: { $0.id == "com.xxx.xxxxxxx" }) {
// If the product is available, show the ProductView
ProductView(id: product.id)
.productViewStyle(.compact)
} else {
// If the product is not available, show a message
Text("In-app purchase is not available in your region.")
}
The store class
@Published private(set) var products: [Product] = []
...
init() {
//To handle the parental approval flow
getUpdateTransaction()
}
func getUpdateTransaction() {
updates = Task {
for await update in StoreKit.Transaction.updates {
if let transaction = try? update.payloadValue {
await fetchActiveTransactions()
await transaction.finish()
}
}
}
}
Does anyone what can go wrong with ProductView? As this is part of the StoreKit API, I don't know what can go wrong. At least the purchase flow should be covered by it.
Also, is sandbox and TestFlight a good way to test IAP?
Thanks!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi, I am trying to detect if all the screen are in fullscreen mode.
The current approach is to get all windows' information from CGWindowListCopyWindowInfo and then compare the frame and coordinate with the frame of NSScreen.screens.
However, there is a problem, the y position of the window seems to be relative to the screen. As it is not absolute position, I cannot compare it with the coordinate of the screen.
Does anyone know if there are other information that I can use? Or is there a way to retrieve the absolute position or screen ID from the GCWIndow object?
To get menubar size, we can call.
let menuBarHeight = NSStatusBar.system.thickness
That is returning 24 and it is the same as my external screen. I did command + shift + 5 and use the screen capture tool to rougly measure the size of menubar. It is roughly 24px.
However, for my macbook pro 14 inches m2 pro. The menubar seem thicker because of the webcam. Is there a way to find out the size in Swift?
Hi! My app has a free feature and another feature require in-app-purchase to unlock.
I am not listing the app in EU region due to digital service act. It is not a good idea to publish all my personal information on appstore.
I just wonder if it is possible to still list my app on EU appstore but not the in-app-purchase. It will be great if the free feature still available to EU users.
There will be a purchase button created using SwiftUI product view. In this case, users in EU will be very confused because the in-app-purchase will not be located.
Not really sure if apple will allow my app to be listed and the in-app-purchase product view would be causing confusion to user. If anyone got any suggestion, please let me know!
Hi,
I am working on an agent app.
The app has a menubarextra.
var body: some Scene {
MenuBarExtra(
"menubarextra", systemImage: "star")
{
Button("Item 1") {
}
Button("Item 2") {
}
Button("Item 3") {
}
}
}
I am going to write xctest to click on the icon i created and want to click on the menu next.
func testExample() throws {
// UI tests must launch the application that they test.
let app = XCUIApplication()
app.launch()
let menuBarsQuery = XCUIApplication().menuBars
let favouriteStatusItem = menuBarsQuery.statusItems["Favourite"]
favouriteStatusItem.click()
menuBarsQuery.menuItems["Item 1"].click()
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
There is a small problem. When the app is not a agent app, the app will start with with its own menu bar. If i am currently on fullscreen, it will swap to the desktop and the menubar will be showing the app's menu bar. In this case, I can see the menubarextra. The test will pass then.
When it is in agent app, the above behaviour will not happen. Once I run the test with fullscreen mode of xcode, my screen will still stay on xcode and the statusbar will not be showing. Then the test will response
error: -[swiftuitestUITests.MenubarExtraTests testExample] : Element StatusItem, {{1080.0, 6.5}, {34.5, 24.0}}, title: 'Favourite' is not hittable
The only solution I can found at the moment is to leave fullscreen first, then run the test.
In xctest, is there any way to force the statusbar to show first?
Thank you!
Hi,
I am looking for a way to implement X-day free trial and then the feature would be locked. User should purchase the in app purchase to unlock the feature after trial period if they wish to continue to use it.
From the older post, I can see other people suggest non-consumable tier-0 IAP will should cost nothing. From app store connect, I am not able to find 0 dollar as an option.
I can see in apple's storekit documentation. There are officially a free trial subscription. I don't believe this can fit in my use case.
Is anyone still able to create free in app purchase ?