Add Google Firebase to an Android Digitise app
This topic provides a basic guide to adding Google Firebase to a Digitise app or pre-configured Digitise Apps Client for the Android Platform:
Go to https://firebase.google.com/.
Sign in with a Google gmail account. If you don't have one, you can create one from the sign in page, by clicking Create account.
Click Go to console (https://console.firebase.google.com).
If this is the first time you are registering an app with Firebase, click Create a project.
If you have already created one or more Firebase projects, click Add project to create a new project or click on an existing project to use that project instead.
If you have selected an existing project to add your app to, the project page will be displayed and you can add your app, see below for instructions.
If you are creating or adding a new project, enter a name for this project and, if this is your first project, click I accept the Firebase terms.
Click on the 'I confirm that I will use Firebase exclusively for purposes relating to my trade, business, craft, or profession.' check box.
Click Continue.
The Google Analytics for your Firebase project page will be displayed.
Check whether Enable Google Analytics for this project is enabled. If you want to use Google Analytics, this option should be selected. If you don't want to collect usage data through the Firebase service, deselect the option.
Click Continue.
If the Configure Google Analytics page is displayed, select the account you want to use for Google Analytics - select Default Account for Firebase or create a new account.
Click Create project.
Once your project is ready, click Continue.
Whether you have added a new project or opted to add your app into an existing project, you will now be at the project page.
If you are using an existing project which already has apps registered, you will see a list of these apps displayed just below the project name at the top of the page. Click on the + button or + Add app button at the end of the list to add a new app. The list of apps will be replaced by a toolbar with a set of buttons.
If you have created a new project, or the project you chose doesn't yet have any apps registered, you will see a 'Get Started' message below the project name with the set of buttons below that.
Click on the Android button, , to add your Digitise app/Client to this project.
The Add Firebase to your Android App page will be displayed.
Enter the Package Name in the Android package name field - you can find the Package Name you need from App Studio:
-
Load your Digitise app in App Studio or if you are adding a pre-configured Digitise Apps Client, you don't need to load an app.
-
Choose the Ribbon's Publish tab. Click on Request Build → Standalone App → Android or Request Build → Pre-configured Client → Android, as appropriate.
-
The Package Name can be found in the Package Name field under the General tab.
-
You can copy and paste the ID from App Studio into the Firebase Console.
- The Package Name includes a modified version of the name of your Digitise Apps project. For Android apps, your project name cannot contain a space followed by a number, otherwise it will produce an invalid Package Name which will be rejected by Firebase when you attempt to register the app in the Firebase console. For example, you cannot name your project MyApp 2 or MyApp 1 2 but MyApp v2 or MyApp12 would be all right.
Back in the Firebase Console, enter an App nickname. This is a user-friendly name of your choice used to identify your app in Firebase.
Click Register app.
Click Download google-services.json to download the google-service.json services file. Note that you will need to import this file into the Build request dialog box in App Studio when you request a build of your Digitise app or pre-configured Client. You need to generate a separate version of this file for each app and another one for any pre-configured Digitise Apps Clients. The file always has the same file name, google-service.json, so you will need to take care not to overwrite one version with another and make sure you use the correct file when building your apps or pre-configured Clients.
Click Next, Next and then Continue to console.
The console will return to the project page and your new app will be listed, with any other apps registered to this project, below the project title.
Once you have registered a Digitise app/Client with the Firebase console, you can then include Crashlytics and push notifications within a Standalone App version of the app or a pre-configured version of the Digitise Apps Client from within App Studio.
If you enable Firebase in a Standalone App or pre-configured Digitise Apps Client, you can access your Crashlytics data and also Analytics data, if you enabled Analytics when you created the Firebase project, from the Firebase web site. Sign in to the web site as described above and then choose the relevant project from the projects displayed. Click on Crashlytics or one of the Analytics options in the left-hand menu to display data for the selected option.
You can check within a Standalone App or Digitise Apps Client whether Crashlytics has been enabled. Check Settings → About from the app/Client's Home page. Look for the Enable Firebase setting. If this option displays Yes, Firebase support was enabled when the app was built, if No, it is disabled.