Warning
These plugin is for Capacitor 6. For Capacitor 5, use the 3.x version.
Glassfy is a subscription revenue optimisation infrastructure for mobile applications.
Check the documentation at docs.glassfy.io to learn details on implementing and using Glassfy SDK.
npm install capacitor-plugin-glassfy
npx cap syncbe sure to have ionic cli installed following instructions here
npm install
npm run build
cd example
npm install
ionic capacitor sync ios
ionic capacitor open ios
sdkVersion()initialize(...)setLogLevel(...)offerings()purchaseHistory()permissions()skuWithId(...)skuWithIdAndStore(...)connectCustomSubscriber(...)connectPaddleLicenseKey(...)connectGlassfyUniversalCode(...)setEmailUserProperty(...)setDeviceToken(...)setExtraUserProperty(...)getUserProperty()purchaseSku(...)restorePurchases()storeInfo()setAttribution(...)setAttributions(...)_paywall(...)_closePaywall()_openUrl(...)- Interfaces
- Type Aliases
- Enums
sdkVersion() => Promise<GlassfyVersion>Returns: Promise<GlassfyVersion>
initialize(options: { apiKey: string; watcherMode: boolean; }) => Promise<void>For more details, follow instruction at https://docs.glassfy.io/get-started/configuration
| Param | Type |
|---|---|
options |
{ apiKey: string; watcherMode: boolean; } |
setLogLevel(options: { logLevel: GLASSFY_LOGLEVEL; }) => Promise<void>| Param | Type |
|---|---|
options |
{ logLevel: GLASSFY_LOGLEVEL; } |
offerings() => Promise<GlassfyOfferings>For more details, check the documentation https://docs.glassfy.io/dashboard/configure-offerings
Returns: Promise<GlassfyOfferings>
purchaseHistory() => Promise<GlassfyPurchasesHistory>For more details, check the documentation https://docs.glassfy.io/dashboard/configure-offerings
Returns: Promise<GlassfyPurchasesHistory>
permissions() => Promise<GlassfyPermissions>For more details, check the documentation https://docs.glassfy.io/dashboard/configure-permissions.html
Returns: Promise<GlassfyPermissions>
skuWithId(options: { identifier: string; }) => Promise<GlassfySku>For more details, check the documentation https://docs.glassfy.io/dashboard/configure-products
| Param | Type |
|---|---|
options |
{ identifier: string; } |
Returns: Promise<GlassfySku>
skuWithIdAndStore(options: { identifier: string; store: GLASSFY_STORE; }) => Promise<GlassfySkuBase>| Param | Type |
|---|---|
options |
{ identifier: string; store: GLASSFY_STORE; } |
Returns: Promise<GlassfySkuBase>
connectCustomSubscriber(options: { subscriberId: string; }) => Promise<void>| Param | Type |
|---|---|
options |
{ subscriberId: string; } |
connectPaddleLicenseKey(options: { licenseKey: string; force: boolean; }) => Promise<void>| Param | Type |
|---|---|
options |
{ licenseKey: string; force: boolean; } |
connectGlassfyUniversalCode(options: { universalCode: string; force: boolean; }) => Promise<void>| Param | Type |
|---|---|
options |
{ universalCode: string; force: boolean; } |
setEmailUserProperty(options: { email: string; }) => Promise<void>| Param | Type |
|---|---|
options |
{ email: string; } |
setDeviceToken(options: { token: string; }) => Promise<void>| Param | Type |
|---|---|
options |
{ token: string; } |
setExtraUserProperty(options: { extra: GlassfyExtraProperty; }) => Promise<void>| Param | Type |
|---|---|
options |
{ extra: GlassfyExtraProperty; } |
getUserProperty() => Promise<GlassfyUserProperties>Returns: Promise<GlassfyUserProperties>
purchaseSku(options: { sku: GlassfySku; skuToUpgrade?: GlassfySku; replacementMode?: GLASSFY_REPLACEMENT_MODE; }) => Promise<GlassfyTransaction>| Param | Type |
|---|---|
options |
{ sku: GlassfySku; skuToUpgrade?: GlassfySku; replacementMode?: GLASSFY_REPLACEMENT_MODE; } |
Returns: Promise<GlassfyTransaction>
restorePurchases() => Promise<GlassfyPermissions>Returns: Promise<GlassfyPermissions>
storeInfo() => Promise<GlassfyStoresInfo>Returns: Promise<GlassfyStoresInfo>
setAttribution(options: { type: GLASSFY_ATTRIBUTION; value: string; }) => Promise<void>| Param | Type |
|---|---|
options |
{ type: GLASSFY_ATTRIBUTION; value: string; } |
setAttributions(options: { items: GlassfyAttributionItem[]; }) => Promise<void>| Param | Type |
|---|---|
options |
{ items: GlassfyAttributionItem[]; } |
_paywall(options: { remoteConfig: string; awaitLoading: boolean; }) => Promise<void>| Param | Type |
|---|---|
options |
{ remoteConfig: string; awaitLoading: boolean; } |
_closePaywall() => Promise<void>_openUrl(options: { url: string; }) => Promise<void>| Param | Type |
|---|---|
options |
{ url: string; } |
| Prop | Type |
|---|---|
version |
string |
| Prop | Type |
|---|---|
all |
GlassfyOffering[] |
| Prop | Type |
|---|---|
offeringId |
string |
skus |
GlassfySku[] |
| Prop | Type |
|---|---|
introductoryEligibility |
GLASSFY_ELEGIBILITY |
promotionalEligibility |
GLASSFY_ELEGIBILITY |
extravars |
{ [key: string]: string; } |
product |
GlassfyProduct |
basePlanId |
string |
offerId |
string |
discount |
GlassfyProductDiscount |
| Prop | Type |
|---|---|
title |
string |
identifier |
string |
description |
string |
price |
number |
currencyCode |
string |
period |
string |
introductoryPrice |
GlassfyProductDiscount |
discounts |
GlassfyProductDiscount[] |
basePlanId |
string |
| Prop | Type |
|---|---|
identifier |
string |
price |
number |
currencyCode |
string |
period |
string |
numberOfPeriods |
number |
type |
string |
| Prop | Type |
|---|---|
all |
GlassfyPurchaseHistory[] |
| Prop | Type |
|---|---|
productId |
string |
skuId |
string |
type |
GLASSFY_EVENT_TYPE |
store |
GLASSFY_STORE |
purchaseDate |
string |
expireDate |
string |
transactionId |
string |
subscriberId |
string |
currencyCode |
string |
countryCode |
string |
isInIntroOfferPeriod |
boolean |
promotionalOfferId |
string |
offerCodeRefName |
string |
licenseCode |
string |
webOrderLineItemId |
string |
| Prop | Type |
|---|---|
installationId |
string |
subscriberId |
string |
originalApplicationVersion |
string |
originalApplicationDate |
string |
all |
GlassfyPermission[] |
| Prop | Type |
|---|---|
permissionId |
string |
entitlement |
GLASSFY_ENTITLEMENT |
isValid |
boolean |
expireDate |
string |
accountableSkus |
GlassfyAccountableSku[] |
| Prop | Type |
|---|---|
isInIntroOfferPeriod |
boolean |
isInTrialPeriod |
boolean |
basePlanId |
string |
offerId |
string |
| Prop | Type |
|---|---|
skuId |
string |
productId |
string |
store |
GLASSFY_STORE |
| Prop | Type |
|---|---|
email |
string |
token |
boolean |
extra |
GlassfyExtraProperty |
| Prop | Type |
|---|---|
productId |
string |
receiptValidated |
boolean |
permissions |
GlassfyPermissions |
| Prop | Type |
|---|---|
all |
(GlassfyStoreInfo | GlassfyPaddleStoreInfo)[] |
| Prop | Type |
|---|---|
store |
Exclude<GLASSFY_STORE, GLASSFY_STORE.Paddle> |
extravars |
{ [key: string]: string; } |
| Prop | Type |
|---|---|
store |
GLASSFY_STORE.Paddle |
extravars |
{ [key: string]: string; } |
userid |
string |
planId |
string |
subscriptionId |
string |
updateURL |
string |
cancelURL |
string |
| Prop | Type |
|---|---|
type |
GLASSFY_ATTRIBUTION |
value |
string |
{ [key: string]: string }
Exclude from T those types that are assignable to U
T extends U ? never : T
| Members | Value |
|---|---|
OFF |
0 |
ERROR |
1 |
DEBUG |
2 |
INFO |
3 |
ALL |
3 |
| Members | Value |
|---|---|
ELEGIBLE |
1 |
NON_ELEGIBLE |
-1 |
UNKNOWN |
0 |
| Members | Value |
|---|---|
InitialBuy |
5001 |
Restarted |
5002 |
Renewed |
5003 |
Expired |
5004 |
DidChangeRenewalStatus |
5005 |
IsInBillingRetryPeriod |
5006 |
ProductChange |
5007 |
InAppPurchase |
5008 |
Refund |
5009 |
Paused |
5010 |
Resumed |
5011 |
ConnectLicense |
5012 |
DisconnectLicense |
5013 |
| Members | Value |
|---|---|
AppStore |
1 |
PlayStore |
2 |
Paddle |
3 |
Stripe |
4 |
Glassfy |
5 |
| Members | Value |
|---|---|
NEVERBUY |
-9 |
OTHERREFUND |
-8 |
ISSUEREFUND |
-7 |
UPGRADED |
-6 |
EXPIREDVOLUNTARY |
-5 |
PRODUCTNOTAVAILABLE |
-4 |
FAILTOACCEPTINCREASE |
-3 |
EXPIREDFROMBILLING |
-2 |
INRETRY |
-1 |
MISSINGINFO |
0 |
EXPIREDINGRACE |
1 |
OFFPLATFORM |
2 |
NONRENEWING |
3 |
AUTORENEWOFF |
4 |
AUTORENEWON |
5 |
| Members | Value |
|---|---|
UNKNOWN_REPLACEMENT_MODE |
0 |
WITH_TIME_PRORATION |
1 |
CHARGE_PRORATED_PRICE |
2 |
WITHOUT_PRORATION |
3 |
CHARGE_FULL_PRICE |
5 |
DEFERRED |
6 |
| Members | Value |
|---|---|
AdjustID |
1 |
AppsFlyerID |
2 |
IP |
3 |
IDFA |
4 |
IDFV |
5 |
GAID |
6 |
ASID |
7 |
AID |
8 |
