-
public final class OpenIapViewModel extends AndroidViewModel
Android ViewModel wrapper around OpenIapStore for easy integration
-
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<Boolean>isConnectedprivate final StateFlow<List<Product>>productsprivate final StateFlow<List<Purchase>>availablePurchasesprivate final StateFlow<IapStatus>status
-
Constructor Summary
Constructors Constructor Description OpenIapViewModel(Application app)
-
Method Summary
Modifier and Type Method Description final StateFlow<Boolean>getIsConnected()final StateFlow<List<Product>>getProducts()final StateFlow<List<Purchase>>getAvailablePurchases()final StateFlow<IapStatus>getStatus()final UnitinitConnection(InitConnectionConfig config)final UnitendConnection()final UnitfetchProducts(List<String> skus, ProductQueryType type)final UnitrestorePurchases()final UnitrequestPurchase(List<String> skus, ProductQueryType type)-
Methods inherited from class androidx.lifecycle.AndroidViewModel
addCloseable, clear, getTag, onCleared, setTagIfAbsent -
Methods inherited from class dev.hyo.openiap.OpenIapViewModel
getApplication -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
OpenIapViewModel
OpenIapViewModel(Application app)
-
-
Method Detail
-
getIsConnected
final StateFlow<Boolean> getIsConnected()
-
getProducts
final StateFlow<List<Product>> getProducts()
-
getAvailablePurchases
final StateFlow<List<Purchase>> getAvailablePurchases()
-
initConnection
final Unit initConnection(InitConnectionConfig config)
-
endConnection
final Unit endConnection()
-
fetchProducts
final Unit fetchProducts(List<String> skus, ProductQueryType type)
-
restorePurchases
final Unit restorePurchases()
-
requestPurchase
final Unit requestPurchase(List<String> skus, ProductQueryType type)
-
-
-
-