StartApp iOS (v2 SwiftUI XCode 11)

Authentication system for iOS apps written in Xcode 11 and SwiftUI. StartApp is an iOS project that startups and indie iOS developers need for an easy and quick start coding process of a universal iOS app. All professional apps need an authentication system to allow their users to register and login in different devices, store user's data in a cloud database and an analytics system.

StarApp allows users to sign in with Email and Password using a nice and user-friendly form, creates a users database to manage user accounts and store their data in Google Firebase. Uses the last version of Google Firebase Cloud Firestore database, authentication systems and Google Analytics that allows you to build apps fast, without managing infrastructure and without cost. StartApp provides a nice UI design built with Apple's new framework SwiftUI for your Register and Login screens that fits perfectly in all iPhones and iPad screens size and even in Dark Mode configuration. All code to connect read and write data in real-time to Firebase and manage users errors is provided as well as a clear tutorial about how to install StartApp. All code is written in Swift 5, well commented and easy to customize for your own app.  

Features

Technical features: 

        

     

Install StartApp

StartApp uses CocoaPods to install Firebase library dependencies. If you don’t have CocoaPods installed in your mac, please install it first:  https://guides.cocoapods.org/using/getting-started.html 

  1. Unzip  the “StartApp_iOS.zip”.  
  2. Open your Mac Terminal. You can use “Spotlight Search” to open it:  

  1. Go to StartApp_iOS directory in your Terminal. You can write: cd  and drag and drop the folder into terminal to easily write the directory:

  1. Press “Enter” to access to the directory in Terminal
  2. Write the command: pod install and press enter to install Firebase dependencies:

  1. Open StartApp.xcworkspace project (white icon). Please, from now on always use this file, never use the StartApp.xcodeproj (blue icon).

  1. Run the app and try to register in the simulator. Go to Xcode menu Product>Run. If you have problems or errors, please, continue with this tutorial...

CREATE YOUR OWN FIREBASE PROJECT:

StartApp uses Firebase from Google to manage users, Firestore database and analytics.

If you could login into the app is because StartApp is configured with the Firebase account of StartApp team. You can set up the app with your own accounts by creating your own Firebase project.

  1. Go to  https://console.firebase.google.com/ and use your Google account to sign in or register. Click on “Add project”:

  1.  Write your app name and press “Continue”:

  1. Enable Google Analytics and click “Continue”:

  1. Create a new Google Analytics account by writing the name of your app.

Click “Save”. Select your country in “Analytics Location”, check all the conditions and click on “Create project”:

  1. Wait until Firebase creates your project and then go to “iOS” to add an app to your Firebase project:

  1. To fill out the Firebase form you need your “iOS bundle ID”. Go to Xcode by opening the StartApp.xcworkspace project (white icon). Change the “Bundle Identifier” for your own one by  following this format: com.yourname.yourappname  

  1. Go to “Signing & Capabilities” and select your Team.  

  1. Come back to Firebase, fill out the form and click “Register app”:  

  1. Download the “GoogleService-Info.plist” file and replace it in StartApp Xcode project. Please make sure that the name of the file is the same as you downloaded: GoogleService-Info.plist  If it’s the case, remove any number that it might have at the end of the name: GoogleService-Info(1).plist  

  1. Drag and Drop the “GoogleService-Info.plist” in Xcode in the same place of the old one.

 

18. Delete the old one:

19. Skip steps 3, 4 and 5 on the Firebase website. StartApp already has the code to connect to Firebase. Just click “Next”.    

20. On step 5 click “Skip this step”:

21. Go to “Authentication” and click on  “Set up sign-in method”:

22. Click on “Email/Password”, “Enable” and “Save”:

23. Go to “Database” and create a Cloud FireStore database:

24.  Select  “Start in production mode”and Click “Next”:

25. Select the region where you think the majority of your app users will connect and click Done:

26. Click on “Start collection” write “User” as collection id and click “Next”:

27. Create a Test field with String type and test Value and click “Save”:  

28. Go to “Rules” copy and paste the following code and click Publish:

 rules_version = '2';

// Allow read/write access to all logued users

service cloud.firestore {

  match /databases/{database}/documents {

    match /{document=**} {

      allow read: if request.auth != null;

      allow update, create, delete: if true;

    }

  }

}

29. Quit Xcode and repeat the steps from 2 till 7 of this tutorial in order to run CocoaPods reinstall the Firebase dependencies and link to your Firebase project.

30. Finally run your Project in Xcode and try it out!