Manos Chorianopoulos

constructCampaignUrlForShare functionality

...@@ -1289,20 +1289,27 @@ public class swiftApi { ...@@ -1289,20 +1289,27 @@ public class swiftApi {
1289 return "" 1289 return ""
1290 } 1290 }
1291 1291
1292 - public func constructCampaignUrlForShare(_ campaign: CampaignItemModel, _ deeplink: String) -> String { 1292 + public func constructCampaignUrlForShare(_ sessionUuid: String, _ sharingId: String) -> String {
1293 + for item in GlobalVariables.campaigns {
1294 + if (item.session_uuid == sessionUuid) {
1293 let instanceOfMyApi = MyApi() 1295 let instanceOfMyApi = MyApi()
1294 let campaignInfo = instanceOfMyApi.provideInfoForCampaign() 1296 let campaignInfo = instanceOfMyApi.provideInfoForCampaign()
1295 - let finalUrl = (campaign.index_url ?? "") 1297 + let finalUrl = (item.index_url ?? "")
1296 + "?web_id=" + (campaignInfo?["web_id"] as! String) 1298 + "?web_id=" + (campaignInfo?["web_id"] as! String)
1297 + "&app_uuid=" + (campaignInfo?["app_uuid"] as! String) 1299 + "&app_uuid=" + (campaignInfo?["app_uuid"] as! String)
1298 + "&api_key=" + (campaignInfo?["api_key"] as! String) 1300 + "&api_key=" + (campaignInfo?["api_key"] as! String)
1299 - + "&session_uuid=" + (campaign.session_uuid ?? "") 1301 + + "&session_uuid=" + (item.session_uuid ?? "")
1300 + "&access_token=" + (campaignInfo?["access_token"] as! String) 1302 + "&access_token=" + (campaignInfo?["access_token"] as! String)
1301 + "&refresh_token=" + (campaignInfo?["refresh_token"] as! String) 1303 + "&refresh_token=" + (campaignInfo?["refresh_token"] as! String)
1302 + "&client_id=" + (campaignInfo?["client_id"] as! String) 1304 + "&client_id=" + (campaignInfo?["client_id"] as! String)
1303 - + "&client_secret=" + (campaignInfo?["client_secret"] as! String); 1305 + + "&client_secret=" + (campaignInfo?["client_secret"] as! String)
1306 + + "&sharing_id=" + sharingId;
1304 1307
1305 return finalUrl 1308 return finalUrl
1309 + break;
1310 + }
1311 + }
1312 + return ""
1306 } 1313 }
1307 1314
1308 1315
......