日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

基于 Amazon Amplify 构建自己的首个 iOS 应用程序(二)

發布時間:2023/12/20 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 基于 Amazon Amplify 构建自己的首个 iOS 应用程序(二) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

目錄

三、添加身份驗證

3.1 創建身份驗證服務

3.2 部署身份驗證服務

3.3 向項目添加 Amplify 身份驗證庫

3.4 在運行時配置 Amplify 身份驗證庫

3.5 在運行時觸發身份驗證

四、添加 API 和數據庫

4.1 創建 GraphQL API 及數據庫

4.2 生成客戶端代碼

4.3 部署 API 服務和數據庫

4.4 將 API 客戶端庫添加到 Xcode 項目中

4.5 在運行時初始化 Amplify 庫

4.6 在 GraphQL 數據模型和應用程序模型之間添加橋接

4.7 將 API CRUD 方法添加到后端類中

4.8 添加“Edit”按鈕以添加備注

4.9 添加“滑動刪除”行為

4.10 構建和測試

五、添加存儲

5.1 創建存儲服務

5.2 部署存儲服務

5.3 向Xcode項目中添加 Amplify 存儲庫

5.4 在運行時初始化 Amplify 存儲插件

5.5 將 Image CRUD 方法添加到后端類

5.6 API 檢索數據時加載圖像

5.7 添加 UI 代碼以捕獲圖像

5.8 創建備注時存儲圖像

5.9 構建和測試

結論


《基于 Amazon Amplify 構建自己的首個 iOS 應用程序(一)》

三、添加身份驗證

接下來,我們了解如何使用 Amplify CLI 和庫對用戶進行身份驗證,以利用托管用戶身份提供商 Amazon Cognito。另外,知道如何使用 Cognito 托管用戶界面展示整個用戶身份驗證流,從而使用戶只需幾行代碼即可注冊、登錄和重置密碼。使用“托管用戶界面”意味著應用程序利用 Cognito 網頁登錄和注冊用戶界面流。應用程序的用戶將重定向到 Cognito 托管的網頁,并在登錄后重定向回應用程序。當然,Cognito 和 Amplify 也支持本機 UI。

3.1 創建身份驗證服務

創建身份驗證服務,打開一個命令行終端,然后執行如下命令:

amplify add auth

輸出結果出現 successful 字樣表示創建成功。

3.2 部署身份驗證服務

現在,我們已在本地配置身份驗證服務,我們可以將它部署到云。在終端中,在項目目錄中執行以下命令:

amplify push

3.3 向項目添加 Amplify 身份驗證庫

在轉至代碼之前,將 Amplify 身份驗證庫添加到項目的依賴項中。打開 Podfile 文件,然后使用 AmplifyPlugins/AWSCognitoAuthPlugin 添加行,或者復制并粘貼以下整個文件。

# you need at least version 13.0 for this tutorial, more recent versions are valid too platform :ios, '13.0'target 'getting started' do# Comment the next line if you don't want to use dynamic frameworksuse_frameworks!# Pods for getting startedpod 'Amplify', '~> 1.0' # required amplify dependencypod 'Amplify/Tools', '~> 1.0' # allows to call amplify CLI from within Xcodepod 'AmplifyPlugins/AWSCognitoAuthPlugin', '~> 1.0' # support for Cognito user authenticationend

在終端中執行以下命令:

pod install

3.4 在運行時配置 Amplify 身份驗證庫

返回到 Xcode,打開 Backend.swift 文件,其完整代碼如下所示:

// at the top of the file import AmplifyPluginsprivate init () {// initialize amplifydo {try Amplify.add(plugin: AWSCognitoAuthPlugin())try Amplify.configure()print("Initialized Amplify")} catch {print("Could not initialize Amplify: \(error)")} }

構建項目,保證不報錯即可。

3.5 在運行時觸發身份驗證

其余代碼更改會跟蹤用戶的狀態,并在用戶未登錄時觸發登錄/注冊用戶界面。 添加登錄和注銷代碼,在后端類中的任意位置,添加以下三種方法:

