简体   繁体   English

如何确认已为我的应用程序启用了iCloud备份?

[英]How can I confirm that iCloud Backup is enabled for my app?

I have an iOS app that stores large amounts of data on the device. 我有一个iOS应用程序,可在设备上存储大量数据。 We rely on iCloud Backup to preserve data in case the user replaces or resets their device. 我们依靠iCloud备份来保留数据,以防用户更换或重置设备。

Unfortunately, users sometimes disable iCloud backup for just our app to save space on iCloud; 不幸的是,有时用户仅对我们的应用程序禁用iCloud备份,以节省iCloud上的空间。 then, months later, they attempt to restore data onto their new device but there's no app data to restore because they stopped backing it up. 然后,几个月后,他们尝试将数据还原到新设备上,但是由于要停止备份,因此没有要还原的应用程序数据。

I'd really, really like to be able to find out if the user has iCloud Backup checked for our particular app, so we can give users occasional alerts warning them that their data is not being backed up. 我真的非常希望能够发现用户是否已为我们的特定应用程序检查了iCloud Backup,因此我们可以偶尔向用户发出警报,警告他们其数据尚未备份。

Is there any way to programmatically determine whether my app has the iCloud Backup slider set to ON or OFF? 有什么方法可以通过编程确定我的应用程序的iCloud Backup滑块设置为ON还是OFF?

看一下NSFileManager上的ubiquityIdentityToken属性,如果为您的应用设置并启用了iCloud,则该属性应该为非零。

You can't. 你不能 That is because you don't say to iCloud Backup that you want your app to be backed up, it just takes NSUserDefaults and files (not flagged) from DocumentsDirectory and saves them. 那是因为您没有对iCloud Backup说要备份您的应用程序,它只是从DocumentsDirectory中获取NSUserDefaults和文件(未标记)并保存它们。 You could better write an Alert to give more information why is so important having this backup on and show her once. 您最好编写一个Alert来提供更多信息,以了解为什么备份如此重要并一次显示给她。

Oh and please bear in mind that storing to iCloud non-user-generated content may lead to reject your app because: 哦,请记住,将非用户生成的内容存储到iCloud可能会导致拒绝您的应用程序,因为:

Important : Apps should avoid mingling app data and user data in the same file. 重要提示 :应用程序应避免将应用程序数据和用户数据混合在同一文件中。 Doing so will unnecessarily increase backup sizes and can be considered a violation of the iOS Data Storage Guidelines. 这样做会不必要地增加备份大小,并且可以认为这违反了iOS数据存储准则。

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

相关问题 我如何知道是否启用了iCloud备份? - How can I know if iCloud backup is enabled or not? 如何检测用户是否为我的应用启用了iCloud? - How to detect if the user has iCloud enabled for my app? 我如何查看我的应用程序是否有iCloud数据? - How can i see if my app got iCloud data? 如何在iCloud Drive上备份和还原.zip文件? - How can I backup and restore .zip file on iCloud Drive? iCloud正在备份我的应用程序的68个字节(一个plist文件),我是否需要设置一个标志以将其从icloud备份中排除? - iCloud is backing up 68 bytes of my app (a plist file), do i need to set a flag to exclude it from icloud backup? 阻止iCloud备份的应用程序 - Prevent app of iCloud Backup 即使没有为我的应用启用iCloud,我是否必须遵循iOS数据存储指南 - Do I have to follow iOS Data storage guidelines even when iCloud is not enabled for my app 从Apple iCloud还原备份后,如何测试基于脱机内容的应用程序运行正常? - How to test my offline content based app is working fine after restoring the backup from Apple iCloud? 如何将CososDenshion添加到支持ARC的iPhone应用程序中? - How can I add CososDenshion to my ARC enabled iPhone app? 我可以将应用程序的SQLite数据库备份到iCloud吗? - Can I back up my app's SQLite database to iCloud?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM