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-07-01 14:35:14 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8c5bdaa30f1c08efcf8867a1df343501756bd1bd
8c5bdaa3
1 parent
4ab22c75
add getPacingDetailsAsync request
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.h
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.m
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.h
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.h
View file @
8c5bdaa
...
...
@@ -83,6 +83,7 @@
-
(
void
)
getProfileAsync
:(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
consumerIntegrationAsync
:(
NSNumber
*
)
nonTelco
:
(
NSNumber
*
)
acceptedConsent
:
(
NSArray
*
)
msisdnList
:
(
NSString
*
)
guid
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
redeemCouponSetAsync
:(
NSString
*
)
uuid
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
getPacingDetailsAsync
:(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
@end
#endif
/* MyApi_h */
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.m
View file @
8c5bdaa
...
...
@@ -1381,4 +1381,15 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
}];
}
-
(
void
)
getPacingDetailsAsync
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
{
[[
Warply
sharedService
]
getPacingDetailsWithSuccessBlock
:
^
(
NSDictionary
*
response
)
{
if
(
success
)
{
success
(
response
);
}
}
failureBlock
:
^
(
NSError
*
error
)
{
failure
(
error
);
}];
}
@end
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.h
View file @
8c5bdaa
...
...
@@ -327,6 +327,8 @@ WL_VERSION_INTERFACE()
-
(
void
)
getProfileWithSuccessBlock
:(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
getPacingDetailsWithSuccessBlock
:(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:(
void
(
^
)(
NSError
*
error
))
failure
;
-
(
void
)
editProfileWithSuccessBlock
:(
NSString
*
)
firstName
andLastName
:(
NSString
*
)
lastName
andEmail
:(
NSString
*
)
email
andSalutation
:(
NSString
*
)
salutation
andMsisdn
:(
NSString
*
)
msisdn
andNickname
:(
NSString
*
)
nickname
andGender
:(
NSString
*
)
gender
andBirthday
:(
NSString
*
)
birthday
andNameDay
:(
NSString
*
)
nameday
andTaxID
:(
NSString
*
)
taxID
andProfileMetadata
:(
NSDictionary
*
)
profileMetadata
optin
:(
NSNumber
*
)
optin
newsLetter
:
(
NSNumber
*
)
newsletter
andSMS
:(
NSNumber
*
)
sms
andSegmentation
:(
NSNumber
*
)
segmentation
andSMSSegmentation
:(
NSNumber
*
)
smsSegmentation
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
;
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
View file @
8c5bdaa
...
...
@@ -1062,6 +1062,47 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
}];
}
-
(
void
)
getPacingDetailsWithSuccessBlock
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
{
NSDictionary
*
postDictionary
=
@{
@"consumer_data"
:
@{
@"action"
:
@"integration"
,
@"method"
:
@"steps"
,
@"operation"
:
@"get"
}};
NSData
*
jsonData
=
[
NSJSONSerialization
dataWithJSONObject
:
postDictionary
options
:
0
error
:
NULL
];
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
NSLog
(
@"**************** WARPLY Response *****************"
);
NSLog
(
@"%@"
,
contextResponse
);
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
NSDictionary
*
dict
=
[
NSDictionary
alloc
];
dict
=
[
error
userInfo
];
NSString
*
errorCode
=
[
dict
objectForKey
:
@"NSLocalizedDescription"
];
if
([
errorCode
isEqual
:
@"Request failed: unauthorized (401)"
])
{
[
self
refreshToken
:
^
(
NSDictionary
*
response
)
{
[
self
sendContext8
:
jsonData
successBlock
:
^
(
NSDictionary
*
contextResponse
)
{
if
(
success
)
{
success
(
contextResponse
);
}
NSLog
(
@"**************** WARPLY Response *****************"
);
NSLog
(
@"%@"
,
contextResponse
);
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
}
}];
}
failureBlock
:
^
(
NSError
*
error
)
{
if
(
failure
)
{
[
_db
executeUpdate
:
@"DROP TABLE requestVariables"
];
failure
(
error
);
}
NSLog
(
@"Error at token %@"
,
error
);
}];
}
NSLog
(
@"Error at get pacing details %@"
,
error
);
}
}];
}
-
(
void
)
consumerIntegrationWithSuccessBlock
:
(
NSNumber
*
)
nonTelco
:
(
NSNumber
*
)
acceptedConsent
:
(
NSArray
*
)
msisdnList
:
(
NSString
*
)
guid
:
(
void
(
^
)(
NSDictionary
*
response
))
success
failureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
{
NSMutableDictionary
*
data
=
[[
NSMutableDictionary
alloc
]
init
];
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
8c5bdaa
...
...
@@ -2377,4 +2377,33 @@ public class swiftApi {
}
public
func
getPacingDetailsAsync
(
_
getPacingDetailsCallback
:
@escaping
(
_
pacingData
:
PacingDetails
?)
->
Void
)
->
Void
{
let
instanceOfMyApi
=
MyApi
()
instanceOfMyApi
.
getPacingDetailsAsync
(
pacingCallback
,
failureBlock
:
pacingFailureCallback
)
func
pacingCallback
(
_
pacingData
:
[
AnyHashable
:
Any
]?)
->
Void
{
if
let
pacingDataDictionary
=
pacingData
as?
[
String
:
AnyObject
]
{
if
(
pacingDataDictionary
[
"status"
]
as?
Int
==
1
)
{
let
pacingDataResult
=
(
pacingDataDictionary
[
"result"
]
as?
[
String
:
Any
]
??
[
String
:
Any
]())
let
tempPacingDetails
=
PacingDetails
(
dictionary
:
pacingDataResult
)
getPacingDetailsCallback
(
tempPacingDetails
);
}
}
else
{
getPacingDetailsCallback
(
nil
)
}
}
func
pacingFailureCallback
(
_
error
:
Error
?)
->
Void
{
print
(
"getPacingDetails error: "
)
getPacingDetailsCallback
(
nil
)
}
}
}
...
...
Please
register
or
login
to post a comment