// signin with Cognito web user interface public func signIn() {_ = Amplify.Auth.signInWithWebUI(presentationAnchor: UIApplication.shared.windows.first!) { result inswitch result {case .success(_):print("Sign in succeeded")case .failure(let error):print("Sign in failed \(error)")}} }// signout public func signOut() {_ = Amplify.Auth.signOut() { (result) inswitch result {case .success:print("Successfully signed out")case .failure(let error):print("Sign out failed with error \(error)")}} }// change our internal state, this triggers an UI update on the main thread func updateUserData(withSignInStatus status : Bool) {DispatchQueue.main.async() {let userData : UserData = .shareduserData.isSignedIn = status} }

為了跟蹤身份驗證狀態的變化,我們添加了代碼以訂閱由 Amplify 發送的身份驗證事件。我們在 Backend.init() 方法中初始化該中心。在收到身份驗證事件時,我們將調用 updateUserData() 方法。此方法可使 UserData 對象保持同步。UserData.isSignedIn 屬性為 @Published,這意味著當值更改時,用戶界面會自動刷新。 我們可以添加代碼以在應用程序啟動時檢查以前的身份驗證狀態。當應用程序啟動時,它會檢查 Cognito 會話是否已存在,并相應地更新 UI。

在 Backend.init() 中,請在 Amplify 初始化后添加以下代碼:

// in private init() function // listen to auth events. // see https://github.com/aws-amplify/amplify-ios/blob/master/Amplify/Categories/Auth/Models/AuthEventName.swift _ = Amplify.Hub.listen(to: .auth) { (payload) inswitch payload.eventName {case HubPayload.EventName.Auth.signedIn:print("==HUB== User signed In, update UI")self.updateUserData(withSignInStatus: true)case HubPayload.EventName.Auth.signedOut:print("==HUB== User signed Out, update UI")self.updateUserData(withSignInStatus: false)case HubPayload.EventName.Auth.sessionExpired:print("==HUB== Session expired, show sign in UI")self.updateUserData(withSignInStatus: false)default://print("==HUB== \(payload)")break} }// let's check if user is signedIn or not_ = Amplify.Auth.fetchAuthSession { (result) indo {let session = try result.get()// let's update UserData and the UIself.updateUserData(withSignInStatus: session.isSignedIn)} catch {print("Fetch auth session failed with error - \(error)")} }

代碼中的最后一個更改與用戶界面相關,我們將 ZStack 添加到 ContentView。根據UserData.isSignedIn 的值,UI 將顯示 SigninButton 或主列表視圖。打開 ContentView.swift 并替換 ContentView 結構中的正文:

var body: some View {ZStack {if (userData.isSignedIn) {NavigationView {List {ForEach(userData.notes) { note inListRow(note: note)}}.navigationBarTitle(Text("Notes")).navigationBarItems(leading: SignOutButton())}} else {SignInButton()}} }

在同一文件中,添加 SignInButton 和 SignOutButton 視圖:

struct SignInButton: View {var body: some View {Button(action: { Backend.shared.signIn() }){HStack {Image(systemName: "person.fill").scaleEffect(1.5).padding()Text("Sign In").font(.largeTitle)}.padding().foregroundColor(.white).background(Color.green).cornerRadius(30)}} }struct SignOutButton : View {var body: some View {Button(action: { Backend.shared.signOut() }) {Text("Sign Out")}} }

最后,我們必須確保在 Cognito 托管用戶界面提供的 Web 身份驗證序列結束時啟動我們的應用程序。我們將 gettingstarted URI 方案添加到應用程序的 Info.plist 文件中。在 Xcode 中,選擇 Info.plist 文件,右鍵單擊該文件,然后選擇“打開為源代碼”。

另外,在頂部 <dict> 元素內添加以下 <key> 和 <array> 元素。

