Manos Chorianopoulos

constructCampaignUrlForShare functionality

......@@ -1289,20 +1289,27 @@ public class swiftApi {
return ""
}
public func constructCampaignUrlForShare(_ campaign: CampaignItemModel, _ deeplink: String) -> String {
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 constructCampaignUrlForShare(_ sessionUuid: String, _ sharingId: String) -> String {
for item in GlobalVariables.campaigns {
if (item.session_uuid == sessionUuid) {
let instanceOfMyApi = MyApi()
let campaignInfo = instanceOfMyApi.provideInfoForCampaign()
let finalUrl = (item.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=" + (item.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)
+ "&sharing_id=" + sharingId;
return finalUrl
break;
}
}
return ""
}
......