<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Michael Epstein on Medium]]></title>
        <description><![CDATA[Stories by Michael Epstein on Medium]]></description>
        <link>https://medium.com/@mike4aday?source=rss-2f7c8b74bd99------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*F1L9ipiISAykdvs5jh93lQ.jpeg</url>
            <title>Stories by Michael Epstein on Medium</title>
            <link>https://medium.com/@mike4aday?source=rss-2f7c8b74bd99------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 00:43:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mike4aday/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Better Way to Spin Up Salesforce Orgs]]></title>
            <link>https://medium.com/@mike4aday/create-salesforce-orgs-asap-7ed6dae71c41?source=rss-2f7c8b74bd99------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ed6dae71c41</guid>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[salesforce-productivity]]></category>
            <category><![CDATA[mobile-apps]]></category>
            <category><![CDATA[salesforce-tools]]></category>
            <category><![CDATA[salesforce-partners]]></category>
            <dc:creator><![CDATA[Michael Epstein]]></dc:creator>
            <pubDate>Tue, 05 Mar 2024 02:51:51 GMT</pubDate>
            <atom:updated>2024-03-05T17:46:51.083Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you a Salesforce partner who routinely provisions new orgs for demos, testing, development or customer trials?</p><p>Do you use the <a href="https://partners.salesforce.com/s/education/general/Environment_Hub?language=en#z">Environment Hub</a>, but wish it were <a href="https://help.salesforce.com/s/articleView?id=000382914&amp;type=1">easier</a> to set the org’s region or language?</p><p>Do you struggle to keep track of <a href="https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/trialforce_conceptual_overview.htm">Trialforce</a> template IDs and trial org expiration dates?</p><p>Do you find the <a href="https://help.salesforce.com/s/articleView?id=sf.trialforce_signup_api_introduction.htm&amp;type=5">Signup Request API</a> hard to use and customize for your needs?</p><p>If so, then the <a href="https://apple.co/3MLXpZd">Signups</a> mobile app is for you! You can create new Salesforce orgs right from your phone, wherever and whenever you need them. Clone common signup requests with a few clicks, and easily set the new org’s country and language. Signups will automatically provision the new org on a <a href="https://help.salesforce.com/s/articleView?id=000388902&amp;type=1">Hyperforce</a> instance, if one is available for the region you selected.</p><p>You can create an org from one of your Trialforce templates — without looking up its record ID — or select from a list of pre-defined, edition templates like <a href="https://help.salesforce.com/s/articleView?id=000391959&amp;type=1">Partner Developer</a>, Enterprise or Professional Edition. You could even add a private note to help you remember key information about the new org.</p><p>Signups keeps track of impending org expirations and will let you know in time to <a href="https://help.salesforce.com/s/articleView?id=000387818&amp;type=1">request an extension</a>.</p><p>Signups is available <a href="https://apple.co/3MLXpZd">free from the Apple App Store</a>. If you want to install the optional, <a href="https://help.salesforce.com/s/articleView?id=sf.connected_app_create.htm&amp;type=5">connected app</a> in your org, get it from the AppExchange <a href="https://appexchange.salesforce.com/appxListingDetail?listingId=c1f4ba21-3916-41ea-a7b9-1ed39f1c783a">here</a>.</p><p>Signups passed Apple’s <a href="https://developer.apple.com/distribute/app-review/">App store review</a> and the <a href="https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/security_review_overview.htm">AppExchange security review</a>. The app doesn’t handle your Salesforce credentials and doesn’t store any personally identifiable information (PII) about you or your customers. For more information, see Signup’s <a href="https://mike4aday.github.io/SignupsApp/">privacy policy</a>.</p><p><a href="https://apple.co/3MLXpZd">Download Signups from the Apple App Store</a> today — if you like Signups and find it useful, please <a href="https://apps.apple.com/us/app/signups/id6449201969?action=write-review">give it a 5-star rating</a>. If you don’t, or have suggestions for improving the app, please let me know in the comments or <a href="https://www.linkedin.com/in/mike4aday">send me a direct message</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*vFZuLHRfczHPX25xq619Yw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ed6dae71c41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Work.com App for AppExchange]]></title>
            <link>https://medium.com/inside-the-salesforce-ecosystem/build-work-app-appexchange-800f018309a6?source=rss-2f7c8b74bd99------2</link>
            <guid isPermaLink="false">https://medium.com/p/800f018309a6</guid>
            <category><![CDATA[tech-experts]]></category>
            <category><![CDATA[appexchange]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[salesforce]]></category>
            <dc:creator><![CDATA[Michael Epstein]]></dc:creator>
            <pubDate>Mon, 01 Jun 2020 14:01:01 GMT</pubDate>
            <atom:updated>2020-06-03T16:48:55.521Z</atom:updated>
            <content:encoded><![CDATA[<h4>Join the effort to help the world return safely to work</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PbBXGYxtDmqKruznAmJmVA.jpeg" /></figure><h3>What is Work.com?</h3><p><a href="https://www.salesforce.com/work/">Work.com</a> is a suite of apps, data, and content to help businesses return to work, while keeping employees, customers, and communities safe during the COVID-19 crisis and beyond.</p><p>The Work.com apps provide solutions for emergency response planning, employee health assessments, volunteer and grant management, shift scheduling, and manual contact tracing.</p><p>Work.com also includes <a href="https://trailhead.salesforce.com/mytrailhead">myTrailhead</a> to help businesses skill up their workforce with customizable training to meet the challenges of a new era.</p><p>The Workplace Command Center is the hub of Work.com. It serves as the ‘cockpit’ where business leaders and operations executives can monitor return-to-work readiness, make data-driven decisions, and take action.</p><p>The Workplace Command Center integrates apps built by Salesforce and our AppExchange partners, along with attractive visualizations of public health data.</p><h3>How can AppExchange partners join the effort?</h3><p>You can help the world return safely to work by building applications that integrate with the Workplace Command Center, and that complement the Work.com apps built by Salesforce. You can create a brand new app, or extend an existing solution, and use <a href="https://trailhead.salesforce.com/en/content/learn/modules/lightning-web-components-basics">Lightning Web Components</a> to expose your app’s features in the Workplace Command Center user interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*frLI-EBtBUNfMR3uRC2LEw.png" /><figcaption>Integrate your app with the Work.com Workplace Command Center</figcaption></figure><h3>Building Your Work.com App</h3><p>If you already know how to build apps for AppExchange, then you know how to build Work.com apps, too. And if you’re new to AppExchange, we’ve got you covered with free <a href="https://trailhead.salesforce.com/en/content/learn/modules/isv_app_development">training on Trailhead</a>.</p><p>The Workplace Command Center and the Work.com apps built by Salesforce are available as <a href="https://help.salesforce.com/articleView?id=managing_packages.htm&amp;type=5">managed packages</a>. That’s the same technology that AppExchange partners use to distribute and update their custom applications.</p><p>The Workplace Command Center is implemented as a <a href="https://trailhead.salesforce.com/content/learn/projects/quickstart-app-builder/quickstart-app-builder1">Lightning Page</a>, so you can build your own Lightning Web components that users will drag and drop into their Command Center layout. Your components could display data visualizations, or buttons to initiate workflows, for example, or any feature that users need to access quickly from the Workplace Command Center.</p><h3>Distributing Your Work.com App</h3><p>You could distribute your Work.com app as a standalone managed package, or as an extension that adds functionality to another package. Thanks to the power of the <a href="https://developer.salesforce.com/blogs/2019/10/lightning-message-service-developer-preview.html">Lightning Message Service</a> (LMS), your app is decoupled from the Workplace Command Center, and your app’s managed package doesn’t need to extend the Command Center’s package. Instead, your app just subscribes to the Command Center’s LMS channel and responds to events published there.</p><h3>New Standard Objects</h3><p>With the release of Work.com, Salesforce’s Customer 360 Platform also added several new standard objects for employee information, health assessments and facility management. You can see a simplified object relationship diagram below. A new <a href="https://help.salesforce.com/articleView?id=users_permissionset_licenses_overview.htm&amp;type=5">permission set license</a> (PSL) controls user access to these Work.com objects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*tcfL03dN8uZFBCwpmbeGSA.png" /><figcaption>Work.com objects and relationships. From <a href="https://developer.salesforce.com/docs/atlas.en-us.workdotcom_dev_guide.meta/workdotcom_dev_guide/wdc_cc_data_model.htm">Understand the Work.com Data Model</a></figcaption></figure><h3>Editions and Licensing</h3><p>Work.com is available to customers running Salesforce Enterprise, Unlimited and Performance editions. Users that access the Workplace Command Center or the new Work.com objects must have at least a <a href="https://help.salesforce.com/articleView?id=users_license_types_communities_lightning_platform_details.htm&amp;type=5">Lightning Platform Starter</a> license.</p><h3>Separate Org for Work.com</h3><p>The Work.com org will likely store sensitive, employee health data, and access should be restricted accordingly. Therefore, we recommend that customers use Work.com in a separate Salesforce <a href="https://developer.salesforce.com/page/An_Introduction_to_Environments">org</a>, not in their regular business or CRM org. Some customers may already have a separate org where they manage human resources, for example, while other customers may elect to purchase a brand new org just for Work.com.</p><h3>Publish Your Work.com App on AppExchange</h3><p>The process for publishing a Work.com app is essentially the same as <a href="https://trailhead.salesforce.com/en/content/learn/modules/isv_app_development">publishing other apps on the AppExchange</a>. You’ll create a managed package containing your app’s components, and an associated listing with the app’s description, screenshots, and pricing information. You’ll submit the package for <a href="https://trailhead.salesforce.com/en/content/learn/modules/isv_security_review">security review</a>, after which your customers can install your app in their orgs with a single click.</p><h3>Next Steps</h3><p>Check out the <a href="https://developer.salesforce.com/docs/atlas.en-us.workdotcom_dev_guide.meta/workdotcom_dev_guide/wdc_cc_overview.htm">Workplace Command Center for Work.com Developer Guide</a>. It includes detailed instructions for setting up your development environment and building an app that integrates with the Workplace Command Center. The guide also covers packaging, provisioning, and licensing your new Work.com app.</p><p>And join the Partner Community Chatter group <a href="https://partners.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F93A000000TygB">Work.com for AppExchange Partners</a> today. It’s the main collaboration forum for AppExchange partners building new Work.com apps.</p><p>We can’t wait to see what you’ll build to help the world return safely to work!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=800f018309a6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inside-the-salesforce-ecosystem/build-work-app-appexchange-800f018309a6">Build a Work.com App for AppExchange</a> was originally published in <a href="https://medium.com/inside-the-salesforce-ecosystem">AppExchange and the Salesforce Ecosystem</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[4 Things Every ISV Partner Should Know About the Salesforce Government Cloud & FedRAMP]]></title>
            <link>https://medium.com/@mike4aday/4-things-every-isv-partner-should-know-about-the-salesforce-government-cloud-fedramp-8a4af349bbab?source=rss-2f7c8b74bd99------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a4af349bbab</guid>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[isvs]]></category>
            <category><![CDATA[fedramp]]></category>
            <category><![CDATA[government]]></category>
            <dc:creator><![CDATA[Michael Epstein]]></dc:creator>
            <pubDate>Sat, 09 Dec 2017 17:47:19 GMT</pubDate>
            <atom:updated>2017-12-09T17:47:19.722Z</atom:updated>
            <content:encoded><![CDATA[<p>(<a href="https://medium.com/inside-the-salesforce-ecosystem/4-things-every-isv-partner-should-know-about-the-salesforce-government-cloud-fedramp-a780f255ee77">Originally published</a> in ‘<a href="https://medium.com/inside-the-salesforce-ecosystem">Inside the Salesforce Ecosystem</a>’)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LiE2qnKffnMriifG5kf7jA.jpeg" /></figure><p>Ifyou’re thinking, “We don’t sell to federal government customers, so this post isn’t for me,” hold on, you might be missing out on public sector deals without even realizing it! I’ll show you how to remedy that without any extra sales or marketing investment.</p><p>And if you are selling to federal or state government agencies, or want to win more public sector customers, then this post is definitely for you. The market is huge: the federal government alone spent <a href="https://www.itdashboard.gov/">$83 billion</a> on information technology in FY2016, not even including classified projects. That’s more than the entire <a href="https://en.wikipedia.org/wiki/List_of_countries_by_GDP_(nominal)">GDP of most countries</a>!</p><h3>A Little Background</h3><p>The Government Cloud is a special Salesforce instance reserved for federal, state and local government agencies, and those who work with them, like defense contractors and federally funded research and development centers (FFRDCs). The Government Cloud is designed to meet their strict security and regulatory requirements, with infrastructure that is physically isolated from other instances and managed by US citizens.</p><p>If you’re familiar with the acronyms for prestigious compliance certifications, then you’ll appreciate that the Salesforce Government Cloud has earned DoD IL4 provisional authorization, PCI DSS Level 1, ISO 27001/27018, SOC1/SSAE16/ISAE3402, SOC2, and SOC3, and FedRAMP Moderate Agency ATO.</p><p>FedRAMP is an acronym for the “federal risk and authorization management program,” a government-wide, repeatable process for evaluating, authorizing and monitoring the cloud services and apps that federal agencies use. In 2014, Salesforce became the first cloud service provider to attain FedRAMP Authority to Operate (ATO) for both software-as-a-service (SaaS) and platform-as-a-service (PaaS) running on the Government Cloud.</p><p>With that in mind, let’s look at the four things every partner should know about the Government Cloud and FedRAMP — and then I’ll tell you how to get your app ready for your many new public sector customers.</p><h3>1. You might be losing public sector deals, and not even know it.</h3><p>If you haven’t tested your app on the Government Cloud and verified that it works with the Government Cloud’s extra security controls, Salesforce account executives will skip right over it when setting up a deal for their public sector customers — Boom! You just lost a deal, a new customer, maybe even a foothold in an entirely new market, and you never even knew it.</p><h3>2. Federal government customers will buy only FedRAMP-authorized apps.</h3><p>Aside from very few exceptions, you can safely assume that every US federal government customer will require that your app have FedRAMP authorization. And increasingly state governments also require FedRAMP, as do federal contractors and suppliers. If the public sector is an important market for you, then it’s clear that FedRAMP authorization will be a key milestone in your product roadmap.</p><h3>3. Salesforce’s FedRAMP authorization does not cover your app.</h3><p>The <a href="https://marketplace.fedramp.gov/#/product/salesforce-government-cloud">Government Cloud’s FedRAMP authorization</a> does not cover any ISV app, even if that app runs entirely on the Salesforce Platform. Salesforce doesn’t require that your app have FedRAMP authorization in order to be installed in a Government Cloud org, but your customer might, and you’d have to pursue your own FedRAMP authorization to meet that requirement.</p><h3>4. FedRAMP authorization could be easier than you think — and more valuable.</h3><p>FedRAMP authorization could be a long, complicated and expensive process for your company — or maybe not. There’s a new, streamlined program, <a href="https://tailored.fedramp.gov/">FedRAMP Tailored</a>, for “low impact software-as-a-service (LI-SaaS)” that may be right for you.</p><p>And when you’re evaluating the return on investment of going through FedRAMP, keep in mind that there’s a significant “halo” effect beyond the public sector. FedRAMP authorization can give you a major competitive advantage in industries where trust, security and regulatory compliance are important, such as financial services, healthcare and non-profits.</p><p>You may find unexpected organizational benefits, too, as you adapt your internal processes to comply with FedRAMP requirements. In summing up <a href="http://www.springcm.com/">SpringCM</a>’s experience with FedRAMP, CEO Greg Buchholz said, “It made us an even better company.” (You can hear more from Greg and fellow Dreamforce panelists USDA CIO Gary Washington and Gary Guercio of Coalfire in the recording of <a href="https://sfdc.co/fedramp">Government Cloud &amp; FedRAMP for Salesforce ISVs</a>.)</p><h3>Do this next…</h3><p>Now that you’re armed with the four things every ISV partner needs to know about the Government Cloud and FedRAMP, how can you make sure your app stands out in the market and is ready for your new public sector customers?</p><h4>Test your app on the Government Cloud</h4><ol><li><strong>Read “</strong><a href="https://sfdc.co/GovCloudReady"><strong>Is Your App Ready for the Government Cloud?</strong></a><strong>”<br></strong>This one page document highlights the extra security controls in the Government Cloud, and how they may affect the functionality of your ISV app, and your sales and service processes.</li><li><strong>Get a trial Government Cloud org, install and test your app.<br></strong><a href="https://partners.salesforce.com/newPartnerCase?subtopic=GovCloud">Open a case</a> in the Partner Community to get a Government Cloud trial org. Install your app, and test its features in light of the Government Cloud’s extra security controls. Fix any issues that you discover, and publish a new version of your managed package, if necessary. You should also plan on re-testing your app on the Government Cloud with each Salesforce seasonal release, and with each new version of your app.</li><li><strong>Tell us your app is ready for the Government Cloud.</strong><br>When you’ve finished testing your app on the Government Cloud — and corrected any issues that came to light during testing — fill out this short form: <a href="https://sfdc.co/WeAreGovCloudReady">https://sfdc.co/WeAreGovCloudReady</a>. We’ll add you to the list of ISV apps that have been successfully tested on the Government Cloud, and which Salesforce account executives reference when they’re putting together deals for public sector customers. Soon the <a href="https://appexchange.salesforce.com/">AppExchange</a> will gain a new listing filter which will highlight apps that have been tested on the Government Cloud, and everyone will see that your app is Government Cloud ready.</li></ol><h4>Find out if FedRAMP is right for you</h4><p>We’ve arranged free FedRAMP consultations for our ISV partners with <a href="https://www.coalfire.com/">Coalfire</a>. They are the leading FedRAMP assessment and advisory firm, and have lots of experience helping Salesforce partners navigate the FedRAMP process. You can <a href="https://www.coalfire.com/partners/salesforce-office-hours">sign up here</a>. (If you prefer, you could also consult with another advisory firm listed on the <a href="https://marketplace.fedramp.gov/index.html#/assessors">FedRAMP website</a>.)</p><p><a href="https://www.coalfire.com/"><strong><em>Coalfire</em></strong></a><em> can help you answer questions like: How long will FedRAMP authorization take? How much would it cost? How much can we leverage or “inherit” from the Salesforce Government Cloud’s FedRAMP authorization? Is the streamlined FedRAMP Tailored program right for us?</em></p><figure><a href="http://go.appexchange.com/join"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V6X4h3F3hOyQQDdHVCMuyg.png" /></a></figure><h3>Resources</h3><ul><li><strong>Government for Partners — Chatter group</strong><br><a href="https://sfdc.co/GovForPartners">https://sfdc.co/GovForPartners</a></li><li><strong>Is Your App Ready for the Government Cloud?</strong><br><a href="https://sfdc.co/GovCloudReady">https://sfdc.co/GovCloudReady</a></li><li><strong>Coalfire’s FedRAMP office hours for Salesforce ISVs</strong><br><a href="https://www.coalfire.com/partners/salesforce-office-hours">https://www.coalfire.com/partners/salesforce-office-hours</a></li><li><strong>Government Cloud &amp; FedRAMP for Salesforce ISVs</strong><br>Dreamforce ’17 session recording. Panelists: Gary Washington, CIO USDA; Gary Guercio, Managing Principal, Coalfire; Greg Buchholz, CEO, SpringCM.<br><a href="https://sfdc.co/fedramp">https://sfdc.co/fedramp</a></li><li><strong>FedRAMP FAQs</strong><br><a href="https://www.fedramp.gov/resources/faqs/">https://www.fedramp.gov/resources/faqs/</a></li><li><strong>Project Hosts for Salesforce ISVs</strong><br><a href="https://www.projecthosts.com/salesforce-isv-fedramp-program.aspx">https://www.projecthosts.com/salesforce-isv-fedramp-program.aspx</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a4af349bbab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[4 Things Every ISV Partner Should Know About the Salesforce Government Cloud & FedRAMP]]></title>
            <link>https://medium.com/inside-the-salesforce-ecosystem/4-things-every-isv-partner-should-know-about-the-salesforce-government-cloud-fedramp-a780f255ee77?source=rss-2f7c8b74bd99------2</link>
            <guid isPermaLink="false">https://medium.com/p/a780f255ee77</guid>
            <category><![CDATA[fedramp]]></category>
            <category><![CDATA[government]]></category>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[partnerships]]></category>
            <dc:creator><![CDATA[Michael Epstein]]></dc:creator>
            <pubDate>Fri, 08 Dec 2017 15:01:01 GMT</pubDate>
            <atom:updated>2022-05-19T22:59:05.261Z</atom:updated>
            <content:encoded><![CDATA[<h3>Updated May 19, 2022</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LiE2qnKffnMriifG5kf7jA.jpeg" /></figure><p>If you’re thinking, “We don’t sell to federal government customers, so this post isn’t for me,” hold on, you might be missing out on public sector deals without even realizing it! I’ll show you how to remedy that without any extra sales or marketing investment.</p><p>And if you are selling to federal or state agencies, or want to win more public sector customers, then this post is definitely for you. The market is huge: the federal government alone spent <a href="https://www.itdashboard.gov/">$83 billion</a> on information technology in FY2016, not even including classified projects. That’s more than the entire <a href="https://en.wikipedia.org/wiki/List_of_countries_by_GDP_(nominal)">GDP of most countries</a>!</p><h3>A Little Background</h3><p>The Government Cloud is a special Salesforce instance reserved for federal, state and local government agencies, and those who work with them, like defense contractors and federally funded research and development centers (FFRDCs). The Government Cloud is designed to meet their strict security and regulatory requirements, with infrastructure that is physically isolated from other instances and managed by US citizens.</p><p>If you’re familiar with the acronyms for prestigious compliance certifications, then you’ll appreciate that the Salesforce Government Cloud has earned DoD IL4 provisional authorization, PCI DSS Level 1, ISO 27001/27018, SOC1/SSAE16/ISAE3402, SOC2, and SOC3, and FedRAMP Moderate Agency ATO.</p><blockquote><strong>Summer 2020 update: Salesforce Announces Government Cloud Plus</strong></blockquote><blockquote>Government Cloud Plus is authorized at the FedRAMP High Impact Level, the highest level of FedRAMP compliance. It’s built on AWS GovCloud (US), and is designed to address the stringent, unclassified data security and compliance requirements of the U.S. government. Government Cloud Plus combines the power of Salesforce’s offerings in a single solution, curated for government customers that need to comply with FedRAMP High Baseline requirements or DoD Information Impact Level 2 (IL2).</blockquote><blockquote>For more about the differences between Government Cloud and Government Cloud Plus see: <a href="https://sfdc.co/GovVsGovPlus">https://sfdc.co/GovVsGovPlus</a></blockquote><p>FedRAMP is an acronym for the “federal risk and authorization management program,” a government-wide, repeatable process for evaluating, authorizing and monitoring the cloud services and apps that federal agencies use. In 2014, Salesforce became the first cloud service provider to attain FedRAMP Authority to Operate (ATO) for both software-as-a-service (SaaS) and platform-as-a-service (PaaS) running on the Government Cloud.</p><p>With that in mind, let’s look at the four things every partner should know about the Government Cloud and FedRAMP — and then I’ll tell you how to get your app ready for your many new public sector customers.</p><h3>1. You might be losing public sector deals, and not even know it.</h3><p>If you haven’t tested your app on the Government Cloud and verified that it works with the Government Cloud’s extra security controls, Salesforce account executives will skip right over it when setting up a deal for their public sector customers — Boom! You just lost a deal, a new customer, maybe even a foothold in an entirely new market, and you never even knew it.</p><h3>2. Federal government customers will buy only FedRAMP-authorized apps.</h3><p>Aside from very few exceptions, you can safely assume that every US federal government customer will require that your app have FedRAMP authorization. And increasingly state governments also require FedRAMP, as do federal contractors and suppliers. If the public sector is an important market for you, then it’s clear that FedRAMP authorization will be a key milestone in your product roadmap.</p><h3>3. Salesforce’s FedRAMP authorization does not cover your app.</h3><p>The <a href="https://marketplace.fedramp.gov/#/product/salesforce-government-cloud">Government Cloud’s FedRAMP authorization</a> does not cover any ISV app, even if that app runs entirely on the Salesforce Platform. Salesforce doesn’t require that your app have FedRAMP authorization in order to be installed in a Government Cloud org, but your customer might, and you’d have to pursue your own FedRAMP authorization to meet that requirement.</p><blockquote><strong>May 19, 2022 update re. apps that run entirely on the Salesforce platform (“native” apps):</strong></blockquote><blockquote>“Native apps are built on the Salesforce platform and inherit Salesforce Government Cloud and Government Cloud Plus controls (we encourage you to review the Control Implementation Summary for each environment to understand the controls implemented), but Native Apps themselves are not included within the Salesforce Government Cloud and Government Cloud Plus <a href="https://help.salesforce.com/s/articleView?id=000321821&amp;language=en_US&amp;type=1&amp;mode=1"><strong>authorization boundaries</strong></a>…<strong>”</strong></blockquote><blockquote>Source: “<a href="https://help.salesforce.com/s/articleView?id=000355300&amp;type=1"><strong>AppExchange Apps: Government Cloud / Government Cloud Plus and Compliance</strong></a>”</blockquote><h3>4. FedRAMP authorization could be easier than you think — and more valuable.</h3><p>FedRAMP authorization could be a long, complicated and expensive process for your company — or maybe not. There’s a new, streamlined program, <a href="https://tailored.fedramp.gov/">FedRAMP Tailored</a>, for “low impact software-as-a-service (LI-SaaS)” that may be right for you.</p><p>And when you’re evaluating the return on investment of going through FedRAMP, keep in mind that there’s a significant “halo” effect beyond the public sector. FedRAMP authorization can give you a major competitive advantage in industries where trust, security and regulatory compliance are important, such as financial services, healthcare and non-profits.</p><p>You may find unexpected organizational benefits, too, as you adapt your internal processes to comply with FedRAMP requirements. In summing up <a href="http://www.springcm.com/">SpringCM</a>’s experience with FedRAMP, CEO Greg Buchholz said, “It made us an even better company.” (You can hear more from Greg and fellow Dreamforce panelists USDA CIO Gary Washington and Gary Guercio of Coalfire in the recording of <a href="https://sfdc.co/fedramp">Government Cloud &amp; FedRAMP for Salesforce ISVs</a>.)</p><h3>Do this next…</h3><p>Now that you’re armed with the four things every ISV partner needs to know about the Government Cloud and FedRAMP, how can you make sure your app stands out in the market and is ready for your new public sector customers?</p><h4>Test your app on the Government Cloud</h4><ol><li><strong>Read “</strong><a href="https://sfdc.co/GovCloudReady"><strong>Is Your App Ready for the Government Cloud?</strong></a><strong>”<br></strong>This one page document highlights the extra security controls in the Government Cloud, and how they may affect the functionality of your ISV app, and your sales and service processes.</li><li><strong>Get a trial Government Cloud org, install and test your app.<br></strong><a href="https://partners.salesforce.com/newPartnerCase?subtopic=GovCloud">Open a case</a> in the Partner Community to get a Government Cloud trial org. Install your app, and test its features in light of the Government Cloud’s extra security controls. Fix any issues that you discover, and publish a new version of your managed package, if necessary. You should also plan on re-testing your app on the Government Cloud with each Salesforce seasonal release, and with each new version of your app.</li><li><strong>Tell us your app is ready for the Government Cloud.</strong><br>When you’ve finished testing your app on the Government Cloud — and corrected any issues that came to light during testing — fill out this short form: <a href="https://sfdc.co/WeAreGovCloudReady">https://sfdc.co/WeAreGovCloudReady</a>. We’ll add you to the list of ISV apps that have been successfully tested on the Government Cloud, and which Salesforce account executives reference when they’re putting together deals for public sector customers. Soon the <a href="https://appexchange.salesforce.com/">AppExchange</a> will gain a new listing filter which will highlight apps that have been tested on the Government Cloud, and everyone will see that your app is Government Cloud ready.</li></ol><h4>Find out if FedRAMP is right for you</h4><p>We’ve arranged free FedRAMP consultations for our ISV partners with <a href="https://www.coalfire.com/">Coalfire</a>. They are the leading FedRAMP assessment and advisory firm, and have lots of experience helping Salesforce partners navigate the FedRAMP process. You can <a href="https://www.coalfire.com/partners/salesforce-office-hours">sign up here</a>. (If you prefer, you could also consult with another advisory firm listed on the <a href="https://marketplace.fedramp.gov/index.html#/assessors">FedRAMP website</a>.)</p><p><a href="https://www.coalfire.com/"><strong><em>Coalfire</em></strong></a><em> can help you answer questions like: How long will FedRAMP authorization take? How much would it cost? How much can we leverage or “inherit” from the Salesforce Government Cloud’s FedRAMP authorization? Is the streamlined FedRAMP Tailored program right for us?</em></p><figure><a href="http://go.appexchange.com/join"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V6X4h3F3hOyQQDdHVCMuyg.png" /></a></figure><h3>Resources</h3><ul><li><strong>Government for Partners — Chatter group</strong><br><a href="https://sfdc.co/GovForPartners">https://sfdc.co/GovForPartners</a></li><li><strong>Is Your App Ready for the Government Cloud?</strong><br><a href="https://sfdc.co/GovCloudReady">https://sfdc.co/GovCloudReady</a></li><li><strong>Coalfire’s FedRAMP office hours for Salesforce ISVs</strong><br><a href="https://www.coalfire.com/partners/salesforce-office-hours">https://www.coalfire.com/partners/salesforce-office-hours</a></li><li><strong>Government Cloud &amp; FedRAMP for Salesforce ISVs</strong><br>Dreamforce ’17 session recording. Panelists: Gary Washington, CIO USDA; Gary Guercio, Managing Principal, Coalfire; Greg Buchholz, CEO, SpringCM.<br><a href="https://sfdc.co/fedramp">https://sfdc.co/fedramp</a></li><li><strong>FedRAMP FAQs</strong><br><a href="https://www.fedramp.gov/resources/faqs/">https://www.fedramp.gov/resources/faqs/</a></li><li><strong>Project Hosts for Salesforce ISVs</strong><br><a href="https://www.projecthosts.com/salesforce-isv-fedramp-program.aspx">https://www.projecthosts.com/salesforce-isv-fedramp-program.aspx</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a780f255ee77" width="1" height="1" alt=""><hr><p><a href="https://medium.com/inside-the-salesforce-ecosystem/4-things-every-isv-partner-should-know-about-the-salesforce-government-cloud-fedramp-a780f255ee77">4 Things Every ISV Partner Should Know About the Salesforce Government Cloud &amp; FedRAMP</a> was originally published in <a href="https://medium.com/inside-the-salesforce-ecosystem">AppExchange and the Salesforce Ecosystem</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Mobile Apps: Offline First, and Last!]]></title>
            <link>https://medium.com/@mike4aday/building-mobile-apps-offline-first-and-last-4ec89e2d5372?source=rss-2f7c8b74bd99------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ec89e2d5372</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[offline-first]]></category>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Michael Epstein]]></dc:creator>
            <pubDate>Thu, 29 Dec 2016 20:28:23 GMT</pubDate>
            <atom:updated>2016-12-31T17:38:28.128Z</atom:updated>
            <content:encoded><![CDATA[<p>“Because internet connections can be flakey or non-existent, you need to consider <em>offline first: </em>write your app as if it has no internet connection. Once your app works offline, add whatever network functionality you need for your app to do more when it’s online.” [Source: <a href="https://developer.chrome.com/apps/offline_apps">Offline First</a>]</p><p>But that’s a pain, right? Code for offline, code for online, react to changes in network connectivity, resolve data conflicts, yadda, yadda. So much time and low-level code invested in the drudgery of moving data around.</p><p>Nevertheless, we have to do it right. A well-designed mobile app lets the user get work done, and doesn’t whine about the lack or quality of Internet connectivity.</p><p>In my work, I see a lot of interesting use cases for custom mobile apps that integrate with the <a href="https://www.salesforce.com/products/platform/overview/">Salesforce Platform</a>, and offline requirements are often the hardest to meet. So I was very interested to try out Realm’s new Object Server, the back end of their <a href="https://realm.io/products/realm-mobile-platform/">Mobile Platform</a>:</p><p>“Realm Mobile Platform delivers automatic and seamless realtime data sync and powerful event handling between server and devices. You never need to think about networking code again. The Realm Mobile Database is cross-platform, supporting both iOS and Android, and the Realm Object Server is ready to run on your servers or on your favorite cloud.” [Source: <a href="https://realm.io/products/realm-mobile-platform/">Realm Mobile Platform</a>]</p><p>Sounds promising, so I set out to see what it takes to integrate the Realm Object Server with Salesforce. More specifically, I wanted to see if I could monitor data changes made via Realm’s sample mobile app, “<a href="https://realm.io/docs/get-started/cocoa-demo-app/">Realm Tasks</a>,” and then create and update Salesforce task records accordingly.</p><p>And I did it in just a few minutes (ok, not counting the time required to read Realm’s docs and understand how to set up custom event monitoring).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*NQBahhPyk1InQTl98WskNA.png" /><figcaption>Architecture overview. Adapted from <a href="https://realm.io/news/introducing-realm-mobile-platform/">https://realm.io/news/introducing-realm-mobile-platform/</a></figcaption></figure><p>Realm Object Server is amazing! I modified the data on a mobile device, and it showed up almost instantly in the Realm Object Server. I took the device offline, updated data on the device and on the server, then watched as the local databases effortlessly synched up after I turned the WiFi back on. The Realm Object Server dutifully notified my event monitor, which fired off the API calls to Salesforce. No code at all to handle data synchronization, just a relatively-simple Javascript file to monitor events and update Salesforce; see the <a href="https://github.com/mike4aday/RealmTasks-Salesforce/blob/master/index.js">source code on GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ec89e2d5372" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Native Mobile Apps on the Salesforce Platform]]></title>
            <link>https://medium.com/@mike4aday/developing-distributing-native-mobile-apps-on-the-salesforce-platform-e1d7f7a5635a?source=rss-2f7c8b74bd99------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1d7f7a5635a</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Michael Epstein]]></dc:creator>
            <pubDate>Tue, 08 Nov 2016 21:32:51 GMT</pubDate>
            <atom:updated>2016-12-31T17:43:52.942Z</atom:updated>
            <content:encoded><![CDATA[<p>(<a href="https://developer.salesforce.com/blogs/isv/2016/11/developing-distributing-native-mobile-apps-on-the-salesforce-platform.html">Originally published</a> Nov. 8, 2016, on the <a href="https://developer.salesforce.com/blogs/isv/2016/11/developing-distributing-native-mobile-apps-on-the-salesforce-platform.html">Salesforce Developers blog</a>)</p><p>Do you have a great idea for a new mobile app? One that extends the capabilities of Salesforce’s <a href="https://www.salesforce.com/products/">core products</a>, or brings your own product to more customers? Do you want to offer your customers the unrivaled user experience of a native mobile app, with full access to device hardware, or extensive offline capability?</p><p>Whether you’re a fast-growing start-up, well-established software vendor, or independent developer, I want to show you how easy — and potentially <a href="https://www.salesforce.com/blog/2015/10/272-billion-salesforce-opportunity.html">rewarding</a> — it is to develop, distribute and sell native mobile apps that integrate with the Salesforce <a href="https://www.salesforce.com/products/platform/overview/">App Cloud</a>. It’s a <a href="https://status.salesforce.com/performance">powerful</a>, hugely-scalable, and very developer-friendly platform.</p><p>(This post covers native iOS apps, but much of the information is equally applicable to native Android apps, too.)</p><h4>A Real-World Example</h4><p>I’ll explain the entire process by means of a real, but relatively simple example: a native iOS app that I built recently. Then I’ll discuss some variations in the process that might apply to your app.</p><p>My app is called “Limits for Salesforce.” I wrote it a few months ago in Swift 2, for iPhones running iOS 9+. The source code is <a href="https://github.com/mike4aday/LimitsForSalesforce">here</a>, the AppStore listing is <a href="https://itunes.apple.com/us/app/limits-for-salesforce/id1097448006">here</a>, and the AppExchange listing is <a href="https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000E8VDQUA3">here</a>.</p><p>The Limits app is intended for Salesforce administrators, IT support reps and developers. Salesforce is a <a href="https://trailhead.salesforce.com/en/starting_force_com/starting_understanding_arch">multi-tenant</a> platform, and its computing resources are shared by all users. In order to ensure that no app unduly affects the performance of other apps, the platform’s resources are rationed and subject to limits. For example, your Salesforce environment (“org”) may be allotted 1 million API calls per day, or a certain number of outbound emails, or a maximum amount of file storage. The Limits app provides a dashboard-like, real-time monitor of about 30 resource limits, as you can see in this <a href="https://appexchange.salesforce.com/servlet/servlet.FileDownload?file=00P3A00000VLpEYUA1">screenshot</a>.</p><h4>Six Steps to Success</h4><p>At a high level, these are the steps I followed to develop and publish the Limits app:</p><ol><li>Get a free Salesforce Developer Edition</li><li>Create a Salesforce Connected App</li><li>Develop the iOS code</li><li>List the mobile app on the Apple AppStore</li><li>Package the Connected App</li><li>List the app on the Salesforce AppExchange</li></ol><p>Let’s dive into each step:</p><h4>1. Get a free Salesforce Developer Edition</h4><p>You can <a href="https://developer.salesforce.com/signup">sign up for a free, full-featured Salesforce Developer Edition</a>. If you’re new to developing on the Salesforce platform, check out the <a href="https://developer.salesforce.com/">Salesforce Developers website</a> for a wealth of information and tools. You can blaze your trail with <a href="https://trailhead.salesforce.com/">Trailhead: the fun way to learn Salesforce</a>, and you can ask questions and get answers on the <a href="https://developer.salesforce.com/forums">Salesforce Developer forums</a> and the <a href="http://salesforce.stackexchange.com/">Salesforce Stack Exchange</a>.</p><h4>2. Create a Salesforce Connected App</h4><p>Log in to your new Developer Edition and follow <a href="https://help.salesforce.com/articleView?id=connected_app_create.htm&amp;type=0&amp;language=en_US">these directions</a> to the “New Connected App” page. Complete only the required fields for now. You may not be able to fill all the fields yet; for example, you’ll come back later to add the value for ‘App Binary URL’ once you have a link to your AppStore listing.</p><p>I also created images for the ‘Logo Image URL’ and ‘Icon URL’ — it’s a nice way to brand your app, and the images appear in various places, such as on the Salesforce-hosted app authorization page where your users will be asked to allow your app to access their data.</p><p>Check the ‘Enable OAuth Settings’ box and you’ll see the ‘Callback URL’ and ‘Selected OAuth Scopes’ fields. The ‘Callback URL’ can be any URL that you choose — it doesn’t matter, as long as the URL is properly formatted. This is the URL to which Salesforce will redirect users after they authorize your application. Since we’re dealing with a native mobile app, iOS will use the redirect URL to launch your app. You’ll see shortly where this redirect URL fits in your code.</p><p>For ‘Selected OAuth Scopes’ choose at least the following three <a href="https://help.salesforce.com/articleView?id=remoteaccess_oauth_scopes.htm&amp;language=en_US&amp;type=0">scopes</a>:</p><ul><li>Access and manage your data (api)</li><li>Access your basic information (id, profile, email, address, phone)</li><li>Perform requests on your behalf at any time (refresh_token, offline_access)</li></ul><p>Save your changes and note the value for your new Connected App’s ‘Consumer Key.’</p><h4>3. Develop the iOS code</h4><p>For the Limits app, I used <a href="https://github.com/mike4aday/SwiftlySalesforce">Swiftly Salesforce</a>, an open-source, all-Swift framework that I published earlier this year. You could instead use the Salesforce <a href="https://github.com/forcedotcom/SalesforceMobileSDK-iOS">Mobile SDK for iOS</a>, written in Objective-C, with versions for <a href="https://github.com/forcedotcom/SalesforceMobileSDK-Android">Android</a> and <a href="https://github.com/forcedotcom/SalesforceMobileSDK-Windows">Windows</a>.</p><p>Swiftly Salesforce is very easy to use, and enables elegant, painless coding of complex, asynchronous <a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/">Salesforce API</a> calls. You can find the complete source code for the Limits iOS app <a href="https://github.com/mike4aday/LimitsForSalesforce">here</a>. In the <a href="https://github.com/mike4aday/LimitsForSalesforce/blob/master/Limits/AppDelegate.swift">code for my app delegate</a>, you can see how the consumer key and callback URL from the Connected App definition are included.</p><p>(Swiftly Salesforce has since been upgraded for Swift 3, and there’s a slightly different, even easier way to configure your iOS app with the Connected App settings, as you can see in this <a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Example/SwiftlySalesforce/AppDelegate.swift">updated app delegate</a>.)</p><h4>4. List the app on the Apple AppStore</h4><p>Create an AppStore listing and <a href="https://developer.apple.com/app-store/review/">submit your app for review by Apple</a>. At this point, you could go back to the Connected App definition and add the link to the AppStore listing in the ‘App Binary URL’ field.</p><h4>5. Package the Connected App</h4><p>A <a href="https://developer.salesforce.com/page/An_Introduction_to_Packaging">managed package</a> is the standard way to distribute Salesforce apps, and it can contain lots of different components. You must use a <a href="https://developer.salesforce.com/page/Developer_Edition">Developer Edition</a> org to create the package. For the Limits app, the only component I needed to include was the Connected App definition — the app doesn’t require any custom objects or fields (i.e. database tables or columns) or other back-end features. See the <a href="https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/packaging_intro.htm">ISVForce Guide</a> for lots more information on packaging apps.</p><h4>6. List the app on the Salesforce AppExchange</h4><p><a href="https://partners.salesforce.com/s/education/general/AppExchange_Listing">Prepare the AppExchange listing</a>, and <a href="https://partners.salesforce.com/s/education/appinnovators/Security_Review">submit the managed package for security review</a>. Salesforce goes to extraordinary lengths to protect its customers from potentially-rogue third-party apps, and the security review process can be quite rigorous. For much more detailed information on the security review process and fees, check out the <a href="https://partners.salesforce.com/s/education/appinnovators/Security_Review">“Security Review” section of the Salesforce Partner Community</a>.</p><p>For the Limits app, the security review was pretty straightforward since my managed package contains only the Connected App definition. The app doesn’t access any other endpoints beside Salesforce — and I followed <a href="https://developer.salesforce.com/page/Secure_Coding_Guideline">best practices for secure coding</a>, including the requirement to store the <a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_refresh_token_oauth.htm">refresh token</a> securely. <a href="https://github.com/mike4aday/SwiftlySalesforce">Swiftly Salesforce</a> automatically handles that for me, and stores the refresh token in the iOS keychain. My app passed the Salesforce security review on the first try — but don’t be discouraged if yours doesn’t, it typically requires additional attempts. You can find the AppExchange listing <a href="https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000E8VDQUA3">here</a>.</p><h4>Variations Applicable to Your App</h4><p>By now you may have some questions specific to your app:</p><h4>“You’re giving away your ‘Limits’ app for free. How can I sell my app?”</h4><p>Check out the <a href="https://partners.salesforce.com/">Salesforce Partner Community</a> for lots of resources to help you <a href="https://partners.salesforce.com/s/education/appinnovators/build">build</a>, <a href="https://partners.salesforce.com/s/education/appinnovators/sell">sell</a> and <a href="https://partners.salesforce.com/s/education/appinnovators/distribute">distribute</a> your app.</p><h4><strong>“The Salesforce security review fee is $2,700 for paid apps. I’m launching a new business from my local coffee shop and that’s a lot of money for me. Is Salesforce the right platform for a mobile app startup?”</strong></h4><p>Yes! The Salesforce Platform is ideal for a mobile app startup. It’s <a href="https://trust.salesforce.com/en/#systemStatus">reliable</a>, <a href="https://status.salesforce.com/performance">fast</a>, and scalable-on-demand, so you can focus entirely on your app and growing your business. The platform has <a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_what_is_rest_api.htm">great APIs</a>, lots of <a href="https://developer.salesforce.com/">free resources for developers</a>, and a vibrant <a href="https://developer.salesforce.com/">developer</a> and <a href="https://partners.salesforce.com/">partner community</a> — and you get access to a huge <a href="https://www.salesforce.com/blog/2015/10/272-billion-salesforce-opportunity.html">ecosystem</a> of paying customers.</p><p>The security review is a worthwhile investment in earning the trust and confidence of potential customers, and should be a key part of your go-to-market strategy. That said, you are not technically required to undergo the review. You could still complete the first four of the six steps I listed above: get a free developer edition, define a Connected App, develop the iOS code, and list your mobile app on Apple’s AppStore — but you wouldn’t be able to sell your app on the Salesforce AppExchange until it has passed the security review.</p><h4>“My app requires custom, back-end components that are not available out-of-the-box in Salesforce, like custom objects (i.e. database tables), fields (database columns), back-end business logic, or custom REST API endpoints. How would my native mobile app work with those components?”</h4><p>You can easily include all those custom components in your app’s package for one-click installation in your customers’ orgs. While my app required only the Connected App definition, your package would include any custom components required by your mobile app. See the <a href="https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/packaging_intro.htm">ISVForce guide</a> for more information on packaging back-end components. On the iOS client side, <a href="https://github.com/mike4aday/SwiftlySalesforce">Swiftly Salesforce</a> makes it easy to refer to your custom objects, fields and REST endpoints. (By the way: the <a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/">standard Salesforce APIs</a> are so comprehensive, that you very likely don’t need to create your own <a href="https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest.htm">custom REST endpoints</a>.)</p><h4>“Do my customers have to install anything besides the iOS app?”</h4><p>If your Salesforce package contains only the Connected App definition, then customers don’t have to install the package in their org in order to use your app. However, if your package contains any custom objects, fields, code, or other back-end customizations, then an administrator of your customer’s org would have to install the managed package in order for your mobile app to work. In any case, it’s useful to offer the package even if it’s not required. By installing the Connected App in their org, administrators can configure <a href="https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/connected_app_overview.htm">fine-grained access control</a> for your mobile app.</p><h4>Resources to Help You Get Started</h4><ul><li><a href="https://github.com/mike4aday/SwiftlySalesforce">Swiftly Salesforce</a>: open-source, all-Swift framework for the rapid development of native iOS mobile apps that interact with the <a href="http://www.salesforce.com/platform/overview/">Salesforce Platform</a></li><li><a href="https://github.com/forcedotcom/SalesforceMobileSDK-iOS">Salesforce Mobile SDK for iOS</a>: alternative to <a href="https://github.com/mike4aday/SwiftlySalesforce">Swiftly Salesforce</a>; written in Objective-C</li><li><a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/">Salesforce REST API Developer’s Guide</a></li><li><a href="https://partners.salesforce.com/">Salesforce Partner Community</a>: “Innovate, grow, connect” with Salesforce ISVs. Join the <a href="http://sfdc.co/sfdc-ios">Salesforce + iOS Mobile</a> Chatter group</li><li><a href="https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/packaging_intro.htm">ISVForce Guide</a></li><li><a href="https://help.salesforce.com/HTViewSolution?id=000192840&amp;language=en_US">When to Use the Salesforce1 Platform vs. Creating Custom Apps</a></li></ul><h4>About the Author</h4><p>Michael Epstein is a senior technical <a href="https://en.wikipedia.org/wiki/Technology_evangelist">evangelist</a> at Salesforce, and works with ISV partners who are building applications on the Salesforce Platform.</p><p>LinkedIn: <a href="https://www.linkedin.com/in/mike4aday">in/mike4aday</a> | twitter: <a href="http://twitter.com/mike4aday">@mike4aday</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1d7f7a5635a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swiftly Salesforce is a framework for the rapid development of native iOS mobile apps that interact…]]></title>
            <link>https://medium.com/@mike4aday/swiftly-salesforce-6a9625822fb4?source=rss-2f7c8b74bd99------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a9625822fb4</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[salesforce-tools]]></category>
            <category><![CDATA[salesforce]]></category>
            <dc:creator><![CDATA[Michael Epstein]]></dc:creator>
            <pubDate>Fri, 28 Oct 2016 18:36:26 GMT</pubDate>
            <atom:updated>2018-10-11T22:22:08.498Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fRBttnA2wpm9hBf-." /></figure><blockquote>Update, Oct. 10, 2018: Swiftly Salesforce is now even easier to set up, configure and use. Check out the <a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/README.md">README</a> file of the current version on <a href="https://github.com/mike4aday/SwiftlySalesforce">GitHub</a>.</blockquote><p><a href="https://github.com/mike4aday/SwiftlySalesforce"><em>Swiftly Salesforce</em></a> is a framework for the rapid development of native iOS mobile apps that interact with the <a href="http://www.salesforce.com/platform/overview/">Salesforce Platform</a>.</p><ul><li>Written entirely in <a href="https://developer.apple.com/swift/">Swift</a>, Apple’s “modern programming language that is safe, fast and interactive.”</li><li>Enables elegant, painless coding for complex, asynchronous <a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/">Salesforce API</a> interactions</li><li>Manages the Salesforce <a href="https://developer.salesforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com">OAuth2</a> authorization process (the “OAuth dance”) automatically and transparently</li><li>Simpler and lighter alternative to the Salesforce <a href="https://github.com/forcedotcom/SalesforceMobileSDK-iOS">Mobile SDK for iOS</a></li><li>Easy to install and update</li></ul><h3>How do I set up Swiftly Salesforce?</h3><p>You can be up and running in a few minutes by following these steps:</p><ol><li><a href="https://developer.salesforce.com/signup">Get</a> a free Salesforce Developer Edition</li><li>Set up a Salesforce <a href="https://help.salesforce.com/apex/HTViewHelpDoc?id=connected_app_overview.htm">Connected App</a></li><li>Register your Connected App’s callback URL scheme with iOS (<a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/README.md#appendix">see appendix</a>)</li><li>Add <em>Swiftly Salesforce</em> to your Xcode project:<br>Add pod &#39;SwiftlySalesforce&#39; to your project&#39;s <a href="https://guides.cocoapods.org/syntax/podfile.html">Podfile</a> (<a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/README.md#appendix">see appendix</a>), <br>or just copy these <a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Pod/Classes">Swift source files</a> into your project, and add the <a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/README.md#dependent-frameworks">dependent frameworks</a></li><li>Configure your app delegate for <em>Swiftly Salesforce</em> (<a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/README.md#appendix">see appendix</a>)</li><li>Add an ATS exception for salesforce.com (<a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/README.md#appendix">see appendix</a>)</li></ol><p>Minimum requirements:</p><ul><li>iOS 10.0</li><li>Swift 3</li><li>Xcode 8</li></ul><h3>Documentation</h3><p>Documentation is <a href="http://cocoadocs.org/docsets/SwiftlySalesforce">here</a>. See especially the public methods of the Salesforce class - those are likely all you&#39;ll need to call from your code.</p><h3>Examples</h3><p>Below are some examples to illustrate how to use <em>Swiftly Salesforce</em>, and how you can chain complex asynchronous calls. You can also find a complete example app <a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Example/SwiftlySalesforce">here</a>; it retrieves the logged-in user’s task records from Salesforce, and enables the user to update the status of a task.</p><p><em>Swiftly Salesforce</em> will automatically manage the entire Salesforce <a href="https://developer.salesforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com">OAuth2</a> process (the “OAuth dance”). If <em>Swiftly Salesforce</em> has a valid access token, it will include that token in the header of every API request. If the token has expired, and Salesforce rejects the request, then <em>Swiftly Salesforce</em> will attempt to refresh the access token, without bothering the user to re-enter the username and password. If <em>Swiftly Salesforce</em> doesn’t have a valid access token, or is unable to refresh it, then <em>Swiftly Salesforce</em> will direct the user to the Salesforce-hosted login form.</p><p>Behind the scenes, <em>Swiftly Salesforce</em> leverages <a href="https://github.com/alamofire/alamofire">Alamofire</a> and <a href="https://github.com/mxcl/PromiseKit">PromiseKit</a>, two very widely-adopted frameworks, for elegant handling of networking requests and asynchronous operations.</p><h3>Example: Configure Your App to Talk to Salesforce</h3><pre>import UIKit<br>import SwiftlySalesforce</pre><pre>@UIApplicationMain<br>class AppDelegate: UIResponder, UIApplicationDelegate, LoginDelegate {</pre><pre>    var window: UIWindow?</pre><pre>    /// Salesforce Connected App properties (replace with your own…)<br>    let consumerKey = &quot;3MVG91...&quot;<br>    let redirectURL = URL(string: &quot;taskforce://authorized&quot;)!</pre><pre>    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {<br>        configureSalesforce(consumerKey: consumerKey, redirectURL: redirectURL)<br>        return true<br>    }</pre><pre>    func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -&gt; Bool {<br>        handleRedirectURL(url: url)<br>        return true<br>    }<br>}</pre><p>Note the following in the above example:</p><ol><li>Your app delegate should implement LoginDelegate</li><li>Replace the values for consumerKey and redirectURL with the values defined in your <a href="https://help.salesforce.com/apex/HTViewHelpDoc?id=connected_app_overview.htm">Connected App</a></li><li>Call configureSalesforce() and handleRedirectURL() as shown</li></ol><h3>Example: Retrieve a Salesforce Record</h3><p>The following will retrieve all the fields for an account record:</p><pre>salesforce.retrieve(type: &quot;Account&quot;, id: &quot;0013000001FjCcF&quot;)</pre><p>To specify which fields should be retrieved:</p><pre>let fields = [&quot;AccountNumber&quot;, &quot;BillingCity&quot;, &quot;MyCustomField__c&quot;]<br>salesforce.retrieve(type: &quot;Account&quot;, id: &quot;0013000001FjCcF&quot;, fields: fields)</pre><p>Note that retrieve() is an asynchronous function, whose return value is a &quot;promise&quot; that will be fulfilled at some point in the future:</p><pre>let promise = salesforce.retrieve(type: &quot;Account&quot;, id: &quot;0013000001FjCcF&quot;)</pre><p>And we can add a closure that will be called later, when the promise is fulfilled:</p><pre>promise.then {<br>    queryResult in<br>    for record in queryResult.records {<br>        // Parse JSON dictionary of record fields &amp; values, and do interesting stuff…<br>    }<br>}</pre><h3>Example: Update a Salesforce Record</h3><pre>salesforce.update(type: &quot;Task&quot;, id: &quot;00T1500001h3V5NEAU&quot;, fields: [&quot;Status&quot;: &quot;Completed&quot;])<br>.then {<br>    (_) -&gt; () in<br>    // Update the local model<br>}.always {<br>    // Update the UI<br>}</pre><p>The always closure will be called regardless of success or failure elsewhere in the promise chain.</p><h3>Example: Querying</h3><pre>let soql = &quot;SELECT Id,Name FROM Account WHERE BillingPostalCode = &#39;\(postalCode)&#39;&quot;<br>salesforce.query(soql: soql)</pre><p>See the next example for handling the query results.</p><h3>Example: Chaining Asynchronous Requests</h3><p>Let’s say we want to retrieve a random zip/postal code from a <a href="https://developer.salesforce.com/page/Creating_REST_APIs_using_Apex_REST">custom Apex REST</a> resource, and then use that zip code in a query:</p><pre>// Chained asynch requests <br>first {<br>    // Make GET request of custom Apex REST resource<br>    // (Enclosing this in a ‘first’ block is optional and can keep things neat.)<br>    salesforce.apexRest(path: &quot;/MyApexResourceThatEmitsRandomZip&quot;)<br>}.then {<br>    // Query accounts in that zip code<br>    result in<br>    guard let zip = result[&quot;zip&quot;] as? String else {<br>        throw TaskForceError.generic(100, “Can’t get random zip code from our custom REST endpoint!”)<br>    }<br>    let soql = &quot;SELECT Id,Name FROM Account WHERE BillingPostalCode = &#39;\(zip)&#39;&quot;<br>    return salesforce.query(soql: soql)<br>}.then {<br>    queryResult in<br>    for record in queryResult.records {<br>        if let name = record[&quot;Name&quot;] as? String {<br>          print(&quot;Account name = \(name)&quot;)<br>        }<br>    }<br>}</pre><p>You could repeat this chaining multiple times, feeding the result of one asynchronous operation as the input to the next. Or you could spawn multiple, simultaneous operations and easily specify logic to be executed when all operations complete, or when just the first completes, or when any one operation fails, etc. PromiseKit is an amazingly-powerful framework for handling multiple asynchronous operations that would otherwise be very difficult to coordinate. See <a href="http://promisekit.org/">PromiseKit documentation</a> for more examples.</p><h3>Example: Handling Errors</h3><p>The following code is adapted from the example file, <a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Example/SwiftlySalesforce/TaskStore.swift">TaskStore.swift</a> and shows how to handle errors:</p><pre>first {<br>    // Get ID of current user<br>    salesforce.identity()<br>}.then {<br>    // Query tasks owned by user<br>    userInfo in<br>    guard let userID = userInfo.userID else {<br>        throw TaskForceError.generic(code: 100, message: &quot;Can&#39;t determine user ID&quot;)<br>    }<br>    let soql = &quot;SELECT Id,Subject,Status,What.Name FROM Task WHERE OwnerId = &#39;\(userID)&#39; ORDE   R BY CreatedDate DESC&quot;<br>    return salesforce.query(soql: soql)<br>}.then {<br>    // Parse JSON into Task instances<br>    (result: QueryResult) -&gt; () in<br>    let tasks = result.records.map { Task(dictionary: $0) }<br>    // Do something interesting with the tasks…<br>}.catch {<br>    error in<br>    // Handle the error…<br>}</pre><p>You could also recover from an error, and continue with the chain, using a recover closure. The following snippet is from PromiseKit&#39;s <a href="http://promisekit.org/recovering-from-errors">documentation</a>:</p><pre>CLLocationManager.promise().recover { err in<br>    guard !err.fatal else { throw err }<br>    return CLLocationChicago<br>}.then { location in<br>    // the user’s location, or Chicago if an error occurred<br>}.catch { err in<br>    // the error was fatal<br>}</pre><h3>Example: Retrieve Object Metadata</h3><p>If, for example, you want to determine whether the user has permission to update or delete a record so you can disable editing in your UI, or if you want to retrieve all the options in a picklist, rather than hardcoding them in your mobile app, then call salesforce.describe() to retrieve an object&#39;s <a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_describe.htm">metadata</a>:</p><pre>first {<br>    salesforce.describe(&quot;Account&quot;)<br>}.then {<br>    (accountMetadata) -&gt; () in <br>    saveButton.enabled = accountMetadata.isUpdateable<br>    let industryOptions = accountMetadata.fields[&quot;Industry&quot;]?.picklistValues<br>}.catch {<br>    error in <br>    debugPrint(error)<br>}</pre><h3>Example: Log Out</h3><p>If you want to log out the current Salesforce user, and then clear any locally-cached data, you could call the following. <em>Swiftly Salesforce</em> will revoke and remove any stored credentials, and automatically display a Safari View Controller with the Salesforce login page, ready for another user to log in.</p><pre>// Call this when your app&#39;s &quot;Log Out&quot; button is tapped, for example<br>if let app = UIApplication.shared.delegate as? LoginDelegate {<br>    app.logout().then {<br>        () -&gt; () in<br>        // Clear any cached data and reset the UI<br>        return<br>    }.catch {<br>        error in<br>        debugPrint(error)<br>    }<br>}</pre><h3>Main Components of Swiftly Salesforce</h3><ul><li><a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Pod/Classes/Salesforce.swift">Salesforce.swift</a>: This is your Swift interface to the Salesforce Platform, and likely the only file you’ll refer to. It has methods to query, retrieve, update and delete records, and to access <a href="https://developer.salesforce.com/page/Creating_REST_APIs_using_Apex_REST">custom Apex REST</a> endpoints.</li><li><a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Pod/Classes/Router.swift">Router.swift</a>: Acts as a ‘<a href="https://littlebitesofcocoa.com/93-creating-a-router-for-alamofire">router</a>’ for <a href="https://github.com/alamofire/alamofire">Alamofire</a> requests. The more important and commonly-used Salesforce <a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/">REST API</a>endpoints are represented as enum values, including one for <a href="https://developer.salesforce.com/page/Creating_REST_APIs_using_Apex_REST">custom Apex REST</a> endpoints.</li><li><a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Pod/Classes/AuthData.swift">AuthData.swift</a>: Swift struct that holds tokens, and other data, required for each request made to the Salesforce REST API. These values are stored securely in the iOS keychain.</li><li><a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Pod/Classes/Extensions.swift">Extensions.swift</a>: Swift extensions used by other components of <em>Swiftly Salesforce</em>. The extensions that you’ll likely use in your own code are DateFormatter.salesforceDateTime, and DateFormatter.salesforceDate, for converting Salesforce date/time and date values to and from strings for JSON serialization.</li><li><a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Pod/Classes/AuthManager.swift">AuthManager.swift</a>: Coordinates the OAuth2 authorization process, and securely stores and retrieves the resulting access token. The access token must be included in the header of every HTTP request to the Salesforce REST API. If the access token has expired, the AuthManager will attempt to <a href="https://help.salesforce.com/apex/HTViewHelpDoc?id=remoteaccess_oauth_refresh_token_flow.htm&amp;language=en_US">refresh</a> it. If the refresh process fails, then AuthManager will call on its delegate to authenticate the user, that is, to display a Salesforce-hosted web login form. The default implementation uses a <a href="https://developer.apple.com/videos/play/wwdc2015-504/">Safari View Controller</a> (new in iOS 9) to authenticate the user via the OAuth2 ‘<a href="https://help.salesforce.com/apex/HTViewHelpDoc?id=remoteaccess_oauth_user_agent_flow.htm&amp;language=en">user-agent</a>’ flow. Though ‘user-agent’ flow is more complex than the OAuth2 ‘<a href="https://help.salesforce.com/apex/HTViewHelpDoc?id=remoteaccess_oauth_username_password_flow.htm&amp;language=en">username-password</a>’ flow, it is the preferred method of authenticating users to Salesforce, since their credentials are never handled by the client application.</li></ul><h3>Dependent Frameworks</h3><p>The great Swift frameworks leveraged by <em>Swiftly Salesforce</em>:</p><ul><li><a href="http://promisekit.org/">PromiseKit</a>: “Not just a promises implementation, it is also a collection of helper functions that make the typical asynchronous patterns we use as iOS developers delightful too.”</li><li><a href="https://github.com/Alamofire/Alamofire">Alamofire</a>: “Elegant HTTP Networking in Swift”</li><li><a href="https://github.com/matthewpalmer/Locksmith">Locksmith</a>: “A powerful, protocol-oriented library for working with the keychain in Swift.”</li></ul><h3>Resources</h3><p>If you’re new to Swift, the Salesforce Platform, or the Salesforce REST API, you might find the following resources useful:</p><ul><li><a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/">Salesforce REST API Developer’s Guide</a></li><li><a href="http://www.salesforce.com/platform">Salesforce App Cloud</a>: aka the Salesforce Platform</li><li><a href="https://developer.salesforce.com/">Salesforce Developers</a>: official Salesforce developers’ site; training, documentation, SDKs, etc.</li><li><a href="https://partners.salesforce.com/">Salesforce Partner Community</a>: “Innovate, grow, connect” with Salesforce ISVs. Join the <a href="http://sfdc.co/sfdc-ios">Salesforce + iOS Mobile</a>Chatter group</li><li><a href="https://github.com/forcedotcom/SalesforceMobileSDK-iOS">Salesforce Mobile SDK for iOS</a>: Salesforce-supported SDK for developing mobile apps. Written in Objective-C. Available for <a href="https://github.com/forcedotcom/SalesforceMobileSDK-Android">Android</a>, too</li><li><a href="http://www.mobileandemerging.technology/a-salesforce-mobile-app-with-swift/">A Salesforce Swift App</a>: blog post on using Swift with the Salesforce Mobile SDK. By <a href="http://www.mobileandemerging.technology/author/jonathan-jenkins/">Jonathan Jenkins</a></li><li><a href="https://help.salesforce.com/HTViewSolution?id=000192840&amp;language=en_US">When to Use the Salesforce1 Platform vs. Creating Custom Apps</a></li><li><a href="https://github.com/alamofire/alamofire">Alamofire</a>: Swift version of AFNetworking, “…One of the most popular third-party libraries on iOS and OS X.” Tutorial <a href="http://www.raywenderlich.com/85080/beginning-alamofire-tutorial">here</a>.</li><li><a href="https://grokswift.com/bookshort/?utm_expid=86885646-0.pSwvTyVzSoG5VWML8NMtRw.1&amp;utm_referrer=https%3A%2F%2Fgrokswift.com%2F">iOS Apps with REST APIs</a>: great book for getting started with Swift, REST APIs, JSON, and Alamofire. “Only the nitty gritty that you need to get real work done now: interfacing with your web services and displaying the results in your UI.” By Christina Moulton of <a href="https://twitter.com/GrokSwift">GrokSwift</a></li><li><a href="http://www.centare.com/salesforce-mobile-sdk-quickstart/">Salesforce Mobile SDK Quick Start</a>: blog post by <a href="https://twitter.com/welbes">William Welbes</a></li></ul><h3>About Me</h3><p>I’m a senior technical ‘<a href="https://en.wikipedia.org/wiki/Technology_evangelist">evangelist</a>’ at Salesforce, and I work with <a href="https://en.wikipedia.org/wiki/Independent_software_vendor">ISV</a> partners who are building applications on the Salesforce Platform.</p><h3>Contact</h3><p>Questions, suggestions, bug reports and code contributions welcome:</p><ul><li>Open a <a href="https://github.com/mike4aday/SwiftlySalesforce/issues">GitHub issue</a></li><li>Twitter <a href="https://twitter.com/mike4aday">@mike4aday</a></li><li>Join the Salesforce <a href="https://p.force.com/">Partner Community</a> and post to the ‘<a href="http://sfdc.co/sfdc-ios">Salesforce + iOS Mobile</a>’ Chatter group</li></ul><h3>Appendix</h3><h3>Add Swiftly Salesforce to Your CocoaPods Podfile</h3><p>Adding <em>Swiftly Salesforce</em> to a simple Podfile:</p><pre>target &#39;MyApp&#39; do<br>  use_frameworks!<br>  pod &#39;SwiftlySalesforce&#39;<br>  # Another pod here<br>end</pre><p>See <a href="https://guides.cocoapods.org/syntax/podfile.html">Podfile</a> for more details</p><h3>Register Your Connected App’s Callback URL Scheme with iOS</h3><p>Upon successful OAuth2 authorization, Salesforce will redirect the Safari View Controller back to the callback URL that you specified in your Connected App settings, and will append the access token (among other things) to that callback URL. Add the following to your app’s .plist file, so iOS will know how to handle the URL, and will pass it to your app’s delegate.</p><pre>&lt;!-- ADD TO YOUR APP&#39;S .PLIST FILE --&gt;<br>&lt;key&gt;CFBundleURLTypes&lt;/key&gt;<br>&lt;array&gt;<br>  &lt;dict&gt;<br>    &lt;key&gt;CFBundleURLName&lt;/key&gt;<br>    &lt;string&gt;SalesforceOAuth2CallbackURLScheme&lt;/string&gt;<br>    &lt;key&gt;CFBundleURLSchemes&lt;/key&gt;<br>    &lt;array&gt;<br>      &lt;string&gt;&lt;!-- YOUR CALLBACK URL&#39;S SCHEME HERE (scheme only, not entire URL) --&gt;&lt;/string&gt;<br>    &lt;/array&gt;<br>  &lt;/dict&gt;<br>&lt;/array&gt;</pre><p>Then, you just need to add a single line in your app delegate class so that <em>Swiftly Salesforce</em> will handle the callback URL and the appended credentials.</p><pre>func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -&gt; Bool {<br>    handleRedirectURL(redirectURL: url as URL)<br>    return true<br>}</pre><h3>Configure your App Delegate for Swiftly Salesforce</h3><p>Update your app delegate class so that it:</p><ul><li>Configures <em>Swiftly Salesforce</em> with your Connected App’s consumer key and callback URL</li><li>Implements LoginDelegate - you don&#39;t have to implement any methods, though, thanks to the magic of Swift&#39;s <a href="http://www.codingexplorer.com/protocol-extensions-in-swift-2/">protocol extensions</a></li><li>Calls handleRedirectURL(url:) when asked by iOS to open the callback URL.</li></ul><pre>import UIKit<br>import SwiftlySalesforce</pre><pre>@UIApplicationMain<br>class AppDelegate: UIResponder, UIApplicationDelegate, LoginDelegate {</pre><pre>    var window: UIWindow?</pre><pre>    /// Salesforce Connected App properties (replace with your own...)<br>    let consumerKey = &quot;&lt; YOUR CONNECTED APP’S CONSUMER KEY HERE &gt;&quot;<br>    let redirectURL = URL(string: &quot;&lt; YOUR CONNECTED APP’S REDIRECT URL HERE &gt;&quot;)!</pre><pre>    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {<br>        configureSalesforce(consumerKey: consumerKey, redirectURL: redirectURL)<br>        return true<br>    }</pre><pre>    func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -&gt; Bool {<br>        handleRedirectURL(url: url)<br>        return true<br>    }<br>}</pre><h3>Add an ATS Exception for Salefsorce</h3><p>As of this writing, you need to add an <a href="https://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/">application transport security (ATS) exception</a> to your iOS application’s .plist file to allow it to connect to salesforce.com, as follows:</p><pre>&lt;!-- ADD TO YOUR APP&#39;S .PLIST FILE --&gt;<br>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;<br>&lt;dict&gt;<br>    &lt;key&gt;NSExceptionDomains&lt;/key&gt;<br>    &lt;dict&gt;<br>        &lt;key&gt;salesforce.com&lt;/key&gt;<br>        &lt;dict&gt;<br>            &lt;key&gt;NSExceptionRequiresForwardSecrecy&lt;/key&gt;<br>            &lt;false/&gt;<br>            &lt;key&gt;NSIncludesSubdomains&lt;/key&gt;<br>            &lt;true/&gt;<br>        &lt;/dict&gt;<br>    &lt;/dict&gt;<br>&lt;/dict&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a9625822fb4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swiftly Salesforce: Build Great iOS Apps on the Salesforce Platform]]></title>
            <link>https://medium.com/@mike4aday/swiftly-salesforce-build-great-ios-apps-on-the-salesforce-platform-dc0d7aa8213a?source=rss-2f7c8b74bd99------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc0d7aa8213a</guid>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Michael Epstein]]></dc:creator>
            <pubDate>Wed, 10 Aug 2016 16:39:31 GMT</pubDate>
            <atom:updated>2016-08-10T16:39:31.478Z</atom:updated>
            <content:encoded><![CDATA[<p>(<a href="http://developer.salesforce.com/blogs/isv/2016/05/swiftly-salesforce-build-great-ios-apps-on-the-salesforce-platform.html">Originally published</a> in the Salesforce Developers Blog on May 10, 2016)</p><p>I started working with <a href="http://www.apple.com/swift/">Swift</a>, Apple’s new, open-source programming language, about a year ago. It took me a while to wrap my head around the new syntax and features, especially <a href="http://www.touch-code-magazine.com/swift-optionals-use-let/">optionals</a>, but I’ve quickly become a big fan. Swift enables me to write better code more quickly, and much more succinctly. I believe there is great opportunity for Salesforce ISV partners, big and small alike, to build and sell more custom iOS apps. And it’s easier than ever, thanks to recent enhancements to the <a href="https://help.salesforce.com/HTViewHelpDoc?id=integrate_what_is_api.htm">Salesforce APIs</a> and the <a href="https://github.com/forcedotcom/SalesforceMobileSDK-iOS">Mobile SDK</a> — and the release of <em>Swiftly Salesforce</em>.</p><p><em>Swiftly Salesforce</em> is an open-source framework, written entirely in Swift, that I created to simplify the development of native iOS apps that integrate with Force.com. By design, <em>Swiftly Salesforce</em> is much smaller and lighter than the Mobile SDK, which is written in Objective-C, and includes features that I didn’t need for relatively-simple apps. <em>Swiftly Salesforce</em> focuses on only two things: freeing the developer from dealing with user authentication, and simplifying the coding of complex, asynchronous interactions with Salesforce APIs.</p><p>If you want to dive right into <em>Swiftly Salesforce</em>, you can find the source code, and easy setup instructions at: <a href="https://github.com/mike4aday/SwiftlySalesforce">https://github.com/mike4aday/SwiftlySalesforce</a></p><h3>Setting up Swiftly Salesforce</h3><p>You can get up and running in minutes with <em>Swiftly Salesforce</em>. Follow the steps below, and see the GitHub repository’s <a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/README.md">README</a> file for more details:</p><ol><li><a href="https://developer.salesforce.com/signup">Get</a> a free Salesforce Developer Edition.</li><li>Create a back-end Salesforce <a href="https://help.salesforce.com/apex/HTViewHelpDoc?id=connected_app_overview.htm">Connected App</a>.</li><li>Add <em>Swiftly Salesforce</em> to your Xcode project <a href="https://developer.salesforce.com/blogs/isv/wp-admin/post.php?post=30411&amp;action=edit&amp;language=en#appendix1">(See Appendix 1)</a>.</li><li>Register your Connected App’s callback URL scheme with iOS <a href="https://developer.salesforce.com/blogs/isv/wp-admin/post.php?post=30411&amp;action=edit&amp;language=en#appendix2">(See Appendix 2)</a>.</li><li>Configure your app delegate for <em>Swiftly Salesforce</em> <a href="https://developer.salesforce.com/blogs/isv/wp-admin/post.php?post=30411&amp;action=edit&amp;language=en#appendix3">(See Appendix 3)</a>.</li><li>Add an “application transport security” (ATS) exception for “salesforce.com” <a href="https://developer.salesforce.com/blogs/isv/wp-admin/post.php?post=30411&amp;action=edit&amp;language=en#appendix4">(See Appendix 4)</a>.</li></ol><p>Minimum requirements: iOS 9.1, Swift 2, and Xcode 7.</p><h3>Using Swiftly Salesforce</h3><p>Behind the scenes,<em> Swiftly Salesforce</em> leverages <a href="https://github.com/alamofire/alamofire">Alamofire</a> and <a href="https://github.com/mxcl/PromiseKit">PromiseKit</a>, two very widely-adopted frameworks built for elegant handling of network requests and asynchronous operations.</p><p>Below are some examples to illustrate how to use <em>Swiftly Salesforce</em>, and how you can chain complex asynchronous calls. You can also find a complete example app <a href="https://github.com/mike4aday/SwiftlySalesforce/tree/master/Example/SwiftlySalesforce">here</a>, which enables the user to retrieve and update task records.</p><p><em>Swiftly Salesforce</em> will automatically manage the entire Salesforce <a href="https://developer.salesforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com">OAuth2</a> process (a.k.a. the “OAuth dance”). If <em>Swiftly Salesforce</em> has a valid access token, it will include that token in the header of every API request. If the access token has expired, <em>Swiftly Salesforce</em> will attempt to refresh it, without bothering the user to re-enter the username and password. If <em>Swiftly Salesforce</em> can’t refresh the access token, then it will direct the user to the Salesforce-hosted login page.</p><h3>Example: Retrieve a Salesforce Record</h3><p>The following will retrieve all the fields for the account record with the specified record ID:</p><pre>SalesforceAPI.ReadRecord(type: &quot;Account&quot;, id: &quot;0013000001FjCcF&quot;.request()</pre><p>To specify which fields should be retrieved:</p><pre>let fields = [&quot;AccountNumber&quot;, &quot;BillingCity&quot;, &quot;MyCustomField__c&quot;]<br>SalesforceAPI.ReadRecord(type: &quot;Account&quot;, id: &quot;0013000001FjCcF&quot;, fields: fields).request()</pre><p>Note that ‘request( )’ is an asynchronous function, whose return value is a “<a href="https://en.wikipedia.org/wiki/Futures_and_promises">promise</a>” that will be fulfilled at some point in the future:</p><pre>let promise: Promise&lt;AnyObject&gt; = SalesforceAPI.ReadRecord(type: &quot;Account&quot;, id: &quot;0013000001FjCcF&quot;).request()</pre><p>Now we can add a closure that will be called later, when the promise is fulfilled:</p><pre>promise.then {<br>    (json) -&gt; () in<br>    // Parse the JSON and do useful stuff<br>}</pre><h3>Example: Update a Salesforce Record</h3><pre>SalesforceAPI.UpdateRecord(type: &quot;Task&quot;, id: &quot;00T1500001h3V5NEAU&quot;, fields: [&quot;Status&quot;: &quot;Completed&quot;]).request().then {<br>    (_) -&gt; () in<br>    // Update the local model<br>}.always {<br>    // Update the UI<br>}</pre><p>The ‘always’ closure will be called regardless of success or failure elsewhere in the promise chain.</p><h3>Example: Querying Salesforce</h3><pre>let soql = &quot;SELECT Id,Name FROM Account WHERE BillingPostalCode = &#39;\(postalCode)&#39;&quot;<br>SalesforceAPI.Query(soql: soql).request()</pre><p>See the next example for handling of the query results.</p><h3>Example: Chaining Asynchronous Requests</h3><p>Suppose we want to retrieve a random zip or postal code from a <a href="https://developer.salesforce.com/page/Creating_REST_APIs_using_Apex_REST">custom Apex REST</a> resource, and then use that code in a query:</p><pre>// Chained asynch requests <br>firstly {<br>    // GET request to custom Apex REST resource<br>    SalesforceAPI.ApexRest(method: &quot;GET&quot;, path: &quot;/MyApexResourceThatEmitsRandomZip&quot;).request()<br>}.then {<br>    // Query accounts with that zip code<br>    (result) -&gt; Promise in<br>    guard let zip = result[&quot;zip&quot;] as? String else {<br>        throw NSError(domain: &quot;TaskForce&quot;, code: -100, userInfo: nil)<br>    }<br>    let soql = &quot;SELECT Id,Name FROM Account WHERE BillingPostalCode = &#39;\(zip)&#39;&quot;<br>    return SalesforceAPI.Query(soql: soql).request()<br>}.then {<br>    // Parse JSON response<br>    (result) -&gt; () in<br>    guard let records = result[&quot;records&quot;] as? [[String: AnyObject]] else {<br>        throw NSError(domain: &quot;TaskForce&quot;, code: -101, userInfo: nil)<br>    }<br>    for record in records {<br>        if let id = record[&quot;Id&quot;] as? String, name = record[&quot;Name&quot;] as? String {<br>            print(&quot;Account ID = \(id); name = \(name)&quot;)<br>        }<br>    }<br>}</pre><p>You could repeat this chaining multiple times, feeding the result of one asynchronous operation as the input to the next operation. You could also spawn multiple, simultaneous operations and easily specify logic to be executed when all operations complete, when only the first operation completes, or when any operation fails, etc. <a href="http://promisekit.org/">PromiseKit</a> is an amazingly-powerful framework for handling multiple asynchronous operations that would otherwise be very difficult to coordinate. See <a href="http://promisekit.org/">PromiseKit documentation</a> for more examples.</p><h3>Example: Handling Errors</h3><p>The following code is from the example file, <a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Example/SwiftlySalesforce/TaskStore.swift">TaskStore.swift</a> and shows how to handle errors:</p><pre>firstly {<br>    SalesforceAPI.Identity.request()<br>}.then {<br>    // Extract user ID from JSON result<br>    (result) -&gt; String in<br>    guard let userID = result[&quot;user_id&quot;] as? String else {<br>        throw NSError(domain: &quot;TaskForce&quot;, code: -100, userInfo: nil)<br>    }<br>    return userID<br>}.then {<br>    // Query tasks owned by user<br>    (userID) -&gt; Promise in<br>    let soql = &quot;SELECT Id,Subject,Status,What.Name FROM Task WHERE OwnerId = &#39;\(userID)&#39; ORDER BY CreatedDate DESC&quot;<br>    return SalesforceAPI.Query(soql: soql).request()<br>}.then {<br>    // Parse JSON response into Task instances<br>    (result) -&gt; () in<br>    guard let records = result[&quot;records&quot;] as? [[String: AnyObject]] else {<br>        throw NSError(domain: &quot;TaskForce&quot;, code: -101, userInfo: nil)<br>    }<br>    let tasks = records.map { Task(dictionary: $0) }<br>    self.cache = tasks<br>    fulfill(tasks)<br>}.error {<br>    // Any errors in the chain would be caught here<br>    (error) -&gt; Void in<br>    reject(error)<br>}</pre><p>You could also recover from an error, and continue with the chain, using a ‘recover’ closure. The following snippet is from PromiseKit’s <a href="http://promisekit.org/recovering-from-errors">documentation</a>:</p><pre>CLLocationManager.promise().recover { err in<br>    guard !err.fatal else { throw err }<br>    return CLLocationChicago<br>}.then { location in<br>    // the user’s location, or Chicago if an error occurred<br>}.error { err in<br>    // the error was fatal<br>}</pre><h3>Example: Log Out</h3><p>If you want to log out the current Salesforce user, and then clear any locally-cached data, you could call the following. <em>Swiftly Salesforce</em> will revoke and remove any stored credentials, and automatically display a <a href="https://developer.apple.com/videos/play/wwdc2015/504/">Safari View Controller</a> with the Salesforce login page, ready for another user to log in.</p><pre>// &quot;Log Out&quot; button was tapped<br>if let app = UIApplication.sharedApplication().delegate as? LoginViewPresentable {<br>    app.logOut().then {<br>        () -&gt; () in<br>        // User&#39;s authorization now revoked - clear local data cache<br>        return<br>    }<br>}</pre><h3>Dependent Frameworks</h3><p>The great Swift frameworks leveraged by <em>Swiftly Salesforce</em>:</p><ul><li><a href="http://promisekit.org/">PromiseKit</a> (Version 3): “Not just a promises implementation, it is also a collection of helper functions that make the typical asynchronous patterns we use as iOS developers delightful too.”</li><li><a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Version%203">Alamofire</a>: “Elegant HTTP Networking in Swift”</li><li><a href="https://github.com/matthewpalmer/Locksmith">Locksmith</a>: “A powerful, protocol-oriented library for working with the keychain in Swift.”</li></ul><h3>Main Components of Swiftly Salesforce</h3><ul><li><a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Pod/Classes/SalesforceAPI.swift">SalesforceAPI</a>: Acts as a ‘<a href="https://littlebitesofcocoa.com/93-creating-a-router-for-alamofire">router</a>’ for <a href="https://github.com/alamofire/alamofire">Alamofire</a> requests. The more important, or commonly-used Salesforce <a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/">REST API</a> endpoints are represented as enum values. You can also easily create <a href="https://github.com/alamofire/alamofire">Alamofire</a> requests for your <a href="https://developer.salesforce.com/page/Creating_REST_APIs_using_Apex_REST">custom Apex REST</a> endpoints, for example, by following the pattern established in this file.</li><li><a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Pod/Classes/Credentials.swift">Credentials</a>: Swift struct that holds OAuth2 tokens, and other data, required for each request made to the Salesforce REST API. These values are stored securely in the iOS keychain.</li><li><a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Pod/Classes/Extensions.swift">Extensions</a>: Swift extensions used by other components of <em>Swiftly Salesforce</em>. The extensions that you’ll likely use in your own code are ‘NSDateFormatter.SalesforceDateTime,’ and ‘NSDateFormatter.SalesforceDate,’ for converting Salesforce date/time and date fields to and from strings for JSON serialization.</li><li><a href="https://github.com/mike4aday/SwiftlySalesforce/blob/master/Pod/Classes/OAuth2Manager.swift">OAuth2Manager</a>: Singleton that coordinates the OAuth2 <a href="https://help.salesforce.com/apex/HTViewHelpDoc?id=remoteaccess_oauth_user_agent_flow.htm&amp;language=en_US">user-agent</a> flow, and securely stores and retrieves the resulting access token. Though user-agent flow is more complex than the OAuth2 <a href="https://help.salesforce.com/apex/HTViewHelpDoc?id=remoteaccess_oauth_username_password_flow.htm&amp;language=en">username-password</a> flow, it is the preferred method of authenticating users to Salesforce, since their passwords are never handled by the client application.</li></ul><h3>Resources</h3><p>If you’re new to Swift, the Salesforce Platform, or the Salesforce REST API, you might find the following resources useful.</p><ul><li><a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/">Salesforce REST API Developer’s Guide</a></li><li><a href="https://partners.salesforce.com/">Salesforce Partner Community</a>: “Innovate, grow, connect” with Salesforce ISVs. Join the <a href="http://sfdc.co/sfdc-ios">Salesforce + iOS Mobile</a> Chatter group</li><li><a href="https://github.com/forcedotcom/SalesforceMobileSDK-iOS">Salesforce Mobile SDK for iOS</a></li><li><a href="http://www.mobileandemerging.technology/a-salesforce-mobile-app-with-swift/">A Salesforce Swift App</a>: blog post on using Swift with the Salesforce Mobile SDK. By <a href="http://www.mobileandemerging.technology/author/jonathan-jenkins/">Jonathan Jenkins</a></li><li><a href="https://help.salesforce.com/HTViewSolution?id=000192840&amp;language=en_US">When to Use the Salesforce1 Platform vs. Creating Custom Apps</a></li><li><a href="https://github.com/alamofire/alamofire">Alamofire</a>: Swift version of AFNetworking, “…One of the most popular third-party libraries on iOS and OS X.” Tutorial<a href="http://www.raywenderlich.com/85080/beginning-alamofire-tutorial">here</a>.</li><li><a href="https://www.objc.io/books/functional-swift/">Functional Swift</a>: great book for learning Swift 2, by the team at <a href="http://objc.io/">objc.io</a>. See their <a href="https://www.objc.io/books/">other books</a> on Advanced Swift, and Core Data.</li><li><a href="https://grokswift.com/bookshort/?utm_expid=86885646-0.pSwvTyVzSoG5VWML8NMtRw.1&amp;utm_referrer=https%3A%2F%2Fgrokswift.com%2F">iOS Apps with REST APIs</a>: great book for getting started with Swift, REST APIs, JSON, and Alamofire. “Only the nitty gritty that you need to get real work done now: interfacing with your web services and displaying the results in your UI.” By Christina Moulton of <a href="https://twitter.com/GrokSwift">GrokSwift</a></li><li><a href="https://www.natashatherobot.com/">Natasha the Robot</a>: widely-read blog with great tips for new and experienced Swift developers</li></ul><h3>About the Author</h3><p>Michael Epstein is a senior technical <a href="https://en.wikipedia.org/wiki/Technology_evangelist">evangelist</a> at Salesforce, and works with ISV partners who are building applications on the Salesforce Platform.</p><p>LinkedIn: <a href="https://www.linkedin.com/in/mike4aday">in/mike4aday</a> | twitter: <a href="http://twitter.com/mike4aday">@mike4aday</a></p><p>Question, feedback, or bug report about <em>Swiftly Salesforce</em>?:</p><ul><li>Open a <a href="https://github.com/mike4aday/SwiftlySalesforce/issues">GitHub issue</a></li><li>Twitter <a href="https://twitter.com/mike4aday">@mike4aday</a></li><li>Join the Salesforce <a href="https://p.force.com/">Partner Community</a> and post to the ‘<a href="http://sfdc.co/sfdc-ios">Salesforce + iOS Mobile</a>’ Chatter group</li></ul><h3>Appendices</h3><h3>Appendix 1: Add Swiftly Salesforce to Your CocoaPods Podfile</h3><pre>platform :ios, &#39;9.1&#39;<br>use_frameworks!</pre><pre>pod &#39;SwiftlySalesforce&#39;<br># Another pod could go here</pre><h3>Appendix 2: Register Your Connected App’s Callback URL Scheme with iOS</h3><p>Upon successful OAuth2 authorization, Salesforce will redirect the user to the callback URL that you specified in your Connected App settings, and will append the access token (among other things) to that callback URL. Add the following to your app’s .plist file, so iOS will know how to handle the URL, and will pass it to your app’s delegate.</p><pre>&lt;!-- ADD TO YOUR APP&#39;S .PLIST FILE --&gt;<br>&lt;key&gt;CFBundleURLTypes&lt;/key&gt;<br>&lt;array&gt;<br>  &lt;dict&gt;<br>    &lt;key&gt;CFBundleURLName&lt;/key&gt;<br>    &lt;string&gt;SalesforceOAuth2CallbackURLScheme&lt;/string&gt;<br>    &lt;key&gt;CFBundleURLSchemes&lt;/key&gt;<br>    &lt;array&gt;<br>      &lt;string&gt;&lt;!-- YOUR CALLBACK URL&#39;S SCHEME HERE (scheme only, not entire URL) --&gt;&lt;/string&gt;<br>    &lt;/array&gt;<br>  &lt;/dict&gt;<br>&lt;/array&gt;</pre><p>Then, you just need to add a single line in your app delegate class so that <em>Swiftly Salesforce</em> will handle the callback URL and the appended credentials.</p><pre>func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -&gt; Bool {<br>    handleRedirectURL(url)<br>    return true<br>}</pre><h3>Appendix 3: Configure your App Delegate for Swiftly Salesforce</h3><p>Update your app delegate class so that it:</p><ul><li>Configures <em>Swiftly Salesforce</em> with your Connected App’s consumer key and callback URL</li><li>Implements LoginViewPresentable — you don’t have to implement any methods, though, thanks to the magic of Swift 2’s <a href="http://www.codingexplorer.com/protocol-extensions-in-swift-2/">protocol extensions</a></li><li>Calls handleRedirectURL(NSURL:) when asked by iOS to open the callback URL.</li></ul><p>See below:</p><pre>import UIKit<br>import SwiftlySalesforce</pre><pre>@UIApplicationMain<br>class AppDelegate: UIResponder, UIApplicationDelegate, LoginViewPresentable {</pre><pre>    var window: UIWindow?<br>    let consumerKey = &quot;&lt;&lt;YOUR CONNECTED APP&#39;S CONSUMER KEY&gt;&gt;&quot;<br>    let redirectURL = NSURL(string: &quot;&lt;&lt;YOUR CONNECTED APP&#39;S CALLBACK URL&gt;&gt;&quot;)!</pre><pre>    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool {<br>        OAuth2Manager.sharedInstance.configureWithConsumerKey(consumerKey, redirectURL: redirectURL)<br>        OAuth2Manager.sharedInstance.authenticationDelegate = self<br>        return true<br>    }</pre><pre>    func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -&gt; Bool {<br>        handleRedirectURL(url)<br>        return true<br>    }<br>}</pre><h3>Appendix 4: Add an ATS Exception for Salefsorce</h3><p>As of this writing, you need to add an <a href="https://www.hackingwithswift.com/example-code/system/how-to-handle-the-https-requirements-in-ios-9-with-app-transport-security">application transport security (ATS) exception</a> to your iOS application’s .plist file to allow it to connect to salesforce.com, as follows:</p><pre>&lt;!-- ADD TO YOUR APP&#39;S .PLIST FILE --&gt;<br>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;<br>&lt;dict&gt;<br>    &lt;key&gt;NSExceptionDomains&lt;/key&gt;<br>    &lt;dict&gt;<br>        &lt;key&gt;salesforce.com&lt;/key&gt;<br>        &lt;dict&gt;<br>            &lt;key&gt;NSExceptionRequiresForwardSecrecy&lt;/key&gt;<br>            &lt;false/&gt;<br>            &lt;key&gt;NSIncludesSubdomains&lt;/key&gt;<br>            &lt;true/&gt;<br>        &lt;/dict&gt;<br>    &lt;/dict&gt;<br>&lt;/dict&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc0d7aa8213a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>