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-11-22 11:31:56 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e42552d93719dbf54412560048ff04b08796d7c9
e42552d9
1 parent
430f20ea
fix verifyTicketAsync
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
e42552d
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
View file @
e42552d
...
...
@@ -159,6 +159,7 @@ typedef void (^FailureResponse)(NSURLSessionDataTask * _Nullable task, NSError *
///////////////////////////////////////////////////////////////////////////////
+
(
void
)
launchWithAppUUIDWithCallback
:
(
NSString
*
)
appUUID
launchOptions
:
(
NSDictionary
*
)
launchOptions
customPushDelegate
:
(
id
<
WLCustomPushHandler
>
)
customPushDelegate
serverBaseUrl
:
(
NSString
*
)
url
andSuccessBlock
:
(
void
(
^
)(
NSDictionary
*
))
success
andFailureBlock
:
(
void
(
^
)(
NSError
*
error
))
failure
{
NSLog
(
@"=== _sharedService: %@"
,
_sharedService
);
//Launch Once
if
(
_sharedService
!=
nil
)
{
// TODO: Maybe add failure callback here? - msg: "already launched"
...
...
@@ -1908,12 +1909,16 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
[
_db
executeUpdate
:
@"INSERT INTO requestVariables (id, client_id, client_secret, access_token, refresh_token) VALUES (1, ?, ?, ?, ?)"
,
clientId
,
clientSecret
,
accessToken
,
refreshToken
];
NSDictionary
*
successResponse
=
@{
@"result"
:
@"success"
,
@"status"
:
@1
};
NSNumber
*
status
=
[
NSNumber
alloc
];
status
=
[
contextResponse
objectForKey
:
@"result"
];
NSString
*
result
=
@""
;
result
=
[
status
isEqual
:
@1
]
?
@"success"
:
@"error"
;
NSDictionary
*
successResponse
=
@{
@"result"
:
result
,
@"status"
:
status
};
if
(
success
)
{
success
(
successResponse
);
}
NSLog
(
@"**************** WARPLY Response *****************"
);
NSLog
(
@"%@"
,
success
Response
);
NSLog
(
@"%@"
,
context
Response
);
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
...
...
@@ -1945,12 +1950,16 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
[
_db
executeUpdate
:
@"INSERT INTO requestVariables (id, client_id, client_secret, access_token, refresh_token) VALUES (1, ?, ?, ?, ?)"
,
clientId
,
clientSecret
,
accessToken
,
refreshToken
];
NSDictionary
*
successResponse
=
@{
@"result"
:
@"success"
,
@"status"
:
@1
};
NSNumber
*
status
=
[
NSNumber
alloc
];
status
=
[
contextResponse
objectForKey
:
@"result"
];
NSString
*
result
=
@""
;
result
=
[
status
isEqual
:
@1
]
?
@"success"
:
@"error"
;
NSDictionary
*
successResponse
=
@{
@"result"
:
result
,
@"status"
:
status
};
if
(
success
)
{
success
(
successResponse
);
}
NSLog
(
@"**************** WARPLY Response *****************"
);
NSLog
(
@"%@"
,
success
Response
);
NSLog
(
@"%@"
,
context
Response
);
}
failureBlock
:^
(
NSError
*
error
)
{
if
(
failure
)
{
failure
(
error
);
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
e42552d
...
...
@@ -2456,13 +2456,14 @@ public class swiftApi {
if
let
verifyTicketDataDictionary
=
verifyTicketData
as?
[
String
:
Any
]
{
let
tempResponse
=
VerifyTicketResponseModel
(
dictionary
:
verifyTicketDataDictionary
)
if
(
tempResponse
.
getStatus
==
1
)
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_success_login_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
let
tempResponse
=
VerifyTicketResponseModel
(
dictionary
:
verifyTicketDataDictionary
)
verifyTicketCallback
(
tempResponse
);
swiftApi
()
.
getProfileAsync
(
getProfileCallback
)
...
...
@@ -2473,6 +2474,15 @@ public class swiftApi {
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
verifyTicketCallback
(
tempResponse
);
}
}
else
{
let
dynatraceEvent
=
swiftApi
.
LoyaltySDKDynatraceEventModel
()
dynatraceEvent
.
_eventName
=
"custom_error_login_loyalty"
dynatraceEvent
.
_parameters
=
nil
SwiftEventBus
.
post
(
"dynatrace"
,
sender
:
dynatraceEvent
)
verifyTicketCallback
(
nil
)
}
...
...
Please
register
or
login
to post a comment