Skip to main content

PurchaseError

react-native-iap / Exports / PurchaseError

Class: PurchaseError

Implements

  • Error

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new PurchaseError(name, message, responseCode?, debugMessage?, code?, productId?, platform?)

Parameters

NameType
namestring
messagestring
responseCode?number
debugMessage?string
code?ErrorCode
productId?string
platform?"ios" | "android"

Defined in

purchaseError.ts:90

Properties

code

Optional code: ErrorCode

Defined in

purchaseError.ts:95


debugMessage

Optional debugMessage: string

Defined in

purchaseError.ts:94


message

message: string

Implementation of

Error.message

Defined in

purchaseError.ts:92


name

name: string

Implementation of

Error.name

Defined in

purchaseError.ts:91


platform

Optional platform: "ios" | "android"

Defined in

purchaseError.ts:97


productId

Optional productId: string

Defined in

purchaseError.ts:96


responseCode

Optional responseCode: number

Defined in

purchaseError.ts:93

Methods

getPlatformCode

getPlatformCode(): undefined | string | number

Gets the platform-specific error code for this error

Returns

undefined | string | number

Platform-specific error code

Defined in

purchaseError.ts:137


fromPlatformError

Static fromPlatformError(errorData, platform): PurchaseError

Creates a PurchaseError from platform-specific error data

Parameters

NameTypeDescription
errorDataanyRaw error data from native modules
platform"ios" | "android"Platform where the error occurred

Returns

PurchaseError

Properly typed PurchaseError instance

Defined in

purchaseError.ts:114