{"id":35866,"date":"2021-09-01T14:53:07","date_gmt":"2021-09-01T11:53:07","guid":{"rendered":"https:\/\/orbitsoft.com\/blog\/?p=35866"},"modified":"2023-06-29T11:06:54","modified_gmt":"2023-06-29T08:06:54","slug":"how-we-used-swift-vpn-client-application-example","status":"publish","type":"post","link":"https:\/\/orbitsoft.com\/blog\/how-we-used-swift-vpn-client-application-example\/","title":{"rendered":"How we use Swift"},"content":{"rendered":"<div class=\"wp-block-lazyblock-case lazyblock-case-2uLD63\"><div class=\"styled-block\">\n  <div class=\"styled-block__main\">\n          <h3 class=\"styled-block__title\">\n        In brief      <\/h3>\n        <ul class=\"case__list\">\n            \n                    <li class=\"case__item\">\n              \n          <span class=\"case__order\">01<\/span>\n          <div class=\"case__body\">\n            <div class=\"case__title\">\n              <span>Kind of tool<\/span>\n            <\/div>\n            <p>Swift &#8211; Apple\u2019s own programming language<\/p>          <\/div>\n        <\/li>\n            \n                    <li class=\"case__item\">\n              \n          <span class=\"case__order\">02<\/span>\n          <div class=\"case__body\">\n            <div class=\"case__title\">\n              <span>Where we use it<\/span>\n            <\/div>\n            <p>VPN-app<\/p>          <\/div>\n        <\/li>\n            \n                    <li class=\"case__item\">\n              \n          <span class=\"case__order\">03<\/span>\n          <div class=\"case__body\">\n            <div class=\"case__title\">\n              <span>Why we chose it<\/span>\n            <\/div>\n            <p>Our customer already had a Swift app for iOS. It needed to be fixed, as well as needing to be adapted for other platforms.<\/p>\n<p>Swift is the native programming language for Apple devices, and has direct access to system<\/p>\n<p>Functionality and hardware compatibility.<\/p>          <\/div>\n        <\/li>\n            \n                    <li class=\"case__item case__item_marked\">\n              \n          <span class=\"case__order\">04<\/span>\n          <div class=\"case__body\">\n            <div class=\"case__title\">\n              <span>Results<\/span>\n            <\/div>\n            <p><strong>6 platforms<\/strong> on which the application now runs<\/p>\n<p><strong>250 thousand installations<\/strong> so far<\/p>\n<p><strong>6 months<\/strong> is what it took for us to realize the updated versions<\/p>          <\/div>\n        <\/li>\n          <\/ul>\n  <\/div>\n  <\/div><\/div>\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-1bdhuO\"><h2 class=\"article__h\">About the project: VPN app <\/h2><\/div>\n\n\n<p>The customer is a Canadian entertainment content platform that is used by people from all over the world. Users in some countries couldn\u2019t access the platform due to blocking. Our client wanted to rectify this problem and open access to content, while also increasing protection for users\u2019 personal data. To do this, our client sought the creation of a paid VPN app.<\/p>\n\n\n<div class=\"wp-block-lazyblock-link-text lazyblock-link-text-1Ncl5F\">      <aside class=\"article-aside js-article-aside_under\">\n    <div class=\"article-aside__body\">\n                            <a href=\"https:\/\/orbitsoft.com\/blog\/vpn-app-how-we-fixed-others-mistakes-and-launched-the-project\/\" class=\"article-aside__link\" rel=\"nofollow\">\n                                              <span class=\"article-aside__txt\">\n                      <span>VPN case application: how we fixed mistakes and launched the project<\/span>\n                  <\/span>\n                        <\/a>\n        <\/div>\n<\/aside><\/div>\n\n\n<p>Initially, the customer hired the team that offered the lowest price. They worked on the App Store app for almost a year, but the results weren\u2019t satisfactory. The app was slow: response time was up to 15 seconds. There were a number of repetitive fragments in the code, errors in the code, and the payment system wasn\u2019t working correctly.<\/p>\n\n\n\n<p>The OrbitSoft team needed to:<\/p>\n\n\n\n<ol>\n<li>Fix the application errors<\/li>\n\n\n\n<li>Adapt the application for multiple devices and OSs<\/li>\n\n\n\n<li>Repair the paid subscription mechanism<\/li>\n<\/ol>\n\n\n\n<p>The task was complicated by the fact that the application had already been published in the App Store: while we were working on the new versions, the old one needed to work and accept payment.<\/p>\n\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-2iKbzI\"><h2 class=\"article__h\">What tasks were solved using Swift <\/h2><\/div>\n\n\n<p>We continued development for iOS using Swift. Using this native language guarantees the speed and quality of the application, and also gives direct access to the capabilities of the device, and the operating system.<\/p>\n\n\n\n<p>Let us tell you what tasks we solved using Swift for this project\u2026<\/p>\n\n\n\n<p><strong>Redesigned the app.<\/strong> In the old version, the interface on different devices was different. For example, if a user had the application on both a smartphone and a tablet, it looked different on each device. Or if a user bought a new iPhone, and downloaded the same VPN app, the navigation was different, and the user would need to search for all the desired functions again. This was inconvenient. Users left, and company\u2019s income dropped. We redesigned everything so that the application now looks the same on all devices, and customers can easily navigate in it.<\/p>\n\n\n<div class=\"wp-block-lazyblock-figure lazyblock-figure-1harmx\"><figure class=\"article__figure \">\n        <div class=\"article__figure-img\" >\n        <img decoding=\"async\" src=\"https:\/\/orbitsoft.com\/blog\/wp-content\/uploads\/1.jpeg\" alt=\"\">\n    <\/div>\n                <figcaption>Screens for connecting the VPN, and choosing a location, on different Apple devices, all now with a single design.<\/figcaption>\n    <\/figure><\/div>\n\n\n<p><strong>Fixed custom application logic.<\/strong> In the old version, a user had to create an account before being able to choose a tariff. In other words, they had to first enter personal data, and only then could they find out the cost of the service. People didn\u2019t like this. Instead of registering in this application, they downloaded others apps, and the company was losing many potential customers.<\/p>\n\n\n\n<p>We made the application logic familiar to the client: first, choose a tariff, then register. This required a change on the server side: we added a situation to the program where a person could sign up, and then close the application, without creating an account. Then, at the next login, the application would check whether this unregistered user has paid for the subscription. It makes a request to the server and, if it receives the proper response, displays the account creation screen.<\/p>\n\n\n\n<p>Now the application logic is clear to users. Payment data is always saved, and the company doesn\u2019t lose customers.<\/p>\n\n\n<div class=\"wp-block-lazyblock-figure lazyblock-figure-ZLtvOp\"><figure class=\"article__figure \">\n        <div class=\"article__figure-img\" >\n        <img decoding=\"async\" src=\"https:\/\/orbitsoft.com\/blog\/wp-content\/uploads\/2.jpeg\" alt=\"\">\n    <\/div>\n                <figcaption>Start screens: choosing a tariff, then registering an account<\/figcaption>\n    <\/figure><\/div>\n\n\n<p><strong>We adapted the application for different devices and operating systems.<\/strong> We reworked the application code in Kotlin for Android and Android TV, and in C# for Windows. The Swift code was cleaned of errors, and re-adapted for tablets. The MacOS version was going to be made using Mac Catalyst. This technology brings iPad apps to Mac. But there was a problem\u2026<\/p>\n\n\n\n<p>Apple stores passwords in its secure Keychain storage app, but it\u2019s impossible to access them through Catalyst.  As a result, when a user selects a VPN server, the app requires a password instead of connecting. We looked for a solution to the problem in the developer community, and found several pertinent threads on Stack Overflow, but there were no answers there either.<\/p>\n\n\n<div class=\"wp-block-lazyblock-figure lazyblock-figure-29Hxly\"><figure class=\"article__figure \">\n        <div class=\"article__figure-img\" >\n        <img decoding=\"async\" src=\"https:\/\/orbitsoft.com\/blog\/wp-content\/uploads\/3.jpeg\" alt=\"\">\n    <\/div>\n                <figcaption>Other developers are also looking for a solution to the Apple Keychain problem<\/figcaption>\n    <\/figure><\/div>\n\n\n<p>A colleague of ours, who had encountered a similar situation, consulted with Apple technical support, but even they had no answer.<\/p>\n\n\n<div class=\"wp-block-lazyblock-figure lazyblock-figure-1hnoq6\"><figure class=\"article__figure \">\n        <div class=\"article__figure-img\" >\n        <img decoding=\"async\" src=\"https:\/\/orbitsoft.com\/blog\/wp-content\/uploads\/8.jpg\" alt=\"\">\n    <\/div>\n                <figcaption>Screenshot of Apple tech support response<\/figcaption>\n    <\/figure><\/div>\n\n\n<p>It\u2019s unknown when a solution will appear. We decided not to wait, and reworked the code manually. We expended more resources on the issue, but in the end published the Mac version without error.<\/p>\n\n\n\n<p><strong>Set up a monthly subscription.<\/strong> The old app had bug in the subscription mechanism. For example, on the server-side, data was being read from the wrong fields, and users were incorrectly updated in the database. On the client-side, the logic of subscription expiration polling was broken. The application didn\u2019t know went the paid balance had reached zero. It didn\u2019t remind users of this, and tried to work with a zero balance. People got annoyed that nothing worked. They left. And the company lost money. We fixed the mechanism, and also set up an auto-subscription function. Now the application renews the tariff on its own. The user doesn\u2019t need to enter payment information each time. And the company can now count on that monthly income.<\/p>\n\n\n\n<p>But this didn\u2019t go entirely smoothly. Apple has inconveniently organized the testing of subscriptions: you need to create a separate account, and the tested event can only occur 6 times. To continue testing, we needed another test Apple ID, then another, and another, and so on. We ended up with about fifty. Apple\u2019s official documentation doesn\u2019t mention this, but we figured it out, and successfully tested the application.<\/p>\n\n\n<div class=\"wp-block-lazyblock-figure lazyblock-figure-aoDp7\"><figure class=\"article__figure \">\n        <div class=\"article__figure-img\" >\n        <img decoding=\"async\" src=\"https:\/\/orbitsoft.com\/blog\/wp-content\/uploads\/4.jpeg\" alt=\"\">\n    <\/div>\n                <figcaption>Example of Swift code for the payment queue handler. Here we subscribe to events: payment, payment errors, and recovery.<\/figcaption>\n    <\/figure><\/div>\n\n\n<p><strong>Results<\/strong><\/p>\n\n\n\n<ul>\n<li>Initial app posted on App Store in August 2020. We released the corrected version only six months later, in January 2021. With all modifications and improvements, the project took about 10 months.<\/li>\n\n\n\n<li>The application can be installed on 6 different platforms: iOS, macOS, Android, Android TV, Fire OS, and Windows.<\/li>\n\n\n\n<li>In total, the app has been installed more than 250 thousand times.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-lazyblock-heading lazyblock-heading-siUpM\"><h2 class=\"article__h\">OrbitSoft Advice: when Swift can be useful <\/h2><\/div>\n\n\n<p>For which projects it\u2019s better suited:<\/p>\n\n\n\n<ul>\n<li>Loaded applications using animation, 3D graphics, and\/or high-quality multimedia. For example, mobile games.<\/li>\n\n\n\n<li>Applications that need access to specific functions of the operating system of the device. For example, to the camera, Bluetooth, or Face or Touch ID.<\/li>\n\n\n\n<li>If you need a more affluent target audience. Sensor Tower estimates that in the first half of 2020, iOS users around the world spent $32 billion on apps, while Android users spent around half as much.<\/li>\n<\/ul>\n\n\n\n<p>For which projects should you choose a different tool:<\/p>\n\n\n\n<ul>\n<li>Simple, light-loaded applications are faster and cheaper to develop in cross platform languages.<\/li>\n\n\n\n<li>If you\u2019re interested in a wide audience, you should start by publishing on Google Play. According to Sensor Tower, 53 billion apps were installed on Android OS for the first time in the first half of 2020, and around one third as many on iOS from the App Store.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-lazyblock-banner lazyblock-banner-Z1DvhYp\"><div \n  class=\"banner\n   \n  \" \n  >\n    <div class=\"banner__body\">\n        <h2 class=\"banner__h\"> We release projects for online and offline business<\/h2>\n        <div class=\"banner__content\">\n            <p><strong>We work with businesses of any scale.<\/strong> Our clients include international companies, large and medium-sized businesses, and startups.<\/p>\n<p><strong>Telecom<\/strong>: cellular operators, Internet service providers.<\/p>\n<p><strong>Finance<\/strong>: electronic payment systems, insurance companies and brokers.<\/p>\n<p><strong>Retail<\/strong>: stores, trade networks.<\/p>\n<p><strong>Internet advertising<\/strong>: advertising agencies, advertising networks.<\/p>\n<p><strong>Medicine<\/strong>: clinics, medical services.<\/p>        <\/div>\n                            <div \n              class=\"banner__button button js-form-modal\n               button_style_light-on-promo2\">\n              Discuss or order development                          <\/div>\n            <\/div>\n    <div class=\"banner__photo\">\n        <img decoding=\"async\" src=\"https:\/\/orbitsoft.com\/blog\/wp-content\/uploads\/friendship.png\" alt=\"\" class=\"banner__img\">\n    <\/div>\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>The customer is a Canadian entertainment content platform that is used by people from all over the world. Users in some countries couldn\u2019t access the platform due to blocking. Our client wanted to rectify this problem and open access to content, while also increasing protection for users\u2019 personal data. To do this, our client sought [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":35888,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[196],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How we use Swift - OrbitSoft Blog<\/title>\n<meta name=\"description\" content=\"Why did we chose Apple\u2019s own programming language Swift for developing of a VPN-app for a Canadian company and what the results are\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/orbitsoft.com\/blog\/how-we-used-swift-vpn-client-application-example\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How we use Swift - OrbitSoft Blog\" \/>\n<meta name=\"twitter:description\" content=\"Why did we chose Apple\u2019s own programming language Swift for developing of a VPN-app for a Canadian company and what the results are\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/orbitsoft.com\/blog\/wp-content\/uploads\/photo_2021-08-13_18-00-18.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@orbitsoft\" \/>\n<meta name=\"twitter:site\" content=\"@orbitsoft\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How we use Swift - OrbitSoft Blog","description":"Why did we chose Apple\u2019s own programming language Swift for developing of a VPN-app for a Canadian company and what the results are","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/orbitsoft.com\/blog\/how-we-used-swift-vpn-client-application-example\/","twitter_card":"summary_large_image","twitter_title":"How we use Swift - OrbitSoft Blog","twitter_description":"Why did we chose Apple\u2019s own programming language Swift for developing of a VPN-app for a Canadian company and what the results are","twitter_image":"https:\/\/orbitsoft.com\/blog\/wp-content\/uploads\/photo_2021-08-13_18-00-18.jpg","twitter_creator":"@orbitsoft","twitter_site":"@orbitsoft","twitter_misc":{"Written by":"admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/orbitsoft.com\/blog\/how-we-used-swift-vpn-client-application-example\/","url":"https:\/\/orbitsoft.com\/blog\/how-we-used-swift-vpn-client-application-example\/","name":"How we use Swift - OrbitSoft Blog","isPartOf":{"@id":"https:\/\/orbitsoft.com\/blog\/#website"},"datePublished":"2021-09-01T11:53:07+00:00","dateModified":"2023-06-29T08:06:54+00:00","author":{"@id":"https:\/\/orbitsoft.com\/blog\/#\/schema\/person\/e515b3fa91e283750477594c4f028b7b"},"description":"Why did we chose Apple\u2019s own programming language Swift for developing of a VPN-app for a Canadian company and what the results are","breadcrumb":{"@id":"https:\/\/orbitsoft.com\/blog\/how-we-used-swift-vpn-client-application-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/orbitsoft.com\/blog\/how-we-used-swift-vpn-client-application-example\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/orbitsoft.com\/blog\/how-we-used-swift-vpn-client-application-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/orbitsoft.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How we use Swift"}]},{"@type":"WebSite","@id":"https:\/\/orbitsoft.com\/blog\/#website","url":"https:\/\/orbitsoft.com\/blog\/","name":"OrbitSoft Blog","description":"Discover the latest in news and resources for OrbitSoft","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/orbitsoft.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/orbitsoft.com\/blog\/#\/schema\/person\/e515b3fa91e283750477594c4f028b7b","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/orbitsoft.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b1b269c579caf059f82b6d114c63fc49?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b1b269c579caf059f82b6d114c63fc49?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/orbitsoft.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/posts\/35866"}],"collection":[{"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/comments?post=35866"}],"version-history":[{"count":13,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/posts\/35866\/revisions"}],"predecessor-version":[{"id":36579,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/posts\/35866\/revisions\/36579"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/media\/35888"}],"wp:attachment":[{"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/media?parent=35866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/categories?post=35866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/orbitsoft.com\/blog\/wp-json\/wp\/v2\/tags?post=35866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}