由於iCloud備份限制,我的應用程序因應用程序商店被拒絕,而我沒有將任何數據保存到iCloud。請幫幫我。如何在ios應用程序中自動從iCloud中刪除數據備份
4
A
回答
1
但可以假設你在文件目錄中保存了一些數據。蘋果說,你必須標記這個數據,它不會被iCloud備份。 This might help.(不過這也應該是在你從蘋果得到了答案。
1
1
要應用屬性的所有文件:))文件(當然你可以排除需要)
在
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
添加此。
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
[self applyAttributes:documentsDirectory];
paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
documentsDirectory = [paths objectAtIndex:0];
[self applyAttributes:documentsDirectory];
paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
documentsDirectory = [paths objectAtIndex:0];
[self applyAttributes:documentsDirectory];
-(void)applyAttributes:(NSString *)folderPath
{
NSArray *filesArray = [[NSFileManager defaultManager] subpathsOfDirectoryAtPath:folderPath error:nil];
NSEnumerator *filesEnumerator = [filesArray objectEnumerator];
NSString *fileName;
while (fileName = [filesEnumerator nextObject]) {
if([self addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:[folderPath stringByAppendingPathComponent:fileName]]])
{
//NSLog(@"success applying");
}
}
}
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
if([[NSFileManager defaultManager] fileExistsAtPath: [URL path]])
{
NSError *error = nil;
BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES]
forKey: NSURLIsExcludedFromBackupKey error: &error];
if(!success){
NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error);
}
return success;
}
return NO;
}
1
只需更改您的Cordova.plist文件。在備份存儲中更改爲cloud = none。 從科爾多瓦框架中引用幫助。 這不適用於本機應用程序。對於本機應用程序,開發者通知或認證用戶該應用程序將在iCloud上存儲。
相關問題
- 1. iOS備份從我的應用程序到iCloud的一些未知數據28.0KB
- 2. IOS - iCloud的核心數據備份
- 3. iOS:在iCloud中備份核心數據庫?
- 4. 如何防止應用程序備份到iCloud
- 5. iOS從備份還原保留CoreData應用程序數據?
- 6. iOS - 如何構建符合iCloud備份規則的數據庫
- 7. 在「準備提交」狀態中刪除ios應用程序
- 8. 刪除應用程序後,iOS iCloud不能恢復應用程序
- 9. 刪除設備上的本地iCloud數據(例如,在第一次應用程序啓動/重新安裝時)
- 10. 如何備份Asp.Net MVC應用程序中的緩存數據?
- 11. 使用支持iCloud的文件夾中的文檔刪除iOS應用程序
- 12. 在Linux中自動備份MySQL數據
- 13. 如何刪除準備提交的應用程序 - iOS 8
- 14. 如何在Android應用程序中刪除數據庫
- 15. 應用程序數據庫備份
- 16. 備份C#Windows應用程序數據
- 17. (編程/自動)刪除iOS應用程序
- 18. 如何從iPad中刪除應用程序時刪除UILocalNotification applicationIconBadgeNumber?
- 19. iOS應用程序首選項備份
- 20. 如何從應用程序中刪除ios今日擴展程序
- 21. 使用推送通知從iOS設備中刪除應用程序
- 22. 如何在應用程序運行時備份mysql數據庫?
- 23. 從iPhone應用程序中刪除自動更新訂閱
- 24. 我們如何從Google App Engine DataStore中備份應用程序數據?
- 25. 自動從Mysql數據庫中刪除
- 26. 如何在C#中使用SMO刪除SqlServer備份設備?
- 27. 從IOS應用程序中的字符串中刪除'\'
- 28. 從iPhone/iOS應用程序的日期選擇器中刪除年份
- 29. iCloud備份標記被拒絕的應用程序
- 30. 如何從Android 6自動備份中排除整個目錄?
難道這不是應用商店支持可以幫助你的東西嗎? – Cyral 2013-05-13 11:58:31
請在你的下一個問題中清楚你正在使用科爾多瓦。 – dasdom 2013-05-13 12:17:22