<plist version="1.0"><dict><!-- YOUR OTHER PLIST ENTRIES HERE --><!-- ADD AN ENTRY TO CFBundleURLTypes for Cognito Auth --><!-- IF YOU DO NOT HAVE CFBundleURLTypes, YOU CAN COPY THE WHOLE BLOCK BELOW --><key>CFBundleURLTypes</key><array><dict><key>CFBundleURLSchemes</key><array><string>gettingstarted</string></array></dict></array><!-- ... --></dict>

然后,運行程序看看效果,整個注冊流程如下圖所示:

四、添加 API 和數據庫

現在,我們已經創建并配置了帶用戶身份驗證功能的應用程序。接下來,我們要在數據庫中添加 API 以及“創建”、“讀取”、“更新”、“刪除”(CRUD) 操作。

4.1 創建 GraphQL API 及數據庫

要創建 GraphQL API 及其數據庫,打開一個命令行終端,然后從項目目錄中執行如下命令:

amplify add api

初始化項目時選擇的默認文本編輯器 (amplify init) 將使用預構建數據 schema 打開。刪除此 schema,并使用我們的應用程序 GraphQL schema 替換:

type NoteData @model @auth (rules: [ { allow: owner } ]) {id: ID!name: String!description: Stringimage: String }

4.2 生成客戶端代碼

根據我們剛剛創建的 GraphQL 數據模型定義,Amplify 會生成客戶端代碼(即 Swift 代碼)以代表我們應用程序中的數據。要生成代碼,在終端執行以下命令:

amplify codegen models

在 Finder 中找到新生成的文件,然后將其拖放到 Xcode 的項目中。

4.3 部署 API 服務和數據庫

要部署我們剛剛創建的后端 API 和數據庫,打開終端,然后執行如下命令:

amplify push

4.4 將 API 客戶端庫添加到 Xcode 項目中

在轉至代碼之前,將 Amplify API 庫添加到項目的依賴項中。打開 Podfile 文件,然后使用 AmplifyPlugins/AWSAPIPlugin 添加行,或者復制并粘貼以下整個文件。

# you need at least version 13.0 for this tutorial, more recent versions are valid too platform :ios, '13.0'target 'getting started' do# Comment the next line if you don't want to use dynamic frameworksuse_frameworks!# Pods for getting startedpod 'Amplify', '~> 1.0' # required amplify dependencypod 'Amplify/Tools', '~> 1.0' # allows to call amplify CLI from within Xcodepod 'AmplifyPlugins/AWSCognitoAuthPlugin', '~> 1.0' # support for Cognito user authenticationpod 'AmplifyPlugins/AWSAPIPlugin', '~> 1.0' # support for GraphQL APIend

然后,執行如下命令:

pod install

4.5 在運行時初始化 Amplify 庫

返回到 Xcode,打開 Backend.swift,然后在私有 init() 方法的 Amplify 初始化序列中添加一行。完整代碼塊應如下所示:

// initialize amplify do {try Amplify.add(plugin: AWSCognitoAuthPlugin())try Amplify.add(plugin: AWSAPIPlugin(modelRegistration: AmplifyModels()))try Amplify.configure()print("Initialized Amplify") } catch {print("Could not initialize Amplify: \(error)") }

4.6 在 GraphQL 數據模型和應用程序模型之間添加橋接

我們的項目已經有一個數據模型來表示備注。因此,可以繼續使用該模型,并提供一種將 NoteData 轉換為備注的簡單方法。打開 ContentView.swift 并將此初始化程序添加到備注類中。

