Latest 1.0.0
Homepage https://github.com/saru2020/SARAddressBookBackup
License Custom Copyright (C) 2010 Apple Inc. All Rights Reserved.
Platforms ios
Authors
An iOS library to take Backup of the device contacts as .vcf file.

Instructions :

(i) Copy/Include the "SARAddressBookBackup.h" & "SARAddressBookBackup.m" into your project.
(ii) Copy/Include  "MessageUI.framework" & "AddressBook.framework" into your project.
That's it. Your done.

Also, the Example project illustrates on how to email the .vcf file.

Installation :
Add the following to your CocoaPods Podfile

pod 'SARAddressBookBackup'

or clone as a git submodule,

or just copy SARAddressBookBackup.h and .m into your project.

Usage :

SARAddressBookBackup *addressBook = [[SARAddressBookBackup alloc]init];
addressBook.backupPath = [self applicationDocumentsDirectory];//(Optional). If not given, then the backup
// file is stored under the Documents directory.
__weak SARAddressBookBackup *addressBook_weak = addressBook;
__weak SARViewController *self_weak = self;
addressBook.backupCompletionStatusBlock = ^(NSString *status){
    if ( status == ACCESSDENIED) {
        NSLog(@"ACCESSDENIED : %@",ACCESSDENIED);
    }
    else if ( status == BACKUPFAILED) {
        NSLog(@"BACKUPFAILED : %@",BACKUPFAILED);
    }
    else if ( status == BACKUPSUCCESS) {
        NSLog(@"BACKUPSUCCESS : %@",BACKUPSUCCESS);
        NSLog(@"addressBook.backupPath : %@",addressBook_weak.backupPath);
        [NSTimer scheduledTimerWithTimeInterval:1.0 target:self_weak selector:@selector(emailBackup:) userInfo:addressBook_weak.backupPath repeats:NO];
    }
};
[addressBook backupContacts];

Latest podspec

{
    "name": "SARAddressBookBackup",
    "version": "1.0.0",
    "summary": "An iOS library to backup the device contacts as .vcf file",
    "description": "An iOS library to take Backup of the device contacts as .vcf file.",
    "homepage": "https://github.com/saru2020/SARAddressBookBackup",
    "license": {
        "type": "Custom",
        "text": "Copyright (C) 2010 Apple Inc. All Rights Reserved."
    },
    "platforms": {
        "ios": null
    },
    "authors": {
        "Saravanan": "[email protected]"
    },
    "source": {
        "git": "https://github.com/saru2020/SARAddressBookBackup.git",
        "tag": "1.0.0"
    },
    "source_files": "SARAddressBookBackup/*.{h,m}",
    "requires_arc": false
}

Pin It on Pinterest

Share This