Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by Navadan · Aug 16, 2017 at 11:38 AM · webglscript loading

Use firebase with webGL build

How would I go about using firebase as a database with my WebGL build? What I know so far is that I probably have to interact with browser scripting, since there's no firebase SDK for WebGL. To communicate with Firebase I have to import a script as per the firebase for web guide, but I don't know how to import this script. What I've tried:
- Copy paste the script into a .jslib file and putting the file in the plugins for WebGL folder, both with and without the "mergeInto(LibraryManager.library, {//firebase.js here}"
- Using Dynamic Script Loading from this answer https://stackoverflow.com/a/950146

Both of these methods seem to cause the build to fail with these errors:
Failed running "C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten_Win\python\2.7.5.3_64bit\python.exe" "C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\emcc" @"C:\Users\Emil\CloudStation\Koder\Unity\Flick\Assets..\Temp\emcc_arguments.resp"

Exception: Failed building WebGL Player.

UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.

So I think that what I need to know is how to correctly import the firebase.js script.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Navadan · Aug 17, 2017 at 08:11 AM

I have solved it now. I ended up using the WWW module combined with this from firebase.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image peterworth · Sep 13, 2017 at 01:07 PM 0
Share

But it seems like you can't do authentication using the REST API? I don't see how you can realistically use a firebase database without authentication for the rules, how did you deal with that?

avatar image veereshkumbar · Oct 27, 2017 at 05:51 AM 0
Share

can u please show me the code how you did it . I want to build my game in 3 platforms iOS, Android and WebGL using Firebase but when i use firebase namespace its showing errors while building Game for WebGL platform. Please Help

avatar image Navadan · Nov 08, 2017 at 08:22 AM 0
Share

As @peterworth pointed out, it doens't seem like you can do authentication using the REST API. At least not for Web GL, since anyone can see the json-request being send and recived. So I have now marked this as unanswered again, and am still looking for answer.

avatar image Dragate Navadan · Nov 08, 2017 at 08:32 AM 0
Share

@Navadan Don't think it's possible. Lately, I did some research on using Firebase Storage with Auth (not for WebGL) and I stumbled upon a Q&A video made by a firebase dev and he happened to say that it's not possible with WebGL. However, since the video's release maybe they have made some improvements.

avatar image panpan1997 · Jun 20, 2018 at 02:17 PM 0
Share

may you send me the code of how to use WWW module for firebase? please I search and work out for this very long time and i cannot have a right solution to solve the problem

avatar image
0

Answer by ACCACORE · Mar 04, 2021 at 12:08 PM

Yuu could use this plugin: https://assetstore.unity.com/packages/tools/network/api-for-firebase-189910

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

119 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity 5.3 is Slower on WebGL and iPad 2 Answers

Drawing, Writing on screen. 0 Answers

WebGL and Python Building Errors 0 Answers

Is possible to Embed WebGL Compiled Game in Blogger? if Possible How? 2 Answers

[Help] with WebGL optimization (low poly objects, HD4000 gpu) 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges