xcode iPhone 和 Webapp 通过 iCloud 同步 ??

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7773920/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 22:08:06  来源:igfitidea点击:

iPhone and Webapp sync through iCloud ??

iphoneobjective-cxcodecocoa-touchicloud

提问by user252317

just checking if its possible to sync iOS devices AND a web app through iCloud. Currently we've got an iOS app built, are looking at using iCloud for synching between all the devices and also want a web app component. iCloud would be great to use as the module to sync everything together.

只是检查是否可以通过 iCloud 同步 iOS 设备和网络应用程序。目前我们已经构建了一个 iOS 应用程序,正在考虑使用 iCloud 在所有设备之间进行同步,并且还需要一个 Web 应用程序组件。iCloud 非常适合用作将所有内容同步在一起的模块。

Anyone know if it's possible ?

有谁知道这是否可能?

回答by Clafou

I have a similar requirement and have wondered about this too.

我有一个类似的要求,也想知道这个。

Unfortunately iCloud data doesn't seem to be accessible to a Web app. And if you found a hack around it, it would still be an unreliable solution as Apple could always make changes down the road that break your Web component, intentionally or not.

不幸的是,Web 应用程序似乎无法访问 iCloud 数据。而且,如果您发现了绕过它的黑客,它仍然是一个不可靠的解决方案,因为 Apple 总是可以有意或无意地进行更改,从而破坏您的 Web 组件。

Edit: With CloudKit this is no longer true. It comes with a Javascript API for the explicit purpose of providing a web version of your app.

编辑:对于 CloudKit,这不再是正确的。它带有一个 Javascript API,其明确目的是提供您的应用程序的网络版本。

回答by groundh0g

Sorry if I'm misunderstanding the question, but I was looking to add iCloud support to my web app recently and came across the official iCloud JS API. The promo text reads:

对不起,如果我误解了这个问题,但我最近希望将 iCloud 支持添加到我的网络应用程序中,并遇到了官方的 iCloud JS API。宣传文字如下:

Keep your apps connected and up to date across iOS, OS X, and now on the web with CloudKit JS.

使用 CloudKit JS使您的应用程序在 iOS、OS X和现在的网络上保持连接和最新。

[emphasis added]

【强调】

https://developer.apple.com/icloud/

https://developer.apple.com/icloud/

回答by mdominick

It is really hard to determine what you mean.... If you are asking if you can implement iCloud in a web app, then I believe that the answer is 'no', since there is only an API for Objective-C for iCloud.

真的很难确定你的意思......如果你问你是否可以在网络应用程序中实现 iCloud,那么我相信答案是否定的,因为只有一个用于 iCloud 的 Objective-C 的 API .

However, you might be able to embed your JS code inside of a native wrapper and write some native code for working with iCloud. However, that may or may not be an option depending on your particular situation.

但是,您也许可以将 JS 代码嵌入到本机包装器中,并编写一些本机代码来使用 iCloud。但是,根据您的特定情况,这可能是也可能不是一个选项。

Edited for spelling.

为拼写编辑。

回答by davef

You could possibly do this, but only if

你可能会这样做,但前提是

  • You where running your own server
  • The server was running on the iOS platform
  • You where able to create software in Objective-C for that server
  • 你在哪里运行你自己的服务器
  • 服务器在iOS平台上运行
  • 您可以在 Objective-C 中为该服务器创建软件

You could then potentially write a server application, that could be used to connect to the iCloud API, then return the calls back to the end user as Json messages that could be consumed, perhaps by some html interface.

然后,您可能会编写一个服务器应用程序,该应用程序可用于连接到 iCloud API,然后将调用返回给最终用户作为可以使用的 Json 消息,也许是由某些 html 接口。