Have a simple, or what I think is simple view, that includes the below code
struct ContentView: View {
@StateObject var coordinator = Coordinator()
var body: some View {
if coordinator.sharedAlbumPermission {
sharedAlbumView()
} else {
permissionToAlbumView()
}
}
My app has permission already for "All Photos".
The issue I am running into is that the "permissionToAlbumView()" displays for about 5 seconds before "sharedAlbumView()" displays.
When I change permission to "None" I only see "permissionToAlbumView()". When I update in settings then switch to my app the "sharedAlbumView()" displays right away.
Not sure why "permissionToAlbumView()" would display when permission is already given. I think the issue that the .sharedAlbumPermission is giving wrong value first and then updating but I could be wrong. If there is another and better way to code this I would greatly appreciate as new to Swift.
Have tried onAppear and onDisappear but does not seem to work either.
Post
Replies
Boosts
Views
Activity
I can purchase fine and restore works as well (tested by completely deleting app then re-installing). However, when I install app and then click purchase (previously already purchased) and call SKPaymentQueue.default().add(payment) all screens for purchase come up but no movement to the paymentQueuest function I have being triggered. I cannot see any transaction status change. It is as if it stops. Now of course I am only completing this in sandbox and have not submitted app yet.
I can try exact same steps but then cancel purchase and get the <SKPaymentQueue: 0x28192caa0>: Payment completed with error: Error ....
Again there is not return or function called. I even had to create my own restore process cause the func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {} is never called only the func paymentQueueRestoreCompletedTransactionsFinished(_ queue: SKPaymentQueue) {} when I use SKPaymentQueue.default().add(self) SKPaymentQueue.default().restoreCompletedTransactions()
Something does not seem correct. Is this due to sandbox and will work if app is in TestFlight and using my real account? not the sandbox?