| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
The Firebase Firestore Test Application (testapp) demonstrates Firebase Firestore operations with the Firebase Firestore C++ SDK. The application has no user interface and simply logs actions it's performing to the console.
The testapp performs the following:
Link your iOS app to the Firebase libraries.
Get CocoaPods version 1 or later by running,
sudo gem install cocoapods --pre
Update the pod versions in the Podfile to match the C++ SDK version that you are using. For the latest version of the C++ SDK, you can find the associated pod versions on the Add Firebase to your project page. For instance: if you're using SDK version 8.2.0, use the following in the Podfile (but note that pod versions may not always match the C++ SDK version):
pod 'Firebase/Firestore', '8.2.0' pod 'Firebase/Auth', '8.2.0'
From the testapp directory, install the CocoaPods listed in the Podfile by running,
pod install
Open the generated Xcode workspace (which now has the CocoaPods),
open testapp.xcworkspace
For further details please refer to the general instructions for setting up an iOS app with Firebase.
Register your iOS app with Firebase.
Download the Firebase C++ SDK linked from https://firebase.google.com/docs/cpp/setup and unzip it to a directory of your choice.
Add the following frameworks from the Firebase C++ SDK to the project:
In XCode, build & run the sample on an iOS device or simulator.
The testapp has no interative interface. The output of the app can be viewed via the console or on the device's display. In Xcode, select "View --> Debug Area --> Activate Console" from the menu to view the console.
Register your Android app with Firebase.
Create a new app on the Firebase console, and attach your Android app to it.
You can use "com.google.firebase.cpp.firestore.testapp" as the Package Name while you're testing.
To generate a SHA1 run this command on Mac and Linux,
keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
or this command on Windows,
keytool -exportcert -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
If keytool reports that you do not have a debug.keystore, you can create one with,
keytool -genkey -v -keystore ~/.android/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"
Add the google-services.json file that you downloaded from Firebase console to the root directory of testapp. This file identifies your Android app to the Firebase backend.
In the Firebase console for your app, select "Auth", then enable "Anonymous". This will allow the testapp to use anonymous sign-in to authenticate with Firebase Firestore, which requires a signed-in user by default (an anonymous user will suffice).
For further details please refer to the general instructions for setting up an Android app with Firebase.
Download the Firebase C++ SDK linked from https://firebase.google.com/docs/cpp/setup and unzip it to a directory of your choice.
Configure the location of the Firebase C++ SDK by setting the firebase_cpp_sdk.dir Gradle property to the SDK install directory. For example, in the project directory:
echo "systemProp.firebase\_cpp\_sdk.dir=/User/$USER/firebase\_cpp\_sdk" >> gradle.properties
Ensure the Android SDK and NDK locations are set in Android Studio.
Open build.gradle in Android Studio.
Install the SDK Platforms that Android Studio reports missing.
Build the testapp and run it on an Android device or emulator.
The testapp has no interactive interface. The output of the app can be viewed on the device's display, or in the logcat output of Android studio or by running "adb logcat *:W android_main firebase" from the command line.
Register your app with Firebase.
Download the Firebase C++ SDK linked from https://firebase.google.com/docs/cpp/setup and unzip it to a directory of your choice.
Configure the testapp with the location of the Firebase C++ SDK. This can be done a couple different ways (in highest to lowest priority):
From the testapp directory, generate the build files by running,
cmake .
If you want to use XCode, you can use -G"Xcode" to generate the project. Similarly, to use Visual Studio, -G"Visual Studio 15 2017". For more information, see CMake generators.
Build the testapp, by either opening the generated project file based on the platform, or running,
cmake --build .
Execute the testapp by running,
./desktop_testapp
Note that the executable might be under another directory, such as Debug.
The testapp has no user interface, but the output can be viewed via the console.
https://firebase.google.com/support/
Copyright 2016-2019 Google LLC Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
| Back | FazBrowse Home | New Git URL |