iCloud가 기기에 설치되어 있는지 확인해야합니다. 따라서이 코드를 사용하십시오
- (void)applicationDidBecomeActive:(UIApplication *)application
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *iCloudURL = [fileManager URLForUbiquityContainerIdentifier:nil];
NSLog(@"%@", [iCloudURL absoluteString]);
if(iCloudURL){
NSUbiquitousKeyValueStore *iCloudStore = [NSUbiquitousKeyValueStore defaultStore];
[iCloudStore setString:@"Success" forKey:@"iCloudStatus"];
[iCloudStore synchronize]; // For Synchronizing with iCloud Server
NSLog(@"iCloud status : %@", [iCloudStore stringForKey:@"iCloudStatus"]);
}
}
이렇게하면 iCloud 상태를 확인할 수 있습니다. 여기에서 참 및 거짓 사례에 대한 확인을 할 수 있으며, 거짓 인 경우 설정에서 iCloud가 활성화되었을 때 사용자가 다시 시도 할 수 있도록 경고 메시지와 함께 앱을 종료 할 수 있습니다.
희망이 도움이됩니다! :)
PS : - 위 코드를 구현하는 과정에서 처음에는 내가 알고있는 iCloud의 인 타이틀먼트와 기본 사항을 구현해야합니다.
나는 당신이 할 수있을 것이라고 상상할 수 없다. iCloud를 사용하지 않은 사용자이고 앱에서 iCloud를 사용하도록 강요했다면 즉시 제거 할 것입니다. –
잘하고 싶다. 할 수있다. 경고가 뜬다. – IronManGill
많은 사용자에게 이것은 거래 차단기가되며 앱을 사용하지 않을 것이다. – pilkch