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-05-09 11:52:26 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
45995de2decfb4d4e3fc39865b7edf64947c4237
45995de2
1 parent
736b800c
add getCouponSetsAsync, getCampaignsAsync requests
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
19 deletions
WarplySDKFrameworkIOS/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/MyApi.h
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/MyApi.m
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/swiftApi.swift
WarplySDKFrameworkIOS/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
45995de
...
...
@@ -7,7 +7,7 @@
<key>
Pods-WarplySDKFrameworkIOS.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
0
</integer>
<integer>
1
</integer>
</dict>
</dict>
</dict>
...
...
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
45995de
...
...
@@ -7,7 +7,7 @@
<key>
WarplySDKFrameworkIOS.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
1
</integer>
<integer>
0
</integer>
</dict>
</dict>
</dict>
...
...
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
45995de
No preview for this file type
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/MyApi.h
View file @
45995de
...
...
@@ -77,6 +77,7 @@
-
(
NSDictionary
*
)
loginCosmoteWithGuid
:(
NSString
*
)
guid
andAppUuid
:(
NSString
*
)
appUuid
andTicket
:(
NSString
*
)
ticket
;
-
(
void
)
getCouponsWithSuccessBlock
:(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
getCouponsetsAsync
:(
NSNumber
*
)
active
andVisible
:
(
NSNumber
*
)
visible
andUuids
:
(
NSArray
*
)
uuids
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
getInboxAsync
:(
void
(
^
)(
NSArray
*
list
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
@end
#endif
/* MyApi_h */
...
...
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/MyApi.m
View file @
45995de
...
...
@@ -1284,4 +1284,17 @@ CMPedometer *pedometer;
}
}];
}
-
(
void
)
getInboxAsync
:
(
void
(
^
)(
NSArray
*
list
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
{
[[
Warply
sharedService
]
getInbox2WithSuccessBlock
:
^
(
NSArray
*
inbox
)
{
if
(
success
)
{
success
(
inbox
);
}
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
@end
...
...
WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/swiftApi.swift
View file @
45995de
...
...
@@ -120,29 +120,50 @@ public class swiftApi {
public
class
CouponSetsDataModel
{
var
data
:
Array
<
CouponSetItemModel
>
=
[]
init
()
{
//initializer method
init
()
{
}
var
getData
:
Array
<
CouponSetItemModel
>
{
get
{
// getter
return
data
}
}
func
getCouponSetsData
(
_
getCouponSetsCallback
:
@escaping
(
_
couponSetsData
:
Array
<
CouponSetItemModel
>
?)
->
Void
)
->
Void
{
let
instanceOfMyApi
=
MyApi
()
let
couponSets
=
instanceOfMyApi
.
getCouponSets
(
withActive
:
true
,
andVisible
:
true
,
andUuids
:
nil
)
var
couponSets
:
[
AnyHashable
:
Any
]?
var
couponSetsArray
:
Array
<
CouponSetItemModel
>
=
[]
instanceOfMyApi
.
getCouponsetsAsync
(
true
,
andVisible
:
true
,
andUuids
:
nil
,
couponSetsCallback
,
failureBlock
:
couponSetsFailureCallback
)
func
couponSetsCallback
(
_
couponSetsData
:
[
AnyHashable
:
Any
]?)
->
Void
{
couponSets
=
couponSetsData
??
[
""
:
""
]
if
let
myCouponsSetsDictionary
=
couponSets
as?
[
String
:
AnyObject
]
{
let
couponSetsData
=
(
myCouponsSetsDictionary
[
"MAPP_COUPON"
]
as!
NSArray
)
for
couponset
in
couponSetsData
{
let
tempCouponset
=
CouponSetItemModel
(
dictionary
:
couponset
as!
[
String
:
Any
])
couponSetsArray
.
append
(
tempCouponset
)
}
}
self
.
data
=
couponSetsArray
getCouponSetsCallback
(
couponSetsArray
)
}
func
couponSetsFailureCallback
(
_
error
:
Error
?)
->
Void
{
print
(
"getCouponSets error: "
)
getCouponSetsCallback
(
nil
)
}
var
getData
:
Array
<
CouponSetItemModel
>
{
get
{
// getter
return
data
}
}
public
func
getCouponSetsAsync
(
_
getCouponSetsCallback
:
@escaping
(
_
couponSetsData
:
Array
<
CouponSetItemModel
>
?)
->
Void
)
->
Void
{
CouponSetsDataModel
()
.
getCouponSetsData
(
getCouponSetsCallback
)
}
public
func
getCouponSets
()
->
Array
<
CouponSetItemModel
>
{
...
...
@@ -391,27 +412,42 @@ public class swiftApi {
public
class
CampaignDataModel
{
var
data
:
Array
<
CampaignItemModel
>
=
[]
init
()
{
//initializer method
init
()
{
}
var
getData
:
Array
<
CampaignItemModel
>
{
get
{
// getter
return
data
}
}
func
getCampaignsData
(
_
getCampaignsCallback
:
@escaping
(
_
campaignsData
:
Array
<
CampaignItemModel
>
?)
->
Void
)
->
Void
{
let
instanceOfMyApi
=
MyApi
()
let
products
=
instanceOfMyApi
.
getInbox
()
as
NSMutableArray
?
instanceOfMyApi
.
getInboxAsync
(
campaignsCallback
,
failureBlock
:
campaignsFailureCallback
)
var
giftsArray
:
Array
<
CampaignItemModel
>
=
[]
func
campaignsCallback
(
_
campaignsData
:
[
Any
]?)
->
Void
{
var
campaignsArray
:
Array
<
CampaignItemModel
>
=
[]
for
gift
in
products
??
[]
{
let
tempGift
=
CampaignItemModel
(
dictionary
:
gift
as!
[
String
:
Any
])
giftsArray
.
append
(
tempGift
)
for
item
in
campaignsData
??
[]
{
let
tempCampaign
=
CampaignItemModel
(
dictionary
:
item
as!
[
String
:
Any
])
campaignsArray
.
append
(
tempCampaign
)
}
self
.
data
=
giftsArray
;
getCampaignsCallback
(
campaignsArray
);
}
func
campaignsFailureCallback
(
_
error
:
Error
?)
->
Void
{
print
(
"getCampaigns error: "
)
getCampaignsCallback
(
nil
)
}
var
getData
:
Array
<
CampaignItemModel
>
{
get
{
// getter
return
data
}
}
public
func
getCampaignsAsync
(
_
getCampaignsCallback
:
@escaping
(
_
campaignsData
:
Array
<
CampaignItemModel
>
?)
->
Void
)
->
Void
{
CampaignDataModel
()
.
getCampaignsData
(
getCampaignsCallback
)
}
public
func
getCampaigns
()
->
Array
<
CampaignItemModel
>
{
...
...
Please
register
or
login
to post a comment