soymanuvalle / windows-iap-wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

windows-iap-wrapper

Usage example with electron

import { getCurrentWindow } from '@electron/remote';
import WindowsIapWrapper from 'windows-iap-wrapper';

const getStoreContext = () => {
    const context = new WindowsIapWrapper();
    let hwnd = getCurrentWindow().getNativeWindowHandle();
    const initialized = context.initialize(hwnd);
    if (!initialized) return null;
    return context;
};

const StoreContext = getStoreContext();

const product = await StoreContext.getAssociatedStoreProductAsync(['Durable'], identifier);
const result = await StoreContext.requestPurchaseAsync(product.storeId);

About


Languages

Language:C++ 75.6%Language:TypeScript 19.8%Language:Python 4.6%