Manos Chorianopoulos

fix campaignUrl crash

...@@ -23,9 +23,10 @@ import SwiftEventBus ...@@ -23,9 +23,10 @@ import SwiftEventBus
23 setBackButton() 23 setBackButton()
24 24
25 webview.navigationDelegate = self 25 webview.navigationDelegate = self
26 - let url = URL(string: campaignUrl)! 26 + if let url = URL(string: campaignUrl) {
27 webview.load(URLRequest(url: url)) 27 webview.load(URLRequest(url: url))
28 webview.allowsBackForwardNavigationGestures = true 28 webview.allowsBackForwardNavigationGestures = true
29 + }
29 30
30 webview.configuration.userContentController.add(self, name: "Cosmote") 31 webview.configuration.userContentController.add(self, name: "Cosmote")
31 } 32 }
......
...@@ -1527,14 +1527,14 @@ public class swiftApi { ...@@ -1527,14 +1527,14 @@ public class swiftApi {
1527 let instanceOfMyApi = MyApi() 1527 let instanceOfMyApi = MyApi()
1528 let campaignInfo = instanceOfMyApi.provideInfoForCampaign() 1528 let campaignInfo = instanceOfMyApi.provideInfoForCampaign()
1529 let finalUrl = (item.index_url ?? "") 1529 let finalUrl = (item.index_url ?? "")
1530 - + "?web_id=" + (campaignInfo?["web_id"] as! String) 1530 + + "?web_id=" + (campaignInfo?["web_id"] as? String ?? "")
1531 - + "&app_uuid=" + (campaignInfo?["app_uuid"] as! String) 1531 + + "&app_uuid=" + (campaignInfo?["app_uuid"] as? String ?? "")
1532 - + "&api_key=" + (campaignInfo?["api_key"] as! String) 1532 + + "&api_key=" + (campaignInfo?["api_key"] as? String ?? "")
1533 + "&session_uuid=" + (item.session_uuid ?? "") 1533 + "&session_uuid=" + (item.session_uuid ?? "")
1534 - + "&access_token=" + (campaignInfo?["access_token"] as! String) 1534 + + "&access_token=" + (campaignInfo?["access_token"] as? String ?? "")
1535 - + "&refresh_token=" + (campaignInfo?["refresh_token"] as! String) 1535 + + "&refresh_token=" + (campaignInfo?["refresh_token"] as? String ?? "")
1536 - + "&client_id=" + (campaignInfo?["client_id"] as! String) 1536 + + "&client_id=" + (campaignInfo?["client_id"] as? String ?? "")
1537 - + "&client_secret=" + (campaignInfo?["client_secret"] as! String) 1537 + + "&client_secret=" + (campaignInfo?["client_secret"] as? String ?? "")
1538 + "&Session_ID=" + (campaign._sessionId) 1538 + "&Session_ID=" + (campaign._sessionId)
1539 + "&businessService=" + (campaign._businessService) 1539 + "&businessService=" + (campaign._businessService)
1540 + "&offerName=" + (campaign._offerName) 1540 + "&offerName=" + (campaign._offerName)
...@@ -1569,14 +1569,14 @@ public class swiftApi { ...@@ -1569,14 +1569,14 @@ public class swiftApi {
1569 let instanceOfMyApi = MyApi() 1569 let instanceOfMyApi = MyApi()
1570 let campaignInfo = instanceOfMyApi.provideInfoForCampaign() 1570 let campaignInfo = instanceOfMyApi.provideInfoForCampaign()
1571 let finalUrl = (campaign.index_url ?? "") 1571 let finalUrl = (campaign.index_url ?? "")
1572 - + "?web_id=" + (campaignInfo?["web_id"] as! String) 1572 + + "?web_id=" + (campaignInfo?["web_id"] as? String ?? "")
1573 - + "&app_uuid=" + (campaignInfo?["app_uuid"] as! String) 1573 + + "&app_uuid=" + (campaignInfo?["app_uuid"] as? String ?? "")
1574 - + "&api_key=" + (campaignInfo?["api_key"] as! String) 1574 + + "&api_key=" + (campaignInfo?["api_key"] as? String ?? "")
1575 + "&session_uuid=" + (campaign.session_uuid ?? "") 1575 + "&session_uuid=" + (campaign.session_uuid ?? "")
1576 - + "&access_token=" + (campaignInfo?["access_token"] as! String) 1576 + + "&access_token=" + (campaignInfo?["access_token"] as? String ?? "")
1577 - + "&refresh_token=" + (campaignInfo?["refresh_token"] as! String) 1577 + + "&refresh_token=" + (campaignInfo?["refresh_token"] as? String ?? "")
1578 - + "&client_id=" + (campaignInfo?["client_id"] as! String) 1578 + + "&client_id=" + (campaignInfo?["client_id"] as? String ?? "")
1579 - + "&client_secret=" + (campaignInfo?["client_secret"] as! String) 1579 + + "&client_secret=" + (campaignInfo?["client_secret"] as? String ?? "")
1580 + "&Session_ID=" + (ccmsCampaign._sessionId) 1580 + "&Session_ID=" + (ccmsCampaign._sessionId)
1581 + "&businessService=" + (ccmsCampaign._businessService) 1581 + "&businessService=" + (ccmsCampaign._businessService)
1582 + "&offerName=" + (ccmsCampaign._offerName) 1582 + "&offerName=" + (ccmsCampaign._offerName)
......