Set all contacts

Descriptions of All Contact Model

  • IDOSetAllContactItemModel
Parameter Description Remark
phone Number str
name Name str
  • IDOSetSyncAllContactModel
Parameter Description Remark
year Year int
month Month int
day Day int
hour Hour int
minute Minute int
second Second int
contactItemNum Number of contacts int
items Contact collection array (IDOSetAllContactItemModel)

Command code

Objc:

//Address book data to JSON file
IDOSetSyncAllContactModel * model = [[IDOSetSyncAllContactModel alloc]init];
[IDOFoundationCommand setSyncAllContactCommand:model
                                      callback:^(int errorCode,NSString* path) {
    if (errorCode == 0) {
       //The setting is successful, path is the path of the address book JSON file
       //Perform address book JSON file transfer
    }else if (errorCode == 6) {
      //Device not supported
    }else {
      //Setup failed
    }
}];

  //Contacts JSON file transfer
  initTransferManager().transferType = IDO_DATA_FILE_TRAN_CONTACT_TYPE;
  initTransferManager().compressionType = IDO_DATA_TRAN_COMPRESSION_NO_USE_TYPE;
  initTransferManager().fileName = @".ml";
  initTransferManager().filePath = self.filePath;
  initTransferManager().isSetConnectParam = YES;
  initTransferManager().addDetection(^(int errorCode) {
       if errorCode == 0{
      //Detection succeeded before update
    }else {
      //Detect errors before updating
    }
  }).addProgress(^(int progress) {
      //Update file progress (0-100)
  }).addTransfer(^(int errorCode) {
      if errorCode == 0 {
        //File transfer succeeded
      }else {
        //File transfer failed
      }
  });
  [IDOTransferFileManager startTransfer];

Swift:

//Address book data to JSON file
let model = IDOSetSyncAllContactModel.init()
IDOFoundationCommand.setSyncAllContact(model) { (errorCode) in
     if errorCode == 0 {
       //The setting is successful, path is the path of the address book JSON file
       //Perform address book JSON file transfer
     }else if errorCode == 6{
        //Device does not support this method
     }else {
       //Wrong setting
     }
};

//Contacts JSON file transfer
initTransferManager().transferType = IDO_DATA_FILE_TRAN_TYPE.DIAL_TYPE;
initTransferManager().compressionType = IDO_DATA_TRAN_COMPRESSION_TYPE.NO_USE_TYPE;
initTransferManager().fileName = ".ml";
initTransferManager().filePath = filePath;
initTransferManager().addDetection!{(errorCode)in
    if errorCode == 0i
      //Detection succeeded before update
    }else {
      //Detect errors before updating
    }
}.addProgress!{(progress)in
    //Update file progress (0-100)
}.addTransfer!{(errorCode)in
    if errorCode == 0 {
      //File transfer succeeded
    }else {
      //File transfer failed
    }
};
Copyright © 2015-2020 IDO. All rights reserved. all right reserved,powered by GitbookModify Date: 2023-12-18 10:04:13

results matching ""

    No results matching ""