Object representing a purchase in the Nami Platform.

public class NamiPurchase : NSObject, Codable {
    public var purchasedSKU : NamiSKU,
    public var expires : Date?
  
    // platform specific
    public var entitlementsGranted: [NamiEntitlement]
    public var transactionIdentifier : StoreID?
    public var transaction : SKPaymentTransaction?
    public var receiptInfo : NamiReceiptIAPWrapper?
    public let skuID : StoreID
}
@interface NamiPurchase : NSObject
	@property (nonatomic, readonly, copy) NSString * _Nonnull skuID;
	@property (nonatomic, copy) NSString * _Nullable transactionIdentifier;
	@property (nonatomic, copy) NSDate * _Nonnull purchaseInitiatedTimestamp;
	@property (nonatomic, copy) NSDate * _Nullable exipres;
	@property (nonatomic) enum NamiPurchaseSource purchaseSource;
	@property (nonatomic, readonly, copy) NSArray<NamiEntitlement *> * _Nonnull entitlementsGranted;
@end
data class NamiPurchase {
  purchaseInitiatedTimestamp: Long,
  expires: Date?,
  purchaseSource: NamiPurchaseSource,
  fromNami: Boolean,
  skuId: String,
  transactionIdentifier: String?,
  localizedDescription: String?
)
class NamiPurchase {
  long purchaseInitiatedTimestamp,
  @Nullable Date expires,
  @NonNull NamiPurchaseSource purchaseSource,
  boolean fromNami,
  @NonNull String skuId,
  @Nullable String transactionIdentifier
  @Nullable String localizedDescription
)
NamiPurchase = {
    "purchasedSKU": NamiSKU,
    "entitlementsGranted": [NamiEntitlement],
    "expires": Date,
    
    // platform specific
    "localizedDescription": String,
    "localizedPrice": String
}
class NamiPurchase {
  final int purchaseInitiatedTimestamp;
  final DateTime expires;
  final NamiPurchaseSource purchaseSource;
  final bool fromNami;
  final String skuId;
  final String transactionIdentifier;
  final String localizedDescription;
}

Parameters

  • purchasedSKU - a NamiSKU object representing the in-app purchase product SKU the device purchased.
  • expires - date the purchase expires if it is a subscription

Each App Platform also populates some extra data specific to that platform.

Android

Apple

  • entitlementGranted - a NamiEntitlement object for the entitlement granted by this purchase.
  • transactionIdentifier - App Store ID for the transaction
  • transaction - the StoreKit transaction object for the purchase
  • receiptInfo - Receipt for the transaction
  • skuID - the ID of the purchased product SKU

React Native

  • localizedDescription - the name of the product localized to the device's language by the App Platform.
  • localizedPrice - the purchased price of the product SKU localized to the device's language by the App Platform.