Now that the generated code, configuration, and CocoaPod are all in the project, you can write the necessary code in the app. First, you need to create a local database for the cache. This goes in the temporary directory in case the system needs memory, it can be created. You also need to specify the means for user credentials.
- [Instructor] Kind of like when we had to set up…our mobile client in the app delegate,…we also have to do some things for appsync.…So go to the AppDelgate.Swift,…and the first thing we want to do is up at the top…on line 11,…import the awsappsync framework.…We're going to want to create a new property…in the appdelegate.…So on line 17, we're going to add a new property called…appsyncclient,…this is a bar,…and it's type is awsappsyncclient,…and it's an optional.…
Then in our did finish launching with options,…there's a few things we need to do.…First we need to create URL for our local database.…This is where our cache will be stored for all our AWS data.…So on line 28,…I'm going to type 'let DBURL equal URL file URL with path',…and I'm going to pass in the temporary directory plus…thoughts.db.…So now we got the URL for that,…and in the do catch,…I'm going to create a few things.…The first thing I'm going to create is…the configuration.…
So I'll say 'let config equal awsappsyncclientconfiguation,…and we pass in couple of things.…
- Preparing to use AppSync in code
- Updating settings and the schema
- Adding a second data source
- Storing posts online
- Updating subscriptions in schema
- Testing live updates
- Handling updated posts
- Offline capabilities
Skill Level Intermediate
1. AWS User Authentication
2. AppSync Setup
Amplify codegen3m 42s
3. App Code and Configuration
4. Adding a Second Datasource
5. Real-Time Updates
- 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.