The AWS AppSync SDK for iOS enables you to access your AWS AppSync backend and perform operations like Queries, Mutations, and Subscriptions. The SDK also includes support for offline operations. This SDK is based off of the Apollo project found here.
- Consuming through cocoapods:
- Add the following line to your Podfile:
pod 'AWSAppSync', '~> 2.6.19'
Example:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'EventsApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for EventsApp
pod 'AWSAppSync', '~> 2.6.19'
end
-
Run
pod installto install the AppSync SDK -
Now, open the
.xcworkspacefile and import the SDK usingimport AWSAppSync.
- Codegen
To use the AppSync SDK, you will need to use aws-appsync-codegen which helps generated a strongly typed API for your schema. You can find the instructions to use the codegen here: https://github.com/awslabs/aws-appsync-codegen
You can find a sample app which uses the AppSync SDK here: https://github.com/aws-samples/aws-mobile-appsync-events-starter-ios
You can find a step by step walk through of setting up a backend and accessing it via the iOS client here: https://awslabs.github.io/aws-mobile-appsync-sdk-ios/
Additional resources: https://docs.aws.amazon.com/appsync/latest/devguide/building-a-client-app.html
This library is licensed under the Amazon Software License.
