Post

Replies

Boosts

Views

Activity

Why can't the app get the subscription status occasionally?
Hi, I have developed an app which has two in-app purchase subscriptions. During the test, the app can successfully get the status of the subscriptions. After it's released, I downloaded it from app store and subscribed it with my apple account. I found that in most cases, the app can identify that I have subscribed it and I can use its all functions. But yesterday, when I launched it again, it showed the warning that I haven't subscribed it. I checked my subscription in my account and the subscription status hasn't been changed, that is, I have subscribed it. And after one hour, I launched it again. This time the app identified that I have subscribed it. Why? The following is the code about listening to the subscription status. Is there any wrong about it? HomeView() .onAppear(){ Task { await getSubscriptionStatus() } } func getSubscriptionStatus() async { var storeProducts = [Product]() do { let productIds = ["6740017137","6740017138"] storeProducts = try await Product.products(for: productIds) } catch { print("Failed product request: \(error)") } guard let subscription1 = storeProducts.first?.subscription else { // Not a subscription return } do { let statuses = try await subscription1.status for status in statuses { let info = try checkVerified(status.renewalInfo) switch status.state { case .subscribed: if info.willAutoRenew { purchaseStatus1 = true debugPrint("getSubscriptionStatus user subscription is active.") } else { purchaseStatus1 = false debugPrint("getSubscriptionStatus user subscription is expiring.") } case .inBillingRetryPeriod: debugPrint("getSubscriptionStatus user subscription is in billing retry period.") purchaseStatus1 = false case .inGracePeriod: debugPrint("getSubscriptionStatus user subscription is in grace period.") purchaseStatus1 = false case .expired: debugPrint("getSubscriptionStatus user subscription is expired.") purchaseStatus1 = false case .revoked: debugPrint("getSubscriptionStatus user subscription was revoked.") purchaseStatus1 = false default: fatalError("getSubscriptionStatus WARNING STATE NOT CONSIDERED.") } } } catch { // do nothing } guard let subscription2 = storeProducts.last?.subscription else { // Not a subscription return } do { let statuses = try await subscription2.status for status in statuses { let info = try checkVerified(status.renewalInfo) switch status.state { case .subscribed: if info.willAutoRenew { purchaseStatus2 = true debugPrint("getSubscriptionStatus user subscription is active.") } else { purchaseStatus2 = false debugPrint("getSubscriptionStatus user subscription is expiring.") } case .inBillingRetryPeriod: debugPrint("getSubscriptionStatus user subscription is in billing retry period.") purchaseStatus2 = false case .inGracePeriod: debugPrint("getSubscriptionStatus user subscription is in grace period.") purchaseStatus2 = false case .expired: debugPrint("getSubscriptionStatus user subscription is expired.") purchaseStatus2 = false case .revoked: debugPrint("getSubscriptionStatus user subscription was revoked.") purchaseStatus2 = false default: fatalError("getSubscriptionStatus WARNING STATE NOT CONSIDERED.") } } } catch { // do nothing } if purchaseStatus1 == true || purchaseStatus2 == true { purchaseStatus = true } else if purchaseStatus1 == false && purchaseStatus2 == false { purchaseStatus = false } return }
0
0
170
3w
How often iCloud will sync with local swiftData?
Hi, I have developed a calendar app with swiftData. I have set it to sync iCloud. When testing it, it seems that everything is fine. But after it's released, today, I uninstalled it and reinstalled it again. And I found that iCloud hasn't sync with local swiftData for six days. I have lost six days agenda and relevant information. I have checked the document, and it's said that there is no method to force to sync with iCloud. How to solve the issue? I think that the users can't forgive that it hasn't synced for six days. Best Wishes,
3
0
268
4w
Monthly/yearly subscriptions are wrongly shown as one-time purchase in App Store
We have set monthly/yearly subscriptions in our app and they have been approved. The users can get access to the limited functions of the app for free. For example, they can create limited number of tasks/events in the App. But if they want to create more tasks/events in the App, they need to subscribe the app(monthly/yearly). But we don't know why the app is shown as an one-time purchase app in App store. The users need to pay the one-time purchase fee at first to download the app. If they haven't tried the app, they wont' pay for it. How to fix it? Look forward to the reply about it ASAP.
2
0
322
Feb ’25
Apple review team is crazy now.
The rejection reason is more and more ridiculous. I design an app that will save some data from the users. And the app requires users to register for saving the data. The rejection reason from Apple review team is that you can't let users to register. They should save their data without the step. I want to ask, why does iPhone/iPad require users to register when they launch their devices for the first time? And I found Apple review team become very rude and not patient this year. I have answered their same questions for ten times and have written detailed guidelines about them. But guess what, the reviewers from Apple never read the guidelines. Their plan seem to be like, never let any new app to launch in App store although the incomes from these app are the important profit source for Apple. I don't know who is leading the team now. But I indeed know that the ridiculous working style will ruin Apple business in the end.
2
0
299
Feb ’25
How to let iCloud sync across the devices without launching the app at midnight?
Hi, I have designed an app which needs to reschedule notifications according to the user's calendar at midnight. The function has been implemented successfully via backgroundtask. But since the app has enabled iCloud sync, some users will edit their calendar on their iPad and expect that the notifications will be sent promptly to them on iPhone without launching the app on their iPhone. But the problem is that if they haven't launched the app on their iPhone, iCloud sync won't happen. The notifications on their iPhone haven't been updated and will be sent wrongly. How can I design some codes to let iCloud sync across the devices without launching the app at midnight and then reschedule notifications?
4
0
848
Jan ’25
share photo to facebook but no dialog shows
Hi, Everyone I set up a class for sharing photos to facebook. The codes of the class are as following. But when I call the function "shareToFacebook", there is no dialog to show. What's the issue in these codes? I am using iOS 17.0, Xcode The guide from Facebook hasn't updated. import SwiftUI import FBSDKShareKit import FacebookShare @Observable class ShareFacebook { var content = SharePhotoContent() var images : [UIImage] = [] var photos : [SharePhoto] = [] func shareToFacebook() { for image in images { let photo = SharePhoto( image: image, isUserGenerated: true ) photos.append(photo) } content.photos = photos let dialog = ShareDialog( viewController: UIApplication.shared.currentUIWindow()?.rootViewController, content: content, delegate: nil ) dialog.show() } } //button for sharing //Sharing to Facebook Button { for image in photos { let image = UIImage(data: image.imageData) sharedPhotos.append(image ?? userViewModel.render(image: Image("photoForNil"))! ) } shareToFacebook.images = sharedPhotos shareToFacebook.shareToFacebook() }label: { Image("share") .resizable() .frame(width:18, height: 18) .padding(.trailing,30) }
0
0
616
Dec ’23
Textfield bug after upgrading to IOS 17.0
I have a textfield to allow users to input their numbers. It works well until I upgrade to IOS 17.0 yesterday. After upgrading to IOS 17.0, the number input by user can't be cleared when user wants to input another number. More specifically, the last figure can't be deleted.For example, the user originally input 50, and he/she wants to delete it to input another figure. But 5 can't be deleted and only 0 is deleted. So user can't input a new number in the textfield. Is a bug from IOS17.0? How can I fix it. My code about the textfield is as following: TextField("Focus Time", value: $userViewModel.focusTime, format: .number) .frame(width: 220, height: nil) .keyboardType(.numberPad) .textFieldStyle(.roundedBorder) .font(Font.system(size: 25, design: .default)) .multilineTextAlignment(TextAlignment.center) .focused($textIsFocused1) .onTapGesture { textIsFocused1.toggle() }
2
0
993
Nov ’23