Giter Club home page Giter Club logo

Comments (7)

sabiland avatar sabiland commented on June 6, 2024 1

Yes, but it adds extra info e.g. (Mercato.MercatoError error 0.). Apple would not allow this kind of message.

So I fixed this by checking for "(" character and remove everything behind.

func cleanPossibleStoreKitAndExtraAddedMessage(input: String) -> String
        {
            // NOTE: Input can be like this ---> "The operation couldn’t be completed. (Mercato.MercatoError error 0.)"
            let splitted = Array(input.components(separatedBy: "("))
            return (splitted.first ?? input).fullTrim()
        }

from mercato.

tikhop avatar tikhop commented on June 6, 2024

Hi @sabiland, thanks for asking. Yes, it's production ready and I have been using it since I released it.
Failed transaction will throw an error from StoreKit framework.
Restoring purchases works differently in store kit 2 and Mercato supports it as well.
With store kit 2 you can only track non-consumable + subscriptions iaps, Mercato only support subscriptions, but I will add support for non-consumable.

from mercato.

sabiland avatar sabiland commented on June 6, 2024

Thx for quick reply. About non-consumable, can I make non-consumable purchase with Mercato? I have already checked about restoring purchases with StoreKit 2, will do it manually for now probably.

And where is Mercato.purchase completion block? Success, etc.? Maybe I don’t yet understand how StoreKit2 and/or Mercato works.
EDIT: I saw the StoreKit 2 is handling error messages via popups right?

from mercato.

sabiland avatar sabiland commented on June 6, 2024

Ok I think I have managed to refactor first of my apps to StoreKit 2 with the help of Mercato.

from mercato.

tikhop avatar tikhop commented on June 6, 2024

Sounds good!

from mercato.

sabiland avatar sabiland commented on June 6, 2024

@tikhop Will you allow another question, where are string messages defined for your errors?

I get this for example if I simulate IAP and then cancel it. I know Apple does not allow those kind of messages for the user.
The operation couldn’t be completed. (Mercato.MercatoError error 2.)

public enum MercatoError: Error
{
	case storeKit(error: StoreKitError)
	case purchase(error: Product.PurchaseError)
	case purchaseCanceledByUser
	case userCancelledRefundProcess
	case purchaseIsPending
	case failedVerification
	case genericError
}

from mercato.

tikhop avatar tikhop commented on June 6, 2024

@sabiland the message comes from the system.

from mercato.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.