adding play audio action. current implementation.
This commit is contained in:
parent
cfcf959314
commit
3a4e317ccf
@ -293,20 +293,41 @@ NSString * const KeyActionTypeOpen = @"openPage";
|
|||||||
[[MVMCoreNavigationHandler sharedNavigationHandler] presentViewController:controller animated:YES];
|
[[MVMCoreNavigationHandler sharedNavigationHandler] presentViewController:controller animated:YES];
|
||||||
}];
|
}];
|
||||||
} else if ([approach isEqualToString:KeyCreate]) {
|
} else if ([approach isEqualToString:KeyCreate]) {
|
||||||
|
contact.givenName = [actionInformation string:@"firstName"];
|
||||||
|
contact.familyName = [actionInformation string:@"lastName"];
|
||||||
[MVMCoreDispatchUtility performBlockOnMainThread:^{
|
[MVMCoreDispatchUtility performBlockOnMainThread:^{
|
||||||
contact.givenName = [actionInformation string:@"firstName"];
|
|
||||||
contact.familyName = [actionInformation string:@"lastName"];
|
|
||||||
|
|
||||||
CNContactStore *store = [[CNContactStore alloc] init];
|
CNContactStore *store = [[CNContactStore alloc] init];
|
||||||
CNContactViewController *controller = [CNContactViewController viewControllerForNewContact:contact];
|
CNContactViewController *controller = [CNContactViewController viewControllerForNewContact:contact];
|
||||||
controller.contactStore = store;
|
controller.contactStore = store;
|
||||||
controller.delegate = weakSelf;
|
controller.delegate = weakSelf;
|
||||||
|
|
||||||
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:controller];
|
|
||||||
navigationController.modalPresentationStyle = UIModalPresentationPageSheet;
|
|
||||||
|
|
||||||
[[MVMCoreNavigationHandler sharedNavigationHandler] pushViewController:controller animated:YES];
|
[[MVMCoreNavigationHandler sharedNavigationHandler] pushViewController:controller animated:YES];
|
||||||
}];
|
}];
|
||||||
|
} else if ([approach isEqualToString:KeyView]) {
|
||||||
|
NSCharacterSet *symbols = [NSCharacterSet characterSetWithCharactersInString:@".+()- "];
|
||||||
|
NSString *contactPhoneNumber = [actionInformation string:@"phoneNumber"];
|
||||||
|
contactPhoneNumber = [[contactPhoneNumber componentsSeparatedByCharactersInSet:symbols] componentsJoinedByString:@""];
|
||||||
|
CNPhoneNumber *number = [[CNPhoneNumber alloc] initWithStringValue:contactPhoneNumber];
|
||||||
|
NSPredicate *contactPredicate = [CNContact predicateForContactsMatchingPhoneNumber:number];
|
||||||
|
NSArray *displayedKeys = @[[CNContactViewController descriptorForRequiredKeys]];
|
||||||
|
CNContactStore *store = [[CNContactStore alloc] init];
|
||||||
|
NSError *error;
|
||||||
|
CNContact *viewContact = [[store unifiedContactsMatchingPredicate:contactPredicate keysToFetch:displayedKeys error:&error] firstObject];
|
||||||
|
|
||||||
|
if (viewContact) {
|
||||||
|
[MVMCoreDispatchUtility performBlockOnMainThread:^{
|
||||||
|
CNContactViewController *controller = [CNContactViewController viewControllerForNewContact:viewContact];
|
||||||
|
controller.contactStore = store;
|
||||||
|
controller.delegate = weakSelf;
|
||||||
|
|
||||||
|
[[MVMCoreNavigationHandler sharedNavigationHandler] pushViewController:controller animated:YES];
|
||||||
|
}];
|
||||||
|
} else {
|
||||||
|
// No contacts found, show an alert
|
||||||
|
MVMCoreErrorObject *error = [[MVMCoreErrorObject alloc] initWithTitle:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorTitle] message:[MVMCoreGetterUtility hardcodedStringWithKey:HardcodedErrorContactUnAvailable] code:ErrorCodeDefault domain:ErrorDomainNative location:[NSString stringWithFormat:@"%@_%@",NSStringFromClass([delegateObject.actionDelegate class]),KeyActionTypeContact]];
|
||||||
|
error.silentError = NO;
|
||||||
|
[self handleActionError:error actionInformation:actionInformation additionalData:additionalData delegateObject:delegateObject];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,3 +15,4 @@ extern NSString * const HardcodedOK;
|
|||||||
extern NSString * const HardcodedErrorCritical;
|
extern NSString * const HardcodedErrorCritical;
|
||||||
extern NSString * const HardcodedErrorUnableToProcess;
|
extern NSString * const HardcodedErrorUnableToProcess;
|
||||||
|
|
||||||
|
extern NSString * const HardcodedErrorContactUnAvailable;
|
||||||
|
|||||||
@ -15,3 +15,4 @@ NSString * const HardcodedOK = @"okCaps";
|
|||||||
NSString * const HardcodedErrorCritical = @"Error Message Critical Key";
|
NSString * const HardcodedErrorCritical = @"Error Message Critical Key";
|
||||||
NSString * const HardcodedErrorUnableToProcess = @"Error Message Unable To Process Request Key";
|
NSString * const HardcodedErrorUnableToProcess = @"Error Message Unable To Process Request Key";
|
||||||
|
|
||||||
|
NSString * const HardcodedErrorContactUnAvailable = @"Contact not available";
|
||||||
|
|||||||
@ -28,6 +28,7 @@ extern NSString * const KeyPostAction;
|
|||||||
|
|
||||||
extern NSString * const KeyAdd;
|
extern NSString * const KeyAdd;
|
||||||
extern NSString * const KeyCreate;
|
extern NSString * const KeyCreate;
|
||||||
|
extern NSString * const KeyView;
|
||||||
|
|
||||||
extern NSString * const KeyLinks;
|
extern NSString * const KeyLinks;
|
||||||
extern NSString * const KeyTitle;
|
extern NSString * const KeyTitle;
|
||||||
|
|||||||
@ -30,6 +30,7 @@ NSString * const KeyPostAction = @"PostAction";
|
|||||||
|
|
||||||
NSString * const KeyAdd = @"add";
|
NSString * const KeyAdd = @"add";
|
||||||
NSString * const KeyCreate = @"create";
|
NSString * const KeyCreate = @"create";
|
||||||
|
NSString * const KeyView = @"view";
|
||||||
|
|
||||||
NSString * const KeyLinks = @"Links";
|
NSString * const KeyLinks = @"Links";
|
||||||
NSString * const KeyTitle = @"title";
|
NSString * const KeyTitle = @"title";
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import ContactsUI
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var identifier: String = "contact"
|
public static var identifier: String = "contact"
|
||||||
public var actionType: String = ActionCallModel.identifier
|
public var actionType: String = ActionContactModel.identifier
|
||||||
|
|
||||||
public var phoneNumber: String
|
public var phoneNumber: String
|
||||||
public var firstName: String?
|
public var firstName: String?
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public static var identifier: String = "sms"
|
public static var identifier: String = "sms"
|
||||||
public var actionType: String = ActionCallModel.identifier
|
public var actionType: String = ActionOpenSMSModel.identifier
|
||||||
|
|
||||||
public var phoneNumber: String
|
public var phoneNumber: String
|
||||||
public var message: String?
|
public var message: String?
|
||||||
|
|||||||
@ -13,3 +13,5 @@
|
|||||||
"Error Message Critical Key" = "Unable to process your request at this time. Please contact Customer Service by dialing *611. Thank you.";
|
"Error Message Critical Key" = "Unable to process your request at this time. Please contact Customer Service by dialing *611. Thank you.";
|
||||||
"Error Message Unable To Process Request Key" = "Unable to process your request. Please try again later.";
|
"Error Message Unable To Process Request Key" = "Unable to process your request. Please try again later.";
|
||||||
|
|
||||||
|
//Fios
|
||||||
|
"Contact not available" = "Contact not available";
|
||||||
|
|||||||
@ -12,3 +12,6 @@
|
|||||||
|
|
||||||
"Error Message Critical Key" = "En este momento no podemos procesar tu solicitud. Comunícate con Servicio al Cliente marcando *611. Muchas gracias.";
|
"Error Message Critical Key" = "En este momento no podemos procesar tu solicitud. Comunícate con Servicio al Cliente marcando *611. Muchas gracias.";
|
||||||
"Error Message Unable To Process Request Key" = "No podemos procesar tu solicitud. Vuelve a intentarlo más tarde.";
|
"Error Message Unable To Process Request Key" = "No podemos procesar tu solicitud. Vuelve a intentarlo más tarde.";
|
||||||
|
|
||||||
|
//Fios
|
||||||
|
"Contact not available" = "Contacto no disponible";
|
||||||
|
|||||||
@ -12,3 +12,6 @@
|
|||||||
|
|
||||||
"Error Message Critical Key" = "En este momento no podemos procesar tu solicitud. Comunícate con Servicio al Cliente marcando *611. Muchas gracias.";
|
"Error Message Critical Key" = "En este momento no podemos procesar tu solicitud. Comunícate con Servicio al Cliente marcando *611. Muchas gracias.";
|
||||||
"Error Message Unable To Process Request Key" = "No podemos procesar tu solicitud. Vuelve a intentarlo más tarde.";
|
"Error Message Unable To Process Request Key" = "No podemos procesar tu solicitud. Vuelve a intentarlo más tarde.";
|
||||||
|
|
||||||
|
//Fios
|
||||||
|
"Contact not available" = "Contacto no disponible";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user