1.0.1 • Published 10 months ago

capacitor-plugin-glassfy-ryland v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

npm

Warning These plugin is for Capacitor 5. For Capacitor 4, use the 2.x version.

CapacitorJS Glassfy Plugin

Glassfy is a subscription revenue optimisation infrastructure for mobile applications.

Getting Started

Check the documentation at docs.glassfy.io to learn details on implementing and using Glassfy SDK.


Plugin Install

npm install capacitor-plugin-glassfy-ryland
npx cap sync

Build plugin and example

be 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

API

sdkVersion()

sdkVersion() => Promise<GlassfyVersion>

Returns: Promise<GlassfyVersion>


initialize(...)

initialize(options: { apiKey: string; watcherMode: boolean; }) => Promise<void>

For more details, follow instruction at https://docs.glassfy.io/get-started/configuration

ParamType
options{ apiKey: string; watcherMode: boolean; }

setLogLevel(...)

setLogLevel(options: { logLevel: GLASSFY_LOGLEVEL; }) => Promise<void>
ParamType
options{ logLevel: GLASSFY_LOGLEVEL; }

offerings()

offerings() => Promise<GlassfyOfferings>

For more details, check the documentation https://docs.glassfy.io/dashboard/configure-offerings

Returns: Promise<GlassfyOfferings>


purchaseHistory()

purchaseHistory() => Promise<GlassfyPurchasesHistory>

For more details, check the documentation https://docs.glassfy.io/dashboard/configure-offerings

Returns: Promise<GlassfyPurchasesHistory>


permissions()

permissions() => Promise<GlassfyPermissions>

For more details, check the documentation https://docs.glassfy.io/dashboard/configure-permissions.html

Returns: Promise<GlassfyPermissions>


skuWithId(...)

skuWithId(options: { identifier: string; }) => Promise<GlassfySku>

For more details, check the documentation https://docs.glassfy.io/dashboard/configure-products

ParamType
options{ identifier: string; }

Returns: Promise<GlassfySku>


skuWithIdAndStore(...)

skuWithIdAndStore(options: { identifier: string; store: GLASSFY_STORE; }) => Promise<GlassfySkuBase>
ParamType
options{ identifier: string; store: GLASSFY_STORE; }

Returns: Promise<GlassfySkuBase>


connectCustomSubscriber(...)

connectCustomSubscriber(options: { subscriberId: string; }) => Promise<GlassfySku>
ParamType
options{ subscriberId: string; }

Returns: Promise<GlassfySku>


connectPaddleLicenseKey(...)

connectPaddleLicenseKey(options: { licenseKey: string; force: boolean; }) => Promise<void>
ParamType
options{ licenseKey: string; force: boolean; }

connectGlassfyUniversalCode(...)

connectGlassfyUniversalCode(options: { universalCode: string; force: boolean; }) => Promise<void>
ParamType
options{ universalCode: string; force: boolean; }

setEmailUserProperty(...)

setEmailUserProperty(options: { email: string; }) => Promise<void>
ParamType
options{ email: string; }

setDeviceToken(...)

setDeviceToken(options: { token: string; }) => Promise<void>
ParamType
options{ token: string; }

setExtraUserProperty(...)

setExtraUserProperty(options: { extra: GlassfyExtraProperty; }) => Promise<void>
ParamType
options{ extra: GlassfyExtraProperty; }

getUserProperty()

getUserProperty() => Promise<GlassfyUserProperties>

Returns: Promise<GlassfyUserProperties>


purchaseSku(...)

purchaseSku(options: { sku: GlassfySku; skuToUpgrade?: GlassfySku; prorationMode?: GLASSFY_PRORATION_MODE; }) => Promise<GlassfyTransaction>
ParamType
options{ sku: GlassfySku; skuToUpgrade?: GlassfySku; prorationMode?: GLASSFY_PRORATION_MODE; }

Returns: Promise<GlassfyTransaction>


