latest updates for fios additions.
This commit is contained in:
parent
f595e40f2f
commit
d4dfe2567b
@ -72,6 +72,9 @@ NSString * const KeyActionTypeOpen = @"openPage";
|
|||||||
} else if ([actionType isEqualToString:KeyActionTypeSMS]) {
|
} else if ([actionType isEqualToString:KeyActionTypeSMS]) {
|
||||||
[self smsAction:actionInformation additionalData:additionalData delegateObject:delegateObject];
|
[self smsAction:actionInformation additionalData:additionalData delegateObject:delegateObject];
|
||||||
|
|
||||||
|
} else if ([actionType isEqualToString:KeyActionTypeContact]) {
|
||||||
|
[self contactAction:actionInformation additionalData:additionalData delegateObject:delegateObject];
|
||||||
|
|
||||||
} else if ([actionType isEqualToString:KeyActionTypeShare]) {
|
} else if ([actionType isEqualToString:KeyActionTypeShare]) {
|
||||||
[self shareAction:actionInformation additionalData:additionalData delegateObject:delegateObject];
|
[self shareAction:actionInformation additionalData:additionalData delegateObject:delegateObject];
|
||||||
|
|
||||||
@ -118,19 +121,19 @@ NSString * const KeyActionTypeOpen = @"openPage";
|
|||||||
|
|
||||||
ClientParameterHandler *clientParameterHandler = [[ClientParameterHandler alloc] init];
|
ClientParameterHandler *clientParameterHandler = [[ClientParameterHandler alloc] init];
|
||||||
[clientParameterHandler getParametersWith:clientParametersMap
|
[clientParameterHandler getParametersWith:clientParametersMap
|
||||||
requestParameters:requestParameters
|
requestParameters:requestParameters
|
||||||
error:&error
|
error:&error
|
||||||
completionHandler:^(NSDictionary<NSString *,id> * _Nullable clientParameters) {
|
completionHandler:^(NSDictionary<NSString *,id> * _Nullable clientParameters) {
|
||||||
[MVMCoreLoggingHandler logDebugMessageWithDelegate:@"Finshed fetching client parameters"];
|
[MVMCoreLoggingHandler logDebugMessageWithDelegate:@"Finshed fetching client parameters"];
|
||||||
if (clientParameters) {
|
if (clientParameters) {
|
||||||
stopLoadingOverlay();
|
stopLoadingOverlay();
|
||||||
completionHandler(clientParameters);
|
completionHandler(clientParameters);
|
||||||
} else {
|
} else {
|
||||||
[MVMCoreLoggingHandler logDebugMessageWithDelegate:@"No client parameters"];
|
[MVMCoreLoggingHandler logDebugMessageWithDelegate:@"No client parameters"];
|
||||||
stopLoadingOverlay();
|
stopLoadingOverlay();
|
||||||
completionHandler(nil);
|
completionHandler(nil);
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
stopLoadingOverlay();
|
stopLoadingOverlay();
|
||||||
@ -262,11 +265,28 @@ NSString * const KeyActionTypeOpen = @"openPage";
|
|||||||
NSString *phoneNumber = [actionInformation stringForKey:KeyCallNumber];
|
NSString *phoneNumber = [actionInformation stringForKey:KeyCallNumber];
|
||||||
NSString *message = [actionInformation stringForKey:KeyMessage];
|
NSString *message = [actionInformation stringForKey:KeyMessage];
|
||||||
NSString *smsQuery = [NSString stringWithFormat:@"sms:%@&body=%@", phoneNumber, message];
|
NSString *smsQuery = [NSString stringWithFormat:@"sms:%@&body=%@", phoneNumber, message];
|
||||||
// NSURL *url = [NSURL URLWithString:[smsQuery stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
|
// NSURL *url = [NSURL URLWithString:[smsQuery stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
|
||||||
// [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
|
// [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
|
||||||
[MVMCoreActionUtility linkAway:[smsQuery stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] appURLString:nil];
|
[MVMCoreActionUtility linkAway:[smsQuery stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] appURLString:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)contactAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject {
|
||||||
|
|
||||||
|
NSString *approach = [actionInformation stringForKey:@"approach"];
|
||||||
|
|
||||||
|
if ([approach isEqualToString:KeyAdd]) {
|
||||||
|
|
||||||
|
} else if ([approach isEqualToString:KeyCreate]) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// NSString *message = [actionInformation stringForKey:KeyMessage];
|
||||||
|
// NSString *smsQuery = [NSString stringWithFormat:@"sms:%@&body=%@", phoneNumber, message];
|
||||||
|
// NSURL *url = [NSURL URLWithString:[smsQuery stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
|
||||||
|
// [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
|
||||||
|
// [MVMCoreActionUtility linkAway:[smsQuery stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] appURLString:nil];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)callAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject {
|
- (void)callAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject {
|
||||||
// Call
|
// Call
|
||||||
NSString *callNumber = [actionInformation stringForKey:KeyCallNumber];
|
NSString *callNumber = [actionInformation stringForKey:KeyCallNumber];
|
||||||
@ -441,9 +461,9 @@ NSString * const KeyActionTypeOpen = @"openPage";
|
|||||||
NSDictionary *clientParamters = [actionInformation dict:KeyClientParameters];
|
NSDictionary *clientParamters = [actionInformation dict:KeyClientParameters];
|
||||||
if (clientParamters) {
|
if (clientParamters) {
|
||||||
[[MVMCoreActionHandler sharedActionHandler] getClientParameter:clientParamters
|
[[MVMCoreActionHandler sharedActionHandler] getClientParameter:clientParamters
|
||||||
requestParameters: requestParameters.parameters
|
requestParameters: requestParameters.parameters
|
||||||
showLoadingOverlay: !requestParameters.backgroundRequest
|
showLoadingOverlay: !requestParameters.backgroundRequest
|
||||||
completionHandler: ^(NSDictionary * _Nullable jsonDictionary) {
|
completionHandler: ^(NSDictionary * _Nullable jsonDictionary) {
|
||||||
[requestParameters addRequestParameters:jsonDictionary];
|
[requestParameters addRequestParameters:jsonDictionary];
|
||||||
[[MVMCoreLoadHandler sharedGlobal] loadRequest:requestParameters dataForPage:additionalData delegateObject:delegateObject];
|
[[MVMCoreLoadHandler sharedGlobal] loadRequest:requestParameters dataForPage:additionalData delegateObject:delegateObject];
|
||||||
}];
|
}];
|
||||||
|
|||||||
@ -26,6 +26,9 @@ extern NSString * const KeyButtonMap;
|
|||||||
extern NSString * const KeyOpenSupport;
|
extern NSString * const KeyOpenSupport;
|
||||||
extern NSString * const KeyPostAction;
|
extern NSString * const KeyPostAction;
|
||||||
|
|
||||||
|
extern NSString * const KeyAdd;
|
||||||
|
extern NSString * const KeyCreate;
|
||||||
|
|
||||||
extern NSString * const KeyLinks;
|
extern NSString * const KeyLinks;
|
||||||
extern NSString * const KeyTitle;
|
extern NSString * const KeyTitle;
|
||||||
extern NSString * const KeyMessage;
|
extern NSString * const KeyMessage;
|
||||||
@ -35,6 +38,7 @@ extern NSString * const KeyActionTypeShare;
|
|||||||
extern NSString * const KeyShareType;
|
extern NSString * const KeyShareType;
|
||||||
extern NSString * const KeyShareText;
|
extern NSString * const KeyShareText;
|
||||||
extern NSString * const KeyActionTypeSMS;
|
extern NSString * const KeyActionTypeSMS;
|
||||||
|
extern NSString * const KeyActionTypeContact;
|
||||||
extern NSString * const KeyActionTypeCall;
|
extern NSString * const KeyActionTypeCall;
|
||||||
extern NSString * const KeyActionTypePreviousSubmit;
|
extern NSString * const KeyActionTypePreviousSubmit;
|
||||||
extern NSString * const KeyActionTypeCancel;
|
extern NSString * const KeyActionTypeCancel;
|
||||||
|
|||||||
@ -28,6 +28,9 @@ NSString * const KeyButtonMap = @"ButtonMap";
|
|||||||
NSString * const KeyOpenSupport = @"openSupport";
|
NSString * const KeyOpenSupport = @"openSupport";
|
||||||
NSString * const KeyPostAction = @"PostAction";
|
NSString * const KeyPostAction = @"PostAction";
|
||||||
|
|
||||||
|
NSString * const KeyAdd = @"add";
|
||||||
|
NSString * const KeyCreate = @"create";
|
||||||
|
|
||||||
NSString * const KeyLinks = @"Links";
|
NSString * const KeyLinks = @"Links";
|
||||||
NSString * const KeyTitle = @"title";
|
NSString * const KeyTitle = @"title";
|
||||||
NSString * const KeyMessage = @"message";
|
NSString * const KeyMessage = @"message";
|
||||||
@ -36,6 +39,7 @@ NSString * const KeyActionTypeBack = @"back";
|
|||||||
NSString * const KeyActionTypeShare = @"share";
|
NSString * const KeyActionTypeShare = @"share";
|
||||||
NSString * const KeyActionTypeCall = @"call";
|
NSString * const KeyActionTypeCall = @"call";
|
||||||
NSString * const KeyActionTypeSMS = @"sms";
|
NSString * const KeyActionTypeSMS = @"sms";
|
||||||
|
NSString * const KeyActionTypeContact = @"contact";
|
||||||
NSString * const KeyActionTypePreviousSubmit = @"previousSubmit";
|
NSString * const KeyActionTypePreviousSubmit = @"previousSubmit";
|
||||||
NSString * const KeyActionTypeCancel = @"cancel";
|
NSString * const KeyActionTypeCancel = @"cancel";
|
||||||
NSString * const KeyActionTypeRedirect = @"switchApp";
|
NSString * const KeyActionTypeRedirect = @"switchApp";
|
||||||
|
|||||||
@ -15,8 +15,8 @@
|
|||||||
public static var identifier: String = "contact"
|
public static var identifier: String = "contact"
|
||||||
public var actionType: String = ActionCallModel.identifier
|
public var actionType: String = ActionCallModel.identifier
|
||||||
// TODO: decode into phone number once action handler is re-written
|
// TODO: decode into phone number once action handler is re-written
|
||||||
public var callNumber: String
|
// public var callNumber: String
|
||||||
public var message: String?
|
public var approach: String = KeyCreate
|
||||||
public var extraParameters: JSONValueDictionary?
|
public var extraParameters: JSONValueDictionary?
|
||||||
public var analyticsData: JSONValueDictionary?
|
public var analyticsData: JSONValueDictionary?
|
||||||
|
|
||||||
@ -25,8 +25,8 @@
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public init(callNumber: String, message: String?, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) {
|
public init(callNumber: String, message: String?, _ extraParameters: JSONValueDictionary? = nil, _ analyticsData: JSONValueDictionary? = nil) {
|
||||||
self.callNumber = callNumber
|
// self.callNumber = callNumber
|
||||||
self.message = message
|
// self.message = message
|
||||||
self.extraParameters = extraParameters
|
self.extraParameters = extraParameters
|
||||||
self.analyticsData = analyticsData
|
self.analyticsData = analyticsData
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,11 +35,11 @@ public protocol ModelProtocol: Codable {
|
|||||||
extension ModelProtocol {
|
extension ModelProtocol {
|
||||||
|
|
||||||
static public func decode<K: CodingKey>(keyedContainer: KeyedDecodingContainer<K>, codingKey: K) throws -> Self? {
|
static public func decode<K: CodingKey>(keyedContainer: KeyedDecodingContainer<K>, codingKey: K) throws -> Self? {
|
||||||
return try keyedContainer.decodeIfPresent(self, forKey: codingKey)
|
try keyedContainer.decodeIfPresent(self, forKey: codingKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
static public func decode(unkeyedContainer: inout UnkeyedDecodingContainer) throws -> Self? {
|
static public func decode(unkeyedContainer: inout UnkeyedDecodingContainer) throws -> Self? {
|
||||||
return try unkeyedContainer.decodeIfPresent(self)
|
try unkeyedContainer.decodeIfPresent(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func encode<K: CodingKey>(keyedContainer: inout KeyedEncodingContainer<K>, codingKey: K) throws {
|
public func encode<K: CodingKey>(keyedContainer: inout KeyedEncodingContainer<K>, codingKey: K) throws {
|
||||||
@ -50,4 +50,3 @@ extension ModelProtocol {
|
|||||||
try unkeyedContainer.encode(self)
|
try unkeyedContainer.encode(self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user