Closed ItsCalebJones closed 6 years ago
Is this on ios, Android, or both? Also, neither platform allows testing in app purchases in the simulator.
I am only using Flutter on iOS for now - this occurs both with real devices deployed to the App Store and in the simulator (apparently seeing that StoreKit might be testable now).
From searching through the repo - here is the only place 'emptyProducts' is returned - I don't know enough about StoreKit or Swift to understand why iapProducts.count is equal to 0 there. And as far as I can tell I am doing essentially the same thing as the example.
@JackAppDev do you need any additional details? Willing to help however you need.
I've been lookin in there to make it work, it seems like it's looking for
iapProducts
Yet it's only referenced three times, none of it being as an assignation, therefore it's always empty.
fileprivate var iapProducts = [String : SKProduct]()
if iapProducts.count == 0 {
let product = iapProducts[id]!
Maybe I am missing something with iOS - i'm fairly new to the platform... anyways I have a In-App-Product configured with the ID '2018_founder'.
If I call FlutterIap.fetchProducts(["2018_founder"]) it properly grabs all the details of the product, however if I call FlutterIap.buy('2018_founder') nothing happens for the user and if i'm on the simulator I can see the method is returning a 'emptyProducts' response. This occurs both in debug and release builds from what I can tell.
All relevant code is here: https://github.com/ItsCalebJones/spacelaunchnow_flutter/blob/master/lib/views/settings/settings_page.dart