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
Name | Type |
---|---|
name | string |
message | string |
responseCode? | number |
debugMessage? | string |
code? | ErrorCode |
productId? | string |
platform? | "ios" | "android" |
Defined in
Properties
code
• Optional
code: ErrorCode
Defined in
debugMessage
• Optional
debugMessage: string
Defined in
message
• message: string
Implementation of
Error.message
Defined in
name
• name: string
Implementation of
Error.name
Defined in
platform
• Optional
platform: "ios"
| "android"
Defined in
productId
• Optional
productId: string
Defined in
responseCode
• Optional
responseCode: number
Defined in
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
fromPlatformError
▸ Static
fromPlatformError(errorData
, platform
): PurchaseError
Creates a PurchaseError from platform-specific error data
Parameters
Name | Type | Description |
---|---|---|
errorData | any | Raw error data from native modules |
platform | "ios" | "android" | Platform where the error occurred |
Returns
Properly typed PurchaseError instance