convenience init(from data: NoteData) {self.init(id: data.id, name: data.name, description: data.description, image: data.image)// store API object for easy retrieval laterself._data = data }fileprivate var _data : NoteData?// access the privately stored NoteData or build one if we don't have one. var data : NoteData {if (_data == nil) {_data = NoteData(id: self.id,name: self.name,description: self.description,image: self.imageName)}return _data! }

4.7 將 API CRUD 方法添加到后端類中

我們添加 3 種方法來調用 API:一種查詢 Note 的方法,一種創建新 Note 的方法,以及一種刪除 Note 的方法。請注意,這些方法適用于應用程序數據模型(備注),以便從用戶界面輕松交互。這些方法可透明地將 Note 轉換為 GraphQL 的 NoteData 對象。

打開 Backend.swift 文件,然后在后端類末尾添加以下 snipet:

// MARK: API Accessfunc queryNotes() {_ = Amplify.API.query(request: .list(NoteData.self)) { event inswitch event {case .success(let result):switch result {case .success(let notesData):print("Successfully retrieved list of Notes")// convert an array of NoteData to an array of Note class instancesfor n in notesData {let note = Note.init(from: n)DispatchQueue.main.async() {UserData.shared.notes.append(note)}}case .failure(let error):print("Can not retrieve result : error \(error.errorDescription)")}case .failure(let error):print("Can not retrieve Notes : error \(error)")}}}func createNote(note: Note) {// use note.data to access the NoteData instance_ = Amplify.API.mutate(request: .create(note.data)) { event inswitch event {case .success(let result):switch result {case .success(let data):print("Successfully created note: \(data)")case .failure(let error):print("Got failed result with \(error.errorDescription)")}case .failure(let error):print("Got failed event with error \(error)")}}}func deleteNote(note: Note) {// use note.data to access the NoteData instance_ = Amplify.API.mutate(request: .delete(note.data)) { event inswitch event {case .success(let result):switch result {case .success(let data):print("Successfully deleted note: \(data)")case .failure(let error):print("Got failed result with \(error.errorDescription)")}case .failure(let error):print("Got failed event with error \(error)")}}}

在同一 Backend.swift 文件中,更新 updateUserData(withSignInStatus:) 方法如下所示:

// change our internal state, this triggers an UI update on the main thread func updateUserData(withSignInStatus status : Bool) {DispatchQueue.main.async() {let userData : UserData = .shareduserData.isSignedIn = status// when user is signed in, query the database, otherwise empty our modelif status {self.queryNotes()} else {userData.notes = []}} }

現在,只需創建一個用戶界面即可創建新 Note 和從列表中刪除 Note。

4.8 添加“Edit”按鈕以添加備注

現在,后端和數據模型已到位,最后一步是讓用戶創建新的 Note 然后將其刪除。在 Xcode 中,打開 ContentView.swift,在 ContentView 結構中,添加綁定到用戶界面的狀態變量。

// add at the begining of ContentView class @State var showCreateNote = false@State var name : String = "New Note" @State var description : String = "This is a new note" @State var image : String = "image"

在文件中的任何位置,添加視圖結構,以允許用戶創建新的備注:

struct AddNoteView: View {@Binding var isPresented: Boolvar userData: UserData@State var name : String = "New Note"@State var description : String = "This is a new note"@State var image : String = "image"var body: some View {Form {Section(header: Text("TEXT")) {TextField("Name", text: $name)TextField("Name", text: $description)}Section(header: Text("PICTURE")) {TextField("Name", text: $image)}Section {Button(action: {self.isPresented = falselet noteData = NoteData(id : UUID().uuidString,name: self.$name.wrappedValue,description: self.$description.wrappedValue)let note = Note(from: noteData)// asynchronously store the note (and assume it will succeed)Backend.shared.createNote(note: note)// add the new note in our userdata, this will refresh UIself.userData.notes.append(note)}) {Text("Create this note")}}}} }

在導航欄上添加“+”按鈕演示數據表以創建備注,返回 ContentView 結構,將 navigationBarItems(leading SignOutButton()) 替換為:

.navigationBarItems(leading: SignOutButton(),trailing: Button(action: {self.showCreateNote.toggle()}) {Image(systemName: "plus")}) }.sheet(isPresented: $showCreateNote) {AddNoteView(isPresented: self.$showCreateNote, userData: self.userData)

4.9 添加“滑動刪除”行為

最后,在 ContentView 中添加“輕掃以刪除”行為:將 .onDelete { } 方法添加到 ForEach 結構中:

ForEach(userData.notes) { note inListRow(note: note) }.onDelete { indices inindices.forEach {// removing from user data will refresh UIlet note = self.userData.notes.remove(at: $0)// asynchronously remove from databaseBackend.shared.deleteNote(note: note)} }

4.10 構建和測試

首先,編譯程序,保證不出現報錯。然后,運行程序,整個完整流程如下圖所示:

五、添加存儲

現在,我們的備注應用程序已在運行,接下來添加將圖像與每個備注關聯的功能。在本模塊中,將使用 Amplify CLI 和庫來創建利用 Amazon S3 的存儲服務。最后,將更新 iOS 應用程序以啟用圖像上傳、獲取和渲染。

5.1 創建存儲服務

要添加圖像存儲功能,我們將使用 Amplify 存儲類別,執行如下命令:

amplify add storage

5.2 部署存儲服務

要部署我們剛剛創建的存儲服務,打開終端,然后執行以下命令:

amplify push

5.3 向Xcode項目中添加 Amplify 存儲庫

在轉至代碼之前,將 Amplify 存儲庫添加到項目的依賴項中。打開 Podfile 文件,然后使用 AmplifyPlugins/AWSS3StoragePlugin 添加行,或者復制并粘貼以下整個文件。

# you need at least version 13.0 for this tutorial, more recent versions are valid too platform :ios, '13.0'target 'getting started' do# Comment the next line if you don't want to use dynamic frameworksuse_frameworks!# Pods for getting startedpod 'Amplify', '~> 1.0' # required amplify dependencypod 'Amplify/Tools', '~> 1.0' # allows to call amplify CLI from within Xcodepod 'AmplifyPlugins/AWSCognitoAuthPlugin', '~> 1.0' # support for Cognito user authenticationpod 'AmplifyPlugins/AWSAPIPlugin', '~> 1.0' # support for GraphQL APIpod 'AmplifyPlugins/AWSS3StoragePlugin', '~> 1.0' # support for Amazon S3 storageend

然后,執行如下命令:

pod install

5.4 在運行時初始化 Amplify 存儲插件

返回 Xcode,打開 Backend.swift,然后在私有 init() 方法的 Amplify 初始化序列中添加一行。完整代碼塊應如下所示:

// initialize amplify do {try Amplify.add(plugin: AWSCognitoAuthPlugin())try Amplify.add(plugin: AWSAPIPlugin(modelRegistration: AmplifyModels()))try Amplify.add(plugin: AWSS3StoragePlugin())try Amplify.configure()print("Initialized Amplify"); } catch {print("Could not initialize Amplify: \(error)") }

5.5 將 Image CRUD 方法添加到后端類

打開 Backend.Swift。在后端類中的任意位置,添加以下方法:

func storeImage(name: String, image: Data) {// let options = StorageUploadDataRequest.Options(accessLevel: .private)let _ = Amplify.Storage.uploadData(key: name, data: image,// options: options,progressListener: { progress in// optionlly update a progress bar here}, resultListener: { event inswitch event {case .success(let data):print("Image upload completed: \(data)")case .failure(let storageError):print("Image upload failed: \(storageError.errorDescription). \(storageError.recoverySuggestion)")}}) }func retrieveImage(name: String, completed: @escaping (Data) -> Void) {let _ = Amplify.Storage.downloadData(key: name,progressListener: { progress in// in case you want to monitor progress}, resultListener: { (event) inswitch event {case let .success(data):print("Image \(name) loaded")completed(data)case let .failure(storageError):print("Can not download image: \(storageError.errorDescription). \(storageError.recoverySuggestion)")}}) }func deleteImage(name: String) {let _ = Amplify.Storage.remove(key: name,resultListener: { (event) inswitch event {case let .success(data):print("Image \(data) deleted")case let .failure(storageError):print("Can not delete image: \(storageError.errorDescription). \(storageError.recoverySuggestion)")}}) }

5.6 API 檢索數據時加載圖像

現在,后端函數已經可用,我們接下來在 API 調用返回結果時加載圖像。添加此行為的中心位置是,應用程序通過 API 返回的 NoteData 構造備注 UI 時。打開 ContentView.swift 并更新備注的初始化程序(添加第 8 行至第 17 行):

// add a publishable's object property @Published var image : Image?// update init's code convenience init(from data: NoteData) {self.init(id: data.id, name: data.name, description: data.description, image: data.image)if let name = self.imageName {// asynchronously download the imageBackend.shared.retrieveImage(name: name) { (data) in// update the UI on the main threadDispatchQueue.main.async() {let uim = UIImage(data: data)self.image = Image(uiImage: uim!)}}}// store API object for easy retrieval laterself._data = data }

當備注實例中存在圖像名稱時,代碼將調用 retrieveImage,它是一個異步函數。下載圖像時需要調用一個函數,該函數創建一個圖像 UI 對象并將其分配給備注實例。請注意,此分配會觸發用戶界面更新,因此會在應用程序的主線程中使用 DispatchQueue.main.async 進行更新。

5.7 添加 UI 代碼以捕獲圖像

首先,我們添加通用代碼以支持圖像捕獲。此代碼可在許多應用程序中重復使用;它顯示了一個圖像選擇器,允許用戶從其圖像庫中選擇圖像。在 Xcode 中,創建新的 Swift 文件(?N,然后選擇 Swift)。命名 CaptureImageView.swift 文件,然后添加此代碼:

import Foundation import UIKit import SwiftUIstruct CaptureImageView {/// MARK: - Properties@Binding var isShown: Bool@Binding var image: UIImage?func makeCoordinator() -> Coordinator {return Coordinator(isShown: $isShown, image: $image)} }class Coordinator: NSObject, UINavigationControllerDelegate, UIImagePickerControllerDelegate {@Binding var isCoordinatorShown: Bool@Binding var imageInCoordinator: UIImage?init(isShown: Binding<Bool>, image: Binding<UIImage?>) {_isCoordinatorShown = isShown_imageInCoordinator = image}func imagePickerController(_ picker: UIImagePickerController,didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {guard let unwrapImage = info[UIImagePickerController.InfoKey.originalImage] as? UIImage else { return }imageInCoordinator = unwrapImageisCoordinatorShown = false}func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {isCoordinatorShown = false} }extension CaptureImageView: UIViewControllerRepresentable {func makeUIViewController(context: UIViewControllerRepresentableContext<CaptureImageView>) -> UIImagePickerController {let picker = UIImagePickerController()picker.delegate = context.coordinator// picker.sourceType = .camera // on real devices, you can capture image from the camera// see https://medium.com/better-programming/how-to-pick-an-image-from-camera-or-photo-library-in-swiftui-a596a0a2ecereturn picker}func updateUIViewController(_ uiViewController: UIImagePickerController,context: UIViewControllerRepresentableContext<CaptureImageView>) {} }

5.8 創建備注時存儲圖像

創建備注時,我們從后端調用存儲方法。打開 ContentView.swift 并修改 AddNoteView 以添加 ImagePicker 組件:

// at the start of the Content View struct @State var image : UIImage? // replace the previous declaration of image @State var showCaptureImageView = false// in the view, replace the existing PICTURE section Section(header: Text("PICTURE")) {VStack {Button(action: {self.showCaptureImageView.toggle()}) {Text("Choose photo")}.sheet(isPresented: $showCaptureImageView) {CaptureImageView(isShown: self.$showCaptureImageView, image: self.$image)}if (image != nil ) {HStack {Spacer()Image(uiImage: image!).resizable().frame(width: 250, height: 200).clipShape(Circle()).overlay(Circle().stroke(Color.white, lineWidth: 4)).shadow(radius: 10)Spacer()}}} }

修改“創建備注”部分以存儲圖像和備注:

Section {Button(action: {self.isPresented = falselet note = Note(id : UUID().uuidString,name: self.$name.wrappedValue,description: self.$description.wrappedValue)if let i = self.image {note.imageName = UUID().uuidStringnote.image = Image(uiImage: i)// asynchronously store the image (and assume it will work)Backend.shared.storeImage(name: note.imageName!, image: (i.pngData())!)}// asynchronously store the note (and assume it will succeed)Backend.shared.createNote(note: note)// add the new note in our userdata, this will refresh UIwithAnimation { self.userData.notes.append(note) }}) {Text("Create this note")} }

5.9 構建和測試

首先,編譯程序,保證不出現報錯。然后,運行程序,整個完整流程如下圖所示:

結論

至此,我們已經體驗了使用 Amazon Amplify 構建 iOS 應用程序的過程! 在應用程序中添加了身份驗證,用戶可以注冊、登錄和管理其賬戶。該應用程序還使用 Amazon DynamoDB 數據庫配置了一個可擴展的 GraphQL API,用戶可以創建和刪除備注。另外,還使用 Amazon S3 添加了文件存儲,從而使用戶可以上傳圖像并在其應用程序中查看它們。但是,使用過程中也出現了很多小插曲,非常耽誤時間,由于篇幅的限制,我簡單說兩點:一、Xcode 版本兼容性問題。最開始我使用低于11.5的版本,遇到了很多編譯錯誤,最后升級到11.5才解決。因此,體驗時要保證一個較高的Xcode版本,這一點應該在官方文檔中說明;二、信用卡注冊問題。服務中國客戶,亞馬遜應該入鄉隨俗,提供更加人性化的注冊方式,可以考慮支付寶或者微信登陸注冊,這樣會比較符合大家的習慣。別的方面還比較順利,感興趣的話,小伙伴們就自己動手嘗試一下吧!

另外,亞馬遜云科技專為開發者們打造了多種學習平臺:

1. 入門資源中心:從0到1 輕松上手云服務,內容涵蓋:成本管理,上手訓練,開發資源。AWS入門_AWS入門使用教程_AWS云計算資源-AWS云服務

2. 架構中心:亞馬遜云科技架構中心提供了云平臺參考架構圖表、經過審查的架構解決方案、Well-Architected 最佳實踐、模式、圖標等。AWS架構中心部署說明_AWS云架構白皮書-AWS云服務

3. 構建者庫:了解亞馬遜云科技如何構建和運營軟件。Amazon Builders' Library

4. 用于在亞馬遜云科技平臺上開發和管理應用程序的工具包:aws工具下載_aws開發工具_資源下載-AWS云服務

?

【專屬福利】

福利一:100余種產品免費套餐。其中,計算資源Amazon EC2首年12個月免費,750小時/月;存儲資源 Amazon S3 首年12個月免費,5GB標準存儲容量。

亞馬遜AWS海外區域賬戶免費套餐_免費云服務-AWS云服務

?

福利二:最新優惠大禮包,200$數據與分析抵扣券,200$機器學習抵扣券,200$微服務與應用開發抵扣券。最新優惠活動_云服務器促銷 - 亞馬遜云科技

?

福利三:解決方案CloudFormation一鍵部署模版庫

云服務解決方案部署快速入門_云服務部署-AWS云服務

作者簡介:😄大家好,我是 Data-Mining(liuzhen007),是一位典型的音視頻技術愛好者,前后就職于傳統廣電巨頭和音視頻互聯網公司,具有豐富的音視頻直播和點播相關經驗,對 WebRTC、FFmpeg 和 Electron 有非常深入的了解,😄公眾號:玩轉音視頻。同時也是 CSDN 博客專家、華為云享專家(共創編輯)、InfoQ 簽約作者,歡迎關注我分享更多干貨!😄?

總結

以上是生活随笔為你收集整理的基于 Amazon Amplify 构建自己的首个 iOS 应用程序(二)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。