For applications using Reader SDK V1 in React Native, what is the recommended approach to place a card on file?

I am working on a React Native Application and I need to place a card on file. I can’t find instructions on how to do so in the Reader SDK documentation.

Here’s the link to our documentation on how to save a card on file with Reader SDK. :slightly_smiling_face:

Bryan, the link you shared is for a native java or swift project, the project I’m working on is on React Native, do you have any documentation for a React Native project?

You’ll want to use startStoreCardAsync to store a card for a customer.

For example:

import {
  startStoreCardAsync,
  StoreCustomerCardCancelled,
  StoreCustomerCardInvalidCustomerId,
  StoreCustomerCardSdkNotAuthorized,
  StoreCustomerCardNoNetwork,
  UsageError,
} from 'react-native-square-reader-sdk';
...
const customerId = 'DRYKVK5Y6H5R4JH9ZPQB3XPZQC';
try {
  const card = await startStoreCardAsync(customerId);
  // Customer's card is stored successfully and card infomation is available
} catch (ex) {
  let errorMessage = ex.message;
  switch (ex.code) {
    case StoreCustomerCardCancelled:
      // Handle canceled
      break;
    case StoreCustomerCardInvalidCustomerId:
      // Handle invalid customer id error
      break;
    case StoreCustomerCardNoNetwork:
      // Handle no network error
      break;
    case StoreCustomerCardSdkNotAuthorized:
      // Handle sdk not authorized
      break;
    default:
      if (__DEV__) {
        errorMessage += `\n\nDebug Message: ${ex.debugMessage}`;
        console.log(`${ex.code}:${ex.debugCode}:${ex.debugMessage}`);
      }
      Alert.alert('Error', errorMessage);
      break;
  }
}

:slightly_smiling_face: