我正在使用此 Amplify 指南https://aws-amplify.github.io/docs/js/tutorials/building-react-native-apps/#connect-to-your-backend-1并且当我使用创建 API 时“aplify add api”应用程序失败。我正在使用“expo”,我正在使用 IphoneX 进行测试阶段。
我的应用程序代码是
import React, { Component } from 'react';
import { StyleSheet, Text, Button, View, Alert } from 'react-native';
import Amplify, { API } from 'aws-amplify';
import amplify from './aws-exports';
import awsmobile from './aws-exports';
import { withAuthenticator } from 'aws-amplify-react-native';
Amplify.configure(amplify);
Amplify.configure(awsmobile);
state = { apiResponse: null };
class App extends Component {
async getSample() {
const path = "/items"; // you can specify the path
const apiResponse = await …Run Code Online (Sandbox Code Playgroud)