setWalletDataSource
Call the setWalletDataSource API to set up a wallet data source for the MPP to obtain wallet data.
Method signature
public static func setWalletDataSource(_ dataSource: IAPAPWalletDataSource)Request parameters
Parameter | Type | Required | Description |
dataSource | Yes | The data source of the wallet. |
IAPAPWalletDataSource
public protocol IAPAPWalletDataSource {
func tokenCoverImage(for context: IAPAPWalletContext) -> CGImage?
func tokenTitle(for context: IAPAPWalletContext) -> String?
func tokenDisplayExtraInfo(for context: IAPAPWalletContext) -> [IAPAPTokenDisplayInfo]?
}Method | Parameter | Required | Return |
tokenCoverImage | context: Context information including the current action type and device information. | Optional | A CGImage used as the token cover art. |
tokenTitle | context: Context information including the current action type and device information. | Optional | A string representing the token title. |
tokenDisplayExtraInfo | context: Context information including the current action type and device information. | Optional | An array of extra display information items. This function returns |
Response parameters
N/A
Sample
IAPApplePay.setWalletDataSource(WalletDataSource())