restorePurchases()

restorePurchases() => Promise<GlassfyPermissions>

Returns: Promise<GlassfyPermissions>


setAttribution(...)

setAttribution(options: { type: GLASSFY_ATTRIBUTION; value: string; }) => Promise<void>
ParamType
options{ type: GLASSFY_ATTRIBUTION; value: string; }

setAttributions(...)

setAttributions(options: { items: GlassfyAttributionItem[]; }) => Promise<void>
ParamType
options{ items: GlassfyAttributionItem[]; }

_paywall(...)

_paywall(options: { remoteConfig: String; awaitLoading: Boolean; }) => Promise<void>
ParamType
options{ remoteConfig: String; awaitLoading: Boolean; }

_closePaywall()

_closePaywall() => Promise<void>

_openUrl(...)

_openUrl(options: { url: String; }) => Promise<void>
ParamType
options{ url: String; }

Interfaces

GlassfyVersion

PropType
versionstring

GlassfyOfferings

PropType
allGlassfyOffering[]

GlassfyOffering

PropType
offeringIdstring
skusGlassfySku[]

GlassfySku

PropType
introductoryEligibilityGLASSFY_ELEGGIBILITY
promotionalEligibilityGLASSFY_ELEGGIBILITY
extravars{ key: string: string; }
productGlassfyProduct

GlassfyProduct

PropType
titlestring
identifierstring
descriptionstring
pricenumber
currencyCodestring
introductoryPriceGlassfyProductDiscount
discountsGlassfyProductDiscount[]

GlassfyProductDiscount

PropType
identifierstring
pricenumber
currencyCodestring
periodstring
numberOfPeriodsnumber
typestring

GlassfyPurchasesHistory

PropType
allGlassfyPurchaseHistory[]

GlassfyPurchaseHistory

PropType
productIdstring
skuIdstring
typeGLASSFY_EVENT_TYPE
storeGLASSFY_STORE
purchaseDatestring
expireDatestring
transactionIdstring
subscriberIdstring
currencyCodestring
countryCodestring
isInIntroOfferPeriodboolean
promotionalOfferIdstring
offerCodeRefNamestring
licenseCodestring
webOrderLineItemIdstring

GlassfyPermissions

PropType
installationIdstring
subscriberIdstring
originalApplicationVersionstring
originalApplicationDatestring
allGlassfyPermission[]

GlassfyPermission

PropType
permissionIdstring
entitlementGLASSFY_ENTITLEMENT
isValidboolean
expireDatestring
accountableSkusGlassfyAccountableSku[]

GlassfyAccountableSku

PropType
isInIntroOfferPeriodboolean
isInTrialPeriodboolean

GlassfySkuBase

PropType
skuIdstring
productIdstring
storeGLASSFY_STORE

GlassfyUserProperties

PropType
emailString
tokenboolean
extraGlassfyExtraProperty

String

Allows manipulation and formatting of text strings and determination and location of substrings within strings.

