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-06-21 12:29:06 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9847679beb867b3cdc33921065248e4e64801379
9847679b
1 parent
375600a4
add campaign url params at constructCampaignUrl
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
7 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.m
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
9847679
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/MyApi.m
View file @
9847679
...
...
@@ -189,9 +189,11 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
-
(
NSDictionary
*
)
provideInfoForCampaign
{
NSMutableDictionary
*
info
=
[[
NSMutableDictionary
alloc
]
init
];
info
[
@"web_id"
]
=
[
Warply
sharedService
].
webId
;
// info[@"web_id"] = [Warply sharedService].webId;
info
[
@"web_id"
]
=
[
WLKeychain
getStringForKey
:
@"NBWebID"
];
info
[
@"app_uuid"
]
=
[
WLKeychain
getStringForKey
:
@"NBAPPUuid"
];
info
[
@"api_key"
]
=
self
.
warply
.
apiKey
;
// info[@"api_key"] = self.warply.apiKey;
info
[
@"api_key"
]
=
[
WLKeychain
getStringForKey
:
@"NBAPIKey"
];
Warply
*
warplyInstance
=
[[
Warply
alloc
]
init
];
info
[
@"access_token"
]
=
[
warplyInstance
getAccessToken
];
info
[
@"refresh_token"
]
=
[
warplyInstance
getRefreshToken
];
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Warply/Warply.m
View file @
9847679
...
...
@@ -544,7 +544,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION)
-
(
NSString
*
)
getClientId
{
NSString
*
clientId
=
[
NSString
alloc
];
if
([
_db
tableExists
:
@"requestVariables"
]
==
YES
)
{
FMResultSet
*
clientIdSet
=
[
_db
executeQuery
:
@"SELECT
access_token
FROM requestVariables WHERE id = 1;"
];
FMResultSet
*
clientIdSet
=
[
_db
executeQuery
:
@"SELECT
client_id
FROM requestVariables WHERE id = 1;"
];
while
([
clientIdSet
next
])
{
clientId
=
[[
clientIdSet
resultDictionary
][
@"client_id"
]
stringValue
];
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
9847679
...
...
@@ -1270,8 +1270,19 @@ public class swiftApi {
public
func
constructCampaignUrl
(
_
campaign
:
CampaignItemModel
)
->
String
{
// TODO: Pending functionality
return
campaign
.
index_url
??
""
let
instanceOfMyApi
=
MyApi
()
let
campaignInfo
=
instanceOfMyApi
.
provideInfoForCampaign
()
let
finalUrl
=
(
campaign
.
index_url
??
""
)
+
"?web_id="
+
(
campaignInfo
?[
"web_id"
]
as!
String
)
+
"&app_uuid="
+
(
campaignInfo
?[
"app_uuid"
]
as!
String
)
+
"&api_key="
+
(
campaignInfo
?[
"api_key"
]
as!
String
)
+
"&session_uuid="
+
(
campaign
.
session_uuid
??
""
)
+
"&access_token="
+
(
campaignInfo
?[
"access_token"
]
as!
String
)
+
"&refresh_token="
+
(
campaignInfo
?[
"refresh_token"
]
as!
String
)
+
"&client_id="
+
(
campaignInfo
?[
"client_id"
]
as!
String
)
+
"&client_secret="
+
(
campaignInfo
?[
"client_secret"
]
as!
String
);
return
finalUrl
}
public
func
constructCcmsUrl
(
_
campaign
:
LoyaltyContextualOfferModel
)
->
String
{
...
...
@@ -1279,8 +1290,19 @@ public class swiftApi {
}
public
func
constructCampaignUrlForShare
(
_
campaign
:
CampaignItemModel
,
_
deeplink
:
String
)
->
String
{
// TODO: Pending functionality
return
campaign
.
index_url
??
""
let
instanceOfMyApi
=
MyApi
()
let
campaignInfo
=
instanceOfMyApi
.
provideInfoForCampaign
()
let
finalUrl
=
(
campaign
.
index_url
??
""
)
+
"?web_id="
+
(
campaignInfo
?[
"web_id"
]
as!
String
)
+
"&app_uuid="
+
(
campaignInfo
?[
"app_uuid"
]
as!
String
)
+
"&api_key="
+
(
campaignInfo
?[
"api_key"
]
as!
String
)
+
"&session_uuid="
+
(
campaign
.
session_uuid
??
""
)
+
"&access_token="
+
(
campaignInfo
?[
"access_token"
]
as!
String
)
+
"&refresh_token="
+
(
campaignInfo
?[
"refresh_token"
]
as!
String
)
+
"&client_id="
+
(
campaignInfo
?[
"client_id"
]
as!
String
)
+
"&client_secret="
+
(
campaignInfo
?[
"client_secret"
]
as!
String
);
return
finalUrl
}
...
...
Please
register
or
login
to post a comment