Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2022-08-09 15:43:48 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
513fc921c85ad27c67c69c51a6acd655e5eeab61
513fc921
1 parent
d635bd33
add getMultilingualMerchantsAsync, MerchantModel
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
31 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.h
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.m
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.h
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
513fc92
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.h
View file @
513fc92
...
...
@@ -97,6 +97,7 @@
-
(
void
)
getCampaignsAsyncNew
:(
NSString
*
)
language
:
(
NSDictionary
*
)
filters
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
getCampaignsPersonalizedAsync
:(
NSString
*
)
language
:
(
NSDictionary
*
)
filters
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
getSharingHistoryAsync
:(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
getMultilingualMerchantsAsync
:(
NSArray
*
)
categories
andDefaultShown
:(
NSNumber
*
)
defaultShown
andCenter
:(
NSNumber
*
)
center
andTags
:(
NSArray
*
)
tags
andUuid
:(
NSString
*
)
uuid
andDistance
:(
NSNumber
*
)
distance
parent_uuids
:(
NSArray
*
)
parent_uuids
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
@end
#endif
/* MyApi_h */
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.m
View file @
513fc92
...
...
@@ -1216,32 +1216,32 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
return
resp
;
}
-
(
NSDictionary
*
)
retrieveMultilingualMerchantsWithCategories
:
(
NSArray
*
)
categories
andDefaultShown
:
(
NSNumber
*
)
defaultShown
andCenter
:
(
NSNumber
*
)
center
andTags
:
(
NSArray
*
)
tags
andUuid
:
(
NSString
*
)
uuid
andDistance
:
(
NSNumber
*
)
distance
{
__block
NSDictionary
*
resp
=
[
NSDictionary
alloc
];
__block
BOOL
isRunLoopNested
=
NO
;
__block
BOOL
isOperationCompleted
=
NO
;
[[
Warply
sharedService
]
retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock
:
categories
andDefaultShown
:
defaultShown
andCenter
:
center
andTags
:
tags
andUuid
:
uuid
andDistance
:
distance
:^
(
NSDictionary
*
response
)
{
resp
=
response
;
isOperationCompleted
=
YES
;
if
(
isRunLoopNested
)
{
CFRunLoopStop
(
CFRunLoopGetCurrent
());
// CFRunLoopRun() returns
}
}
failureBlock
:^
(
NSError
*
error
)
{
NSLog
(
@"%@"
,
error
);
resp
=
nil
;
isOperationCompleted
=
YES
;
if
(
isRunLoopNested
)
{
CFRunLoopStop
(
CFRunLoopGetCurrent
());
// CFRunLoopRun() returns
}
}];
if
(
!
isOperationCompleted
)
{
isRunLoopNested
=
YES
;
NSLog
(
@"Waiting..."
);
CFRunLoopRun
();
// Magic!
isRunLoopNested
=
NO
;
}
return
resp
;
}
//
- (NSDictionary*)retrieveMultilingualMerchantsWithCategories:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance {
//
__block NSDictionary *resp = [NSDictionary alloc];
//
__block BOOL isRunLoopNested = NO;
//
__block BOOL isOperationCompleted = NO;
//
[[Warply sharedService] retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock:categories andDefaultShown:defaultShown andCenter:center andTags:tags andUuid:uuid andDistance:distance :^(NSDictionary *response) {
//
resp = response;
//
isOperationCompleted = YES;
//
if (isRunLoopNested) {
//
CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns
//
}
//
} failureBlock:^(NSError *error) {
//
NSLog(@"%@", error);
//
resp = nil;
//
isOperationCompleted = YES;
//
if (isRunLoopNested) {
//
CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns
//
}
//
}];
//
if ( ! isOperationCompleted) {
//
isRunLoopNested = YES;
//
NSLog(@"Waiting...");
//
CFRunLoopRun(); // Magic!
//
isRunLoopNested = NO;
//
}
//
return resp;
//
}
-
(
NSDictionary
*
)
getCouponSetsWithActive
:
(
NSNumber
*
)
active
andVisible
:
(
NSNumber
*
)
visible
andUuids
:
(
NSArray
*
)
uuids
{
__block
NSDictionary
*
resp
=
[
NSDictionary
alloc
];
...
...
@@ -1578,4 +1578,17 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
}];
}
-
(
void
)
getMultilingualMerchantsAsync
:
(
NSArray
*
)
categories
andDefaultShown
:
(
NSNumber
*
)
defaultShown
andCenter
:
(
NSNumber
*
)
center
andTags
:
(
NSArray
*
)
tags
andUuid
:
(
NSString
*
)
uuid
andDistance
:
(
NSNumber
*
)
distance
parent_uuids
:
(
NSArray
*
)
parent_uuids
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
{
[[
Warply
sharedService
]
retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock
:
categories
andDefaultShown
:
defaultShown
andCenter
:
center
andTags
:
tags
andUuid
:
uuid
andDistance
:
distance
parent_uuids
:
parent_uuids
:^
(
NSDictionary
*
response
)
{
if
(
success
)
{
success
(
response
);
}
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
@end
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.h
View file @
513fc92
...
...
@@ -383,7 +383,7 @@ WL_VERSION_INTERFACE()
-
(
void
)
resetPasswordWithPasswordWithSuccessBlock
:(
NSString
*
)
password
andConfCode
:(
NSString
*
)
confCode
andOtpUuid
:(
NSString
*
)
otpUuid
andConfToken
:(
NSString
*
)
confToken
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock
:(
NSArray
*
)
categories
andDefaultShown
:(
NSNumber
*
)
defaultShown
andCenter
:(
NSNumber
*
)
center
andTags
:(
NSArray
*
)
tags
andUuid
:(
NSString
*
)
uuid
andDistance
:(
NSNumber
*
)
distance
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock
:(
NSArray
*
)
categories
andDefaultShown
:(
NSNumber
*
)
defaultShown
andCenter
:(
NSNumber
*
)
center
andTags
:(
NSArray
*
)
tags
andUuid
:(
NSString
*
)
uuid
andDistance
:(
NSNumber
*
)
distance
parent_uuids
:(
NSArray
*
)
parent_uuids
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
getCouponSetsWithSuccessBlock
:(
NSNumber
*
)
active
andVisible
:
(
NSNumber
*
)
visible
andUuids
:
(
NSArray
*
)
uuids
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
View file @
513fc92
...
...
@@ -2045,7 +2045,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}];
}
-
(
void
)
retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock
:
(
NSArray
*
)
categories
andDefaultShown
:
(
NSNumber
*
)
defaultShown
andCenter
:
(
NSNumber
*
)
center
andTags
:
(
NSArray
*
)
tags
andUuid
:
(
NSString
*
)
uuid
andDistance
:
(
NSNumber
*
)
distance
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
-
(
void
)
retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock
:
(
NSArray
*
)
categories
andDefaultShown
:
(
NSNumber
*
)
defaultShown
andCenter
:
(
NSNumber
*
)
center
andTags
:
(
NSArray
*
)
tags
andUuid
:
(
NSString
*
)
uuid
andDistance
:
(
NSNumber
*
)
distance
parent_uuids
:
(
NSArray
*
)
parent_uuids
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
{
NSString
*
appUuid
=
[
NSString
alloc
];
appUuid
=
[
WLKeychain
getStringForKey
:
@"NBAPPUuid"
];
...
...
@@ -2060,7 +2060,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
else
{
[
data
setValue
:[
NSNull
null
]
forKey
:
@"default_shown"
];
}
if
(
tags
)
{
if
(
tags
&&
!
[
tags
isEqual
:@[]]
)
{
[
data
setValue
:
tags
forKey
:
@"tags"
];
}
else
{
[
data
setValue
:[
NSNull
null
]
forKey
:
@"tags"
];
...
...
@@ -2068,7 +2068,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
if
(
uuid
&&
!
[
uuid
isEqual
:
@""
])
{
[
data
setValue
:
uuid
forKey
:
@"uuid"
];
}
if
(
distance
!=
0
&&
center
)
{
if
(
distance
&&
!
[
distance
isEqual
:
@0
]
&&
center
)
{
NSMutableDictionary
*
dataLocation
=
[[
NSMutableDictionary
alloc
]
init
];
[
dataLocation
setValue
:
distance
forKey
:
@"distance"
];
[
dataLocation
setValue
:
center
forKey
:
@"center"
];
...
...
@@ -2078,7 +2078,11 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}
else
{
[
data
setValue
:[
NSNull
null
]
forKey
:
@"location"
];
}
if
(
parent_uuids
&&
!
[
parent_uuids
isEqual
:@[]])
{
[
data
setValue
:
parent_uuids
forKey
:
@"parent_uuids"
];
}
else
{
[
data
setValue
:[
NSNull
null
]
forKey
:
@"parent_uuids"
];
}
NSMutableDictionary
*
dataShops
=
[[
NSMutableDictionary
alloc
]
init
];
[
dataShops
setValue
:
data
forKey
:
@"shops"
];
...
...
@@ -2087,6 +2091,8 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
if
(
success
)
{
success
(
contextResponse
);
}
NSLog
(
@"**************** WARPLY Response *****************"
);
NSLog
(
@"%@"
,
contextResponse
);
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
513fc92
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment