quickstart-unity
quickstart-unity copied to clipboard
Support Firebase SDK on devices without Google Play Services
I'm using unity 2018.3.0b2 and the firebase sdk 5.3.1 to build on my Oculus Go.
At startup I get this in my debug:
Firebase App initializing app com.eyeflite.wingvr
That's the last I see from my firebase debug output (no auth initiated or sign in attempt made). Then, I'm prompted with a system dialog that " {my app} won't run without play services which weren't supported by your device"
I hadn't seen this system prompt on 5.3.0 and the auth system was working fine. Any ideas about what's going on?
This is in my Awake() function:
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
var dependencyStatus = task.Result;
if (dependencyStatus == Firebase.DependencyStatus.Available) {
// Create and hold a reference to your FirebaseApp, i.e.
app = Firebase.FirebaseApp.DefaultInstance;
auth = Firebase.Auth.FirebaseAuth.DefaultInstance;
Debug.Log("auth inited!");
SignInAndGetToken();
} else {
UnityEngine.Debug.LogError(System.String.Format(
"Could not resolve all Firebase dependencies: {0}", dependencyStatus));
// Firebase Unity SDK is not safe to use here.
}
});
Almost all Firebase SDKs on Android compatible devices require Google Play Services. In particular the Unity SDK is built on top of the C++ and, transitively, the Android SDK which requires Google Play Services detailed here: https://firebase.google.com/docs/cpp/setup#requiring_google_play_services
just reverted to sdk version 5.3.0 and no system dialog is displayed
@stewartmiles I'm not sure what you mean, the sdk works as described on the getting started page as of 5.3.0 and as of 5.3.1 a system error dialog is displayed with the same code.
@IanPhilips that's curious, what components in Firebase are you using? We did update the Android SDK library versions in the 5.3.1
SDK (see the *Dependencies.xml` files and the delta between them) so it's possible one of the libraries added a dependency upon Google Play Services that didn't exist before. If you're using anything other than Analytics, I would expect this to not work on any device that doesn't have the Play Store and Google Play Services.
I'm only using Firebase.Auth
Yep Auth definitely requires Google Play Services.
FWIW: https://developer.oculus.com/documentation/mobilesdk/latest/concepts/book-intro/ says...
No Google Play Services. Unlike the Samsung Galaxy devices that run Gear VR, Oculus Go does not ship with Google Play Services installed. You cannot rely on Google Play Services (e.g. Google Firebase, Google Cloud Messaging, etc) when running on Oculus Go.
I saw that when I was looking around but I'm still confused why 5.3.0 would work and 5.3.1 wouldn't.
Auth was upgraded in 5.3.1
and we've moved to require the most recent version of Google Play Services. If you side-load the latest Google Play Services it may (probably won't) work.
Haha, okay thanks for your help. I wonder where the outdated Google Play Services is coming from...
Is there a guide if I want to develop for oculus go with firebase?
@jcyh0120 you probably should not use firebase or if you have to, use the REST API
I need to use cloud storage with oculus go. Is it possible with RESTAPI?
@tairam Nope, the only officially supported way to use Firebase Storage is through the official APIs.
@tairam it is possible to use the REST API instead of the SDK, it's work but it's possible.
Are there plans to get Firebase working on devices without Google Play Services? While it may be possible to use the REST API with quite a lot of additional effort, the lack of built-in support means Oculus Go, Oculus Quest, and other HMDs running a flavour of Android (eg: HTC Focus?) means Firebase is a bad choice for developers. A shame, because it's my preferred solution on all the other platforms!
We're going to see more VR (and AR?) HMDs using Android be released, and to put up barriers for using Firebase on this emerging market seems a strange decision.
@yezzerfv we're working on moving some components with the first one being Authentication on Android. This will allow the use of Auth, Function, Realtime Database, Storage and - eventually - Firestore, without Google Play Services.
Which products would you need to work?
What about Analytics / Crash reporting? I'm using them in a classic native (no Unity) Android app in an enterprise environment where Google Play Services is not available. Do you plan on migrating Analytics / Crash reporting / Performance monitoring w/o Play Services?
@stewartmiles I think that for most of us in the VR world the priorities are (in this order):
- Auth
- Realtime Database
- Storage
- Functions / Firestore
I've been using your REST API for some time now to bypass this limit, but the downside is that the VR app and the firebase server data will be less secure.
@Zhelyazko Google Analytics for Firebase doesn't require Google Play Services. I'm fairly sure that Crashlytics & Performance Monitoring currently have a dependency upon Instance ID which does require Google Play Services. We may change this dependency in future.
@yahavt as I mentioned we're moving Auth at the moment. So all of the products you've listed will be functional on devices without Google Play Services.
Hi @stewartmiles
When / which version of firebase unity SDK that support Auth, firestore and storage to function without google services? I really would like to know because currently we're migrating to Oculus Quest from Cardboard and stuck with this issues :(
We were considering to Develop our own API using the REST API but it will take a while as well
@metallizard the Android code is written to turn Firebase Auth into a thick client but it's going through review. We then need to alpha test it with Android devs before we can release it to the public with the C++ and Unity SDK updates to remove the check for Google Play Services being present if Firebase Auth is being used. Right now the timeline is at least a couple of months.
So we can expect for Unity SDK at least a couple of months for now?
For now my apps need REST API then. Thank you for the info
MLkit barcode scanner can work without google play service? i had get the offline lib ,but it not work wihout goole play ~~~
@stewartmiles Any chance it would be possible to be part of an alpha testing group? I'm looking to use firebase for a prototype of an application for oculus quest; wouldn't mind rough edges or bugs or significant initial setup.
Alternatively, any guesses as to whether leveraging https://github.com/FirebaseExtended/auth-without-play-services to provide Firebase Auth would be sufficient to get the existing Unity SDK Realtime Database component working?
I would also be interested in opting into an alpha/beta of this. I'm looking to use Firebase for a quest application early-2020, and would like to start building out the infrastructure.
The components that I'm looking to use are Firebase Auth and Storage
@vorporeal and @jyin96 I'll let the team know who are working on this.
+1 for an alpha or beta, we're working on multiplatform collaboration software deploying to Quest among many other platforms so this would be super useful!
On Tue, 27 Aug 2019 at 21:39, Stewart Miles [email protected] wrote:
@vorporeal https://github.com/vorporeal and @jyin96 https://github.com/jyin96 I'll let the team know who are working on this.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/firebase/quickstart-unity/issues/223?email_source=notifications&email_token=AKYSF5GF4NMVNO7LOZ4FQI3QGWGGZA5CNFSM4F2Z2Y4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5JBLYY#issuecomment-525473251, or mute the thread https://github.com/notifications/unsubscribe-auth/AKYSF5HCHNYMZJKJQSTYO6TQGWGGZANCNFSM4F2Z2Y4A .
-- Iestyn Lloyd CTO
Check out our VR & AR collaboration tool, VISIONxR http://www.futurevisual.com/visionxr™
[email protected] www.futurevisual.com +44 (0)7595 499100
+1 to an Alpha - already a Firebase customer and hoping to work on a Quest application asap using auth and Firestore
On Tue, Aug 27, 2019 at 4:46 PM yezzerfv [email protected] wrote:
+1 for an alpha or beta, we're working on multiplatform collaboration software deploying to Quest among many other platforms so this would be super useful!
On Tue, 27 Aug 2019 at 21:39, Stewart Miles [email protected] wrote:
@vorporeal https://github.com/vorporeal and @jyin96 https://github.com/jyin96 I'll let the team know who are working on this.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/firebase/quickstart-unity/issues/223?email_source=notifications&email_token=AKYSF5GF4NMVNO7LOZ4FQI3QGWGGZA5CNFSM4F2Z2Y4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5JBLYY#issuecomment-525473251 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AKYSF5HCHNYMZJKJQSTYO6TQGWGGZANCNFSM4F2Z2Y4A
.
-- Iestyn Lloyd CTO
Check out our VR & AR collaboration tool, VISIONxR http://www.futurevisual.com/visionxr™
[email protected] www.futurevisual.com +44 (0)7595 499100
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/firebase/quickstart-unity/issues/223?email_source=notifications&email_token=AAW64SSWRDTJBAVSRBZWPPDQGWHCRA5CNFSM4F2Z2Y4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5JCARI#issuecomment-525475909, or mute the thread https://github.com/notifications/unsubscribe-auth/AAW64SQCZLF7GEB54CLHUQLQGWHCRANCNFSM4F2Z2Y4A .
@Zhelyazko Google Analytics for Firebase doesn't require Google Play Services. I'm fairly sure that Crashlytics & Performance Monitoring currently have a dependency upon Instance ID which does require Google Play Services. We may change this dependency in future.
@yahavt as I mentioned we're moving Auth at the moment. So all of the products you've listed will be functional on devices without Google Play Services.
@stewartmiles you said that Google Analytics for Firebase doesn't require Google Play Services, but if I log an event using the Firebase Analytics, I get the following logs in logcat:
I setup Firebase Analytics as the tutorial: https://firebase.google.com/docs/analytics/android/start/
How should I setup my project so that I can user Firebase Analytics without Google Play Services (or with an outdated version)?
Is there any place where we can see the information of which Firebase components require Google Play Services?
@stewartmiles , thanks for clarifying. I'm getting what seems to be a similar error when running a project on the Oculus Quest that includes the Auth and Storage SDKs (version 6.4.0):
2019-09-17 23:31:39.531 14226-14250/? E/Unity: InitializationException: Firebase modules failed to initialize: auth (missing dependency), storage (missing dependency)
at Firebase.FirebaseApp.CreateAndTrack (Firebase.FirebaseApp+CreateDelegate createDelegate, Firebase.FirebaseApp existingProxy) [0x000e3] in <376fb5a5a3524225a54a2d810ebdc8a6>:0
at Firebase.FirebaseApp.Create () [0x00027] in <376fb5a5a3524225a54a2d810ebdc8a6>:0
at Firebase.FirebaseApp.get_DefaultInstance () [0x00017] in <376fb5a5a3524225a54a2d810ebdc8a6>:0
at Softspace.Apis.Firebase.FirebaseAuthClient.get_App () [0x00008] in <0290aec2e5d14994a3f043bd564f16aa>:0
at Softspace.Apis.Firebase.FirebaseAuthClient.get_Auth () [0x00008] in <0290aec2e5d14994a3f043bd564f16aa>:0
at Softspace.Apis.Firebase.FirebaseAuthClient.Awake () [0x00000] in <0290aec2e5d14994a3f043bd564f16aa>:0
This exception is thrown when the code tries to get the property FirebaseApp.DefaultInstance.
This is different from what @IanPhilips reported; there's no explicit reference to Google Play Services in my case. Is this still being caused by the same issue?
Regardless, we're also building for the Quest, and would love to be added to any alpha with a version of the SDK that doesn't need Google Play Services!
Thanks a bunch.