To prepare the app for using the GraphQL API with AppSync you need to add the AWSAppSync CocoaPod to your app. In your code you need to import that framework and you need a new class to act as the authorization provider. It has one function to implement to get the latest authorization token and only takes a few lines.
- [Instructor] So we set everything we need to…on the server to use the API,…now we have to set up the app.…We could copy this line right here…to add the code generation,…but we've already added it when we pushed to the server.…But if we ever need to regenerate the code…we can run amplify codegen…and it'll download the schema again…and recreate our API.swift file.…We don't necessarily need to do that,…but we do need to do some other things to the app…to get it running.…So the first thing that we need to do…is add a new CocoaPod to our project.…
So I'll go back to the terminal…and our project directory…and I'm going to edit the VI Pod file…and after the current list of Pods…under AWS mobile client I'm going to add AWS app sync…and I'll add the version, 2.6.24.…Then I'll close this and run Pod install…and have it install that for us.…Now that that's ready we can go to Xcode…and update the code.…So in Xcode I'm going to need to update some things…in the app delegate…and on line 10 I'll add a new line under it.…
At line 11 I'll type import AWS app sync.…
- Working with the Amplify toolchain
- Creating a React app
- Adding analytics to a React app with Amplify
- User authentication via AWS
- Using Amplify to simplify account creation and management
- Creating a GraphQL API
- Storing files online
Skill Level Intermediate
AWS API Gateway with HTTP, Lambda, DynamoDB, and iOSwith Bear Cahill1h 33m Intermediate
1. AWS Amplify Overview
2. Amplified React App
3. Mobile App Features
4. Serverless Back End
5. Storing Files Online
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.