bambuser / BambuserPlayerSDK-iOS

SDK of Bambusers live video shopping player for iOS
7 stars 1 forks source link

Cart screen (1.4.0) cannot be overridden #10

Closed joshuapoq closed 2 months ago

joshuapoq commented 3 months ago

Description

There doesn't seem to be a way to replace the out of the box cart implementation. By default Bambuser sends the openCart event and has new PlayerCartDataSource API but there is no way to present our own Cart as it conflicts with Bambusers.

When we present our own Cart by observing the openCart event the Bambuser view tries to present its cart which causes ours to show then immediately dismiss. Subsequent taps work somewhat as expected but the two Carts conflict.

Versions

Code

class BambuserFactory {
    func makeBambuserViewController(showId: String) -> UIViewController {
        BambuserPlayerViewController(showId: showId, config: .init(uiConfig: .init())) { event in
            switch event {
            case .openCart:
                let cartViewController = UIViewController() // Example code, ours is slightly different when referencing the window.
                UIApplication.shared.keyWindow?.rootViewController?.present(cartViewController, animated: true)

            default:
                break
            }
        }
    }
}
joshuapoq commented 3 months ago

Repository docs are also out of date for how to use this new API and it's bit harder to understand compared to the new ProductDetailsDataSource. The naming is also slightly inconsistent where PlayerProductDataSource might be preferable?

saeidbasirnia commented 3 months ago

Hi,

Right now it's not possible to inject custom views to player and this feature is not supported but theming is supported if that helps. These events mainly supposed to be used for analytics purposes right now.

Thanks for your suggestion, I'll forward this to the team and we try to improve the documents as soon as possible.

joshuapoq commented 3 months ago

Hi @saeidbasirnia, thanks we're not looking to inject custom views but instead not use the Cart and Product screens from the SDK as we have our own which are much more feature rich. These issues were raised following a call with your team last Friday where it was stated that Cart is optional but currently Cart is mandatory with the only way to replace it being to disable it and show our own button elsewhere.

saeidbasirnia commented 3 months ago

@joshuapoq, Unfortunately that's not possible in Player view. Currently when Player view is presenting only PlayerSDK cart and product view can be shown. Cart can be hidden/disabled from Player view configuration but I'm afraid there was a confusion about the usecase. We've planned to add support for this functionality but I don't have an ETA at this moment.

saeidbasirnia commented 2 months ago

Hi @joshuapoq, We have released BambuserPlayerSDK 1.5.0 which now allows user to use custom views for Cart and Product Details views. You can find about implementation in documents and demo projects. Please let us know if you have any issues or questions.

joshuapoq commented 2 months ago

Hey @saeidbasirnia thanks for getting back. Great release, docs are good, the demo app is great!