Post

Replies

Boosts

Views

Activity

VerificationResult return .verified then My server can deliver content to the user directly?
Use StoreKit 2 my client IAP code like this: func purchase(_ product: Product) async throws -> Transaction? {         let orderId = UUID.init()         let result = try await product.purchase(options: [.appAccountToken(orderId)])         switch result {         case .success(let verification) :             let transaction = try checkVerified(verification) //Here can I tell my server deliver content to user? //I do not want valid transaction on device(just like valid receipt via S2S use Storekit1)             return transaction         case .userCancelled, .pending:             return nil         default:             return nil         }     } If verificationResult return ..verified() case , can I tell my server deliver content to my customer ? Or should I send originalID for this transaction to my server, my server has to fetch transaction info by history Api(decode JWS info) to decide whether to deliver content to my custom? Thank you very much
0
0
726
May ’22
My Server how to know it can delivery product to user with StoreKit2(Client)
Hi My App has realize IAP function by StoreKit1, the flow just like this: 1.My app purchase one product by storekit1 2.When user has purchased, my app receive purchased transaction object 3.App send local device receipt to my server 4.My server use verifyReceipt Api to get transaction info, So my server can delivery product to current user But With StoreKit2 how my server valid purchase? 1.Plan A func checkVerified<T>(_ result: VerificationResult<T>) throws -> T {     //Check if the transaction passes StoreKit verification.     switch result {     case .unverified:       //StoreKit has parsed the JWS but failed verification. Don't deliver content to the user.       throw NTESiTAStoreError.failedVerification     case .verified(let safe):       //If the transaction is verified, unwrap and return it.       return safe     }   } then i can get the transacation: let transaction = try checkVerified(result) let jwsString = result.jwsRepresentation; what can i do next? Send the original_id to my server, then my server request get purchase history Api to get transaction JWS to decode to delivery product? or my client can send some information about result or transaction from checkVerified func to my server, then my server do not need to fetch transaction info from apple server , it can delivery product directly? Plan B Can i get JWS String from result or transaction from checkVerified func like eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjoidGVzdCJ9.pNIWIL34Jo13LViZAJACzK6Yf0qnvT_BuwOxiMCPE-Y where can i receive this? when i receive it I will send it to my server , my server decode it delivery product directly without request get history API? I'm confused, because i am first time to change IAP SDK in my app, I need some suggest and guide. Thank you very much
0
1
629
Apr ’22
When to tell system to show PlaceHolderView in Widget with Xcode Beta3
Hi I change my widget func to IntentConfiguration(kind: kind, intent: ***, provider: Provider()) { entry in EntryView(entry: entry) } by removing placeholder parameter And i also add func to my provider to return an Entry func placeholder(with: Context) -> FeedModelEntry So where I should add this modifier to indicate this view should look likes placeholderView style? .redacted(reason: .placeholder) My widget has three line text , but after add placeholder(with: Context) i can not see my view change to placeholder view style when i edited my widget Should my entry object need hold a isPlaceholder property to let my widget view to know it should show placeholder style? if entry.isPlaceHolderView { someView() .redacted(reason: .placeholder) } else { someView() } Thank you very much Xcode-beta3
1
0
1.9k
Jul ’20
How to load a remote Image when creating my timeline entry?
My needs are download images for my widget, and i also know in my custom swiftUI view loading in the body is not allowed. When I received remote data, I download each one in imageurls array. My widget need to show three titles for three images, How Can I connect them one by one?(one title has an image) Is there any demo project for me to learn? Thank you very much
0
0
772
Jul ’20