Moltin doesn't get response on Xcode


I’m just starting, I added a product to the store, connect client id, when I run this, I get nothing

moltin.product.all { (result) in
switch result {
case .success(let response):
print(“Got products: (”)

        case .failure(let error):
            print("Got failure: \(error)")

I get “Got products” message but doesn’t print them. any ideas


Hey Yasser,

Giving this a try right now, at first glance though it looks like you need to escape the string

print("Got products: \(")

I would also recommend,

let moltin = Moltin(withClientID: "<your client ID>")
self.moltin.product.include([.mainImage]).all { (result: Result<PaginatedResponse<[moltin.Product]>>) in
   switch result {
       case .success(let response):
            DispatchQueue.main.async {
               //set it to an array you can use in the class
                self.products = ?? []
                print("Got products: \(")
        case .failure(let error):
            print("Products error", error)

Let me know if you are able to get that to work. We have a bunch of iOS guides and boilerplate apps, happy to help.



Thanks for the reply, I only get

[moltin.Product, moltin.Product]
because I have 2 products, how can I get them as actual data


Oh, I just got it by using
instead of

thanks :slight_smile:

one more question, can I connect Firebase user login and out to it or do you have user management as well ?

thanks again :slight_smile:


yes you could for sure do that. I would recommend making the call to firebase and in the response making the call to moltin to create the user. I can stub out an example for you.