问题
Getting this Uncaught Error: This Firebase project requires import into Google Cloud Platform to resume service. When I am trying to conference video call through Webrtc.
I got this url- https://firebase.google.com/support/guides/firebase-web#import_your_project_to_the_firebase_console
but I don't want to upload my project on cloud.
回答1:
I got the solution. Go to this url https://console.firebase.google.com/ and login as gmail account. Click on "Add Project" You will get page like this See this image
After that you'll get your created project like this See this image
Now click on project.You'll redirect to firebase project overview page.Click on "Add Firebase to your web app". See this image
You'll get this code
apiKey: "******************************", authDomain: "****-****", databaseURL: "****-****", projectId: "****-****", storageBucket: "****-*****", messagingSenderId: "************"
See this image
Copy databaseURL and replace with your webrtc code where firebase url or code is define.
You may get like this in webrtc code
openSocket: function(config) { var channel = config.channel || location.href.replace( //|:|#|%|.|[|]/g , ''); var socket = new Firebase('####-####' + channel); socket.channel = channel; socket.on("child_added", function(data) { config.onmessage && config.onmessage(data.val()); }); socket.send = function(data) { this.push(data); }; config.onopen && setTimeout(config.onopen, 1); socket.onDisconnect().remove(); return socket; }
Replace
var socket = new Firebase('####-#####' + channel);
to
var socket = new Firebase('****databaseURL****' + channel);
Please Remove **** in ''
Now Click on Database option which is placed in left side and select "Realtime Database"
See this image
Now Click on "Rules" Tab and change the "Read Write" value.Both value should "true". See this image
Now Check your webrtc consultation.This will run without firebase error.
来源:https://stackoverflow.com/questions/49938229/uncaught-error-this-firebase-project-requires-import-into-google-cloud-platform