PropTypeDescription
lengthnumberReturns the length of a String object.
MethodSignatureDescription
toString() => stringReturns a string representation of a string.
charAt(pos: number) => stringReturns the character at the specified index.
charCodeAt(index: number) => numberReturns the Unicode value of the character at the specified location.
concat(...strings: string[]) => stringReturns a string that contains the concatenation of two or more strings.
indexOf(searchString: string, position?: number | undefined) => numberReturns the position of the first occurrence of a substring.
lastIndexOf(searchString: string, position?: number | undefined) => numberReturns the last occurrence of a substring in the string.
localeCompare(that: string) => numberDetermines whether two strings are equivalent in the current locale.
match(regexp: string | RegExp) => RegExpMatchArray | nullMatches a string with a regular expression, and returns an array containing the results of that search.
replace(searchValue: string | RegExp, replaceValue: string) => stringReplaces text in a string, using a regular expression or search string.
replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string) => stringReplaces text in a string, using a regular expression or search string.
search(regexp: string | RegExp) => numberFinds the first substring match in a regular expression search.
slice(start?: number | undefined, end?: number | undefined) => stringReturns a section of a string.
split(separator: string | RegExp, limit?: number | undefined) => string[]Split a string into substrings using the specified separator and return them as an array.
substring(start: number, end?: number | undefined) => stringReturns the substring at the specified location within a String object.
toLowerCase() => stringConverts all the alphabetic characters in a string to lowercase.
toLocaleLowerCase(locales?: string | string[] | undefined) => stringConverts all alphabetic characters to lowercase, taking into account the host environment's current locale.
toUpperCase() => stringConverts all the alphabetic characters in a string to uppercase.
toLocaleUpperCase(locales?: string | string[] | undefined) => stringReturns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale.
trim() => stringRemoves the leading and trailing white space and line terminator characters from a string.
substr(from: number, length?: number | undefined) => stringGets a substring beginning at the specified location and having the specified length.
valueOf() => stringReturns the primitive value of the specified object.

RegExpMatchArray

PropType
indexnumber
inputstring

RegExp

PropTypeDescription
sourcestringReturns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal.
globalbooleanReturns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only.
ignoreCasebooleanReturns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only.
multilinebooleanReturns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only.
lastIndexnumber
MethodSignatureDescription
exec(string: string) => RegExpExecArray | nullExecutes a search on a string using a regular expression pattern, and returns an array containing the results of that search.
test(string: string) => booleanReturns a Boolean value that indicates whether or not a pattern exists in a searched string.
compile() => this

RegExpExecArray

PropType
indexnumber
inputstring

GlassfyTransaction

PropType
productIdstring
receiptValidatedboolean
permissionsGlassfyPermissions

GlassfyAttributionItem

PropType
typeGLASSFY_ATTRIBUTION
valuestring

Boolean

MethodSignatureDescription
valueOf() => booleanReturns the primitive value of the specified object.

Type Aliases

GlassfyExtraProperty

{ key: string: string }

Enums

GLASSFY_LOGLEVEL

MembersValue
OFF0
ERROR1
DEBUG2
INFO3
ALL3

GLASSFY_ELEGGIBILITY

MembersValue
ELEGIBLE1
NON_ELEGIBLE-1
UNKNOWN0

GLASSFY_EVENT_TYPE

MembersValue
InitialBuy5001
Restarted5002
Renewed5003
Expired5004
DidChangeRenewalStatus5005
IsInBillingRetryPeriod5006
ProductChange5007
InAppPurchase5008
Refund5009
Paused5010
Resumed5011
ConnectLicense5012
DisconnectLicense5013

GLASSFY_STORE

MembersValue
AppStore1
PlayStore2
Paddle3
Stripe4
Glassfy5

GLASSFY_ENTITLEMENT

MembersValue
NEVERBUY-9
OTHERREFUND-8
ISSUEREFUND-7
UPGRADED-6
EXPIREDVOLUNTARY-5
PRODUCTNOTAVAILABLE-4
FAILTOACCEPTINCREASE-3
EXPIREDFROMBILLING-2
INRETRY-1
MISSINGINFO0
EXPIREDINGRACE1
OFFPLATFORM2
NONRENEWING3
AUTORENEWOFF4
AUTORENEWON5

GLASSFY_PRORATION_MODE

MembersValue
UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY0
IMMEDIATE_WITH_TIME_PRORATION1
IMMEDIATE_AND_CHARGE_PRORATED_PRICE2
IMMEDIATE_WITHOUT_PRORATION3
DEFERRED4
IMMEDIATE_AND_CHARGE_FULL_PRICE5

GLASSFY_ATTRIBUTION

MembersValue
AdjustID1
AppsFlyerID2
IP3
IDFA4
IDFV5
GAID6
ASID7
AID8
1.0.1

10 months ago

1.0.0

10 months ago