-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using dart:js and Google's javascript #52
Comments
@Goutte The latest oauth2 client is:
Can you let us know if the issue still happens after upgrading? |
@financecoding Thanks for the interest ! I'm using |
The exception occurs within a callback registered to "oauth2relayReady", or "oauth2callback", it's hard to say. (minified js) I see |
@Goutte so it is happening with the latest version of the library? |
@financecoding Yes. Further inquiry reveals that the attribute |
The variable (whose
Google is trying to |
Hmmm... that's a weird error. It might be that gapi is also listening for the auth window and both methods trying to catch the token at the same time is causing this issue. Since you are using gapi anyway I would suggest using the gapi-provided Google+ Sign-in button for authentication, and using See https://github.com/dart-gde/gplus-quickstart-dart/tree/master/client-side/web for a sample implementation of this. |
@Scarygami Thanks a lot for the example link, it's handy ! Yes, gapi is listening on the infamous Anyway, I will have to recede, as you suggested, on the usage of On another note, looking at the examples... Is there any reason for keeping: <script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/client:plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script> instead of ScriptElement script = new ScriptElement();
script.async = true;
script.type = "text/javascript";
script.src = "https://plus.google.com/js/client:plusone.js";
document.body.children.add(script); ? I'm more than tempted to use the second solution ! (embedding of dart code before and after, maybe a Future for when loaded ?) |
No reason for doing the script loading in JavaScript. I prefer to do it directly in Dart as well. |
Load this in the page :
When using
new GoogleOAuth2(client_id, scopes);
and then login, I get the cryptic :... which is in the js loaded by
https://apis.google.com/js/client:plusone.js
?A Dart call makes a js lib fail.
Is it just me ?
I have dart:js imported as well, as I'm trying down the road to :
but I'm not even there yet. This issue has too much shadows for me, can anyone shine some light ?
google_oauth2_client: '>=0.2.18 <1.0.0'
Dartium Version 31.0.1650.48 custom (240209).
The text was updated successfully, but these errors were encountered: