简体   繁体   English

我可以将iCloud用作后端服务器和iOS App吗?

[英]Can I use iCloud as Back End server for and iOS App?

I am creating an iPhone App. 我正在创建一个iPhone应用程序。 I have some tables to save users information. 我有一些表来保存用户信息。 Do, I need to have a back end web server to store database or I can use iCloud storage without need to web server? 是的,我需要有一个后端Web服务器来存储数据库,或者我可以使用iCloud存储而无需Web服务器? CoreData can be used to save data in iOS devices but there need to be some remote db too, isn't it? CoreData可用于在iOS设备中保存数据,但也需要一些远程数据库,不是吗? Can that remote db be iCloud Storage. 该远程数据库可以是iCloud存储吗?

Any tips and information is highly appreciated. 任何提示和信息都非常感谢。

Regards 问候

Cullen SUN's answer was right as it was answered 2 years ago. Cullen SU​​N的回答是正确的,因为它在2年前被回答。

But now you can use icloud as back end server for iOS app using latest 'Cloud Kit Framework' introduced in iOS 8. 但现在您可以使用icloud作为iOS应用程序的后端服务器,使用iOS 8中引入的最新“Cloud Kit Framework”。

Best tutorial I have found is from http://www.raywenderlich.com/83116/beginning-cloudkit-tutorial 我找到的最佳教程来自http://www.raywenderlich.com/83116/beginning-cloudkit-tutorial

Official Documentation: https://developer.apple.com/library/ios/documentation/CloudKit/Reference/CloudKit_Framework_Reference/ 官方文档: https//developer.apple.com/library/ios/documentation/CloudKit/Reference/CloudKit_Framework_Reference/

use iCloud as a web server is impossible. 使用iCloud作为Web服务器是不可能的。

Short answer: Whose iCloud account are you going to use? 简短回答:你打算使用谁的iCloud账户? Yourself? 自己呢? User's? 用户? Apples never gives any API for an IN-App iCloud Account login, and it can only be set in Device's Setting. 苹果从不为IN-App iCloud帐户登录提供任何API,并且只能在设备的设置中设置。

It depends on what kind of app and data access you want to enable. 这取决于您要启用的应用和数据访问类型。

To start, I found this overview helpful: 首先,我发现此概述很有帮助:

http://gravityjack.com/ios-5-for-developers-what-you-need-to-know http://gravityjack.com/ios-5-for-developers-what-you-need-to-know

The iCloud storage APIs let your application write user documents and data to a central location and access those items from all of a user's computers and iOS devices. iCloud存储API允许您的应用程序将用户文档和数据写入中央位置,并从所有用户的计算机和iOS设备访问这些项目。

The key here is a user (an account) access to their documents and key/value storage data. 这里的关键是用户(帐户)访问其文档和键/值存储数据。 So, the key scenario is all about enabling an account to share data amongst all of the devices bound to that account. 因此,关键方案是关于使帐户能够在绑定到该帐户的所有设备之间共享数据。

A custom cloud web server/service approach would enable multi-user/account access to a share application/data set. 自定义云Web服务器/服务方法将允许多用户/帐户访问共享应用程序/数据集。 It's about more than synchronizing a single account, it's about creating an application where multiple folks share data. 它不仅仅是同步一个帐户,而是创建一个多人共享数据的应用程序。 If you just need sync of a single accounts document/key/value data, then let iCloud do the heavy lifting. 如果您只需要同步一个帐户文档/密钥/值数据,那么让iCloud完成繁重的任务。 If you need a custom app with multi-user access to shared data (facebook, twitter, etc...) then you likely need your own custom cloud app/service. 如果您需要具有多用户访问共享数据(Facebook,Twitter等)的自定义应用程序,那么您可能需要自己的自定义云应用程序/服务。

Concerning device DBs/CoreData. 关于设备DB / CoreData。 It's typical to have devices that are occasionally connected. 通常有偶尔连接的设备。 Imagine requiring internet access to get your address book. 想象一下,要求上网才能获得通讯录。 In that case, you need the app to primarily work off local storage with the cloud used as a conduit to either your other devices or other user's devices (write to local storage with background synchronization to remote cloud storage). 在这种情况下,您需要该应用程序主要处理本地存储,其中云用作其他设备或其他用户设备的管道(写入本地存储,后台同步到远程云存储)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM