StoreKit 2: Modern In App Purchases (SwiftUI, Xcode 13, 2021) - iOS Development

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 พ.ย. 2024

ความคิดเห็น • 60

  • @iOSAcademy
    @iOSAcademy  3 ปีที่แล้ว +4

    Enjoy my teaching style? Check out some of my courses at courses.iosacademy.io

  • @RickyKresslein
    @RickyKresslein ปีที่แล้ว +1

    I was searching for a tutorial on in-app purchases with StoreKit for so long before coming across this. Moreover, it was explained super easily and thoroughly! Thank you!

  • @aakash1103jha
    @aakash1103jha 3 ปีที่แล้ว +3

    I have been following your content ever since I started iOS learning development. Amazing and comprehensive content.And the best part is, you don't only teach how to build stuff but also how to debug and fix errors on the fly. Plus, the "boom" when things work out. Cheers!!

    • @iOSAcademy
      @iOSAcademy  3 ปีที่แล้ว

      Glad you enjoy the content!

  • @keepspeed
    @keepspeed 2 ปีที่แล้ว +10

    6:28 Product.request 9:25, 14:00 - call fetchProduct, 14:51 - Dispatch main
    8:10 purchase 8:47, 9:44 - async, 16:38 - result and verification, 18:14 run purchase
    10:39 .configuraion file edit for In-App-Purchse
    19:31 isPurchased

    • @iOSAcademy
      @iOSAcademy  2 ปีที่แล้ว +1

      Youre the real mvp

  • @bruhmoment3731
    @bruhmoment3731 2 ปีที่แล้ว +5

    Please make an updated version of this tutorial. This is outdated.

  • @kimwapola
    @kimwapola 2 ปีที่แล้ว +2

    Thank you for doing this in SwiftUI! Very helpful.

  • @oricoh
    @oricoh ปีที่แล้ว +4

    Why do I get: "Type 'Product' has no member 'request' " ?

  • @bruhmoment3731
    @bruhmoment3731 2 ปีที่แล้ว +4

    "Making a purchase without listening for transaction updates risks missing successful purchases. Create a Task to iterate Transaction.updates at launch."

  • @minutenfilm7246
    @minutenfilm7246 3 ปีที่แล้ว +2

    My absolutely favourite channel

  • @JuggernautPO
    @JuggernautPO ปีที่แล้ว

    love the instruction. I followed and tried to get the server-to-server call triggered on my server's side but I couldn't. I put in the URL on both sandbox and prod in app store connect for the call. Is it because i am using storekit config?

  • @Stevesvideoshelf
    @Stevesvideoshelf 2 ปีที่แล้ว +2

    Total noob here (I probably won't even understand your answer)
    I'm getting a couple of errors.
    1 'async(priority:operation:)' is deprecated: `async` was replaced by `Task.init` and will be removed shortly.
    2 in the purchase function: Enum case 'unverified' has 2 associated values; matching them as a tuple is deprecated
    I assume I'm getting these because my version of Xcode is no longer in beta and they've changed some things.
    I would love to see a tutorial where you cover multiple auto renewing subscriptions but now I'm just getting greedy!
    Anyway, thanks for the great tutorial!

    • @mauricebarbar3345
      @mauricebarbar3345 2 ปีที่แล้ว +3

      1. Task.init(priority: .background) { //your code here } instead of 'async'.
      2. Use (_, _) instead of (_) since the .unverified case takes two parameters now.
      Hope I helped.

  • @shawnfrank5303
    @shawnfrank5303 3 ปีที่แล้ว +2

    Thanks, another wonderful tutorial. I wonder if they have made the whole restore purchases bit easier as it was not the most straightforward thing to work with in the original StoreKit API.

  • @simply6162
    @simply6162 ปีที่แล้ว

    can you do subscription ??? pleaasee

  • @MrBobbelHD
    @MrBobbelHD 3 ปีที่แล้ว +2

    Must the app be for iOS 15 to use store kit 2?

  • @4kVideos136
    @4kVideos136 3 ปีที่แล้ว +7

    But bro,
    Why am I not getting the Product.request method.??

    • @iOSAcademy
      @iOSAcademy  3 ปีที่แล้ว +1

      Using xcode 13?

    • @Daberk1234VFX
      @Daberk1234VFX 3 ปีที่แล้ว +2

      Same issue here (Type 'Product' has no member 'request'), on Xcode 13

    • @austinnorman4155
      @austinnorman4155 3 ปีที่แล้ว +1

      @@iOSAcademy Same issue here, please assist

    • @austinnorman4155
      @austinnorman4155 3 ปีที่แล้ว

      @@Daberk1234VFX ^^

    • @austinnorman4155
      @austinnorman4155 3 ปีที่แล้ว +11

      @Joseph I THINK I figured it out by reading the new StoreKit info:
      let products = try await Product.products(for: [com(dot)watch])
      put quotes and an actual . in there, it kept giving me an error when trying to reply here.

  • @kembel2761
    @kembel2761 2 ปีที่แล้ว

    Hey @iOS Academy can you test out the failed transactions? I don't know why but in my builds the products always get purchased instead of passing by the failed enum

  • @randyb101
    @randyb101 2 ปีที่แล้ว +1

    Hi there, I've followed along and made corrections based on the comments but I still get the error: "How (and where) do I create this task?

    • @randyb101
      @randyb101 2 ปีที่แล้ว +1

      Sorry, here's the error text: Making a purchase without listening for transaction updates risks missing successful purchases. Create a Task to iterate Transaction.updates at launch.

  • @amanibamugabel5753
    @amanibamugabel5753 3 ปีที่แล้ว

    Great video as usual. Can you please make a video about verifying receipts.

  • @minutenfilm7246
    @minutenfilm7246 3 ปีที่แล้ว +1

    Will you do another video on the shazamkit? ☺️

  • @BukhariTechnologies
    @BukhariTechnologies 3 ปีที่แล้ว +1

    Is there any way to open another view controller after in-app purchase? Kindly, guide.

  • @devsang
    @devsang 2 ปีที่แล้ว +1

    I have an error: Making a purchase without listening for transaction updates risks missing successful purchases. Create a Task to iterate Transaction.updates at launch. help me fix it

    • @levionmusic
      @levionmusic 2 ปีที่แล้ว

      Check wwdc 2021 Storekit xcode file. There is few functions you need to add.

  • @bandr-dev
    @bandr-dev 2 ปีที่แล้ว +4

    this doesn't work anymore

  • @ChrisAthanas
    @ChrisAthanas 11 หลายเดือนก่อน +1

    Black pointer makes it difficult to follow

  • @HannisEngineeringOfficial
    @HannisEngineeringOfficial 3 ปีที่แล้ว

    Can storekit also be used to let the user buy a premium subscribtion for your app for a montly fee of lets say 2 dollar?

  • @Frentt
    @Frentt 3 ปีที่แล้ว +1

    I'm getting a runtime error after result = product.purchase() that says "Making a purchase without listening for transaction updates risks missing successful purchases. Create a Task to iterate Transaction.updates at launch."

    • @CraigBruenell
      @CraigBruenell 3 ปีที่แล้ว

      I get the same error. Did you figure it out?

    • @borislagercrantz4305
      @borislagercrantz4305 2 ปีที่แล้ว

      @@CraigBruenell Me too lol anybody of you figured it out?

    • @levionmusic
      @levionmusic 2 ปีที่แล้ว

      Check wwdc 2021 Storekit xcode file. There is few functions you need to add.

    • @Kyronsk8
      @Kyronsk8 ปีที่แล้ว

      @@levionmusic hey sorry to bother, but I’ve been stuck trying to figure this out. I’m getting the same error and the in app purchase prompt is not showing up after the first purchase.
      I checked the StoreKit transactions and it was there in a waiting state I believe. When I delete the transaction I am able to get them in app prompt again. But now I get neither the prompt or transaction in the transaction list.
      You mentioned to look at 2021 WWDC file. May I ask what you were specifically referring too?

  • @ahmedmoncer8774
    @ahmedmoncer8774 2 ปีที่แล้ว

    This is awesome but can you show us how to implement StoreKit 2 with uiklit instead of SwiftUI ?

  • @DavidCollettG
    @DavidCollettG 2 ปีที่แล้ว +1

    Type 'Product' has no member 'request'.

    • @calumhaddow1263
      @calumhaddow1263 2 ปีที่แล้ว +5

      Use ".products(for: [" "])" instead

    • @andreappelgryn8022
      @andreappelgryn8022 6 หลายเดือนก่อน

      @@calumhaddow1263 Tnx this worked for me in XCode 15

  • @dallasrieck7753
    @dallasrieck7753 ปีที่แล้ว

    share don't "teach"😉

  • @borislagercrantz4305
    @borislagercrantz4305 2 ปีที่แล้ว +2

    I'm getting a runtime error after result = try await product.purchase(): "Making a purchase without listening for transaction updates risks missing successful purchases. Create a Task to iterate Transaction.updates at launch."

    • @vladimirstepanov7246
      @vladimirstepanov7246 2 ปีที่แล้ว

      hi) found decision?

    • @levionmusic
      @levionmusic 2 ปีที่แล้ว

      @@vladimirstepanov7246 Check wwdc 2021 Storekit xcode file. There is few functions you need to add.