[英]TypeError: Cannot read property 'googleplus' of undefined in IONIC with AngularJs
I've been following these links to use social login in my hybrid app. 我一直在关注这些链接,在我的混合应用程序中使用社交登录。
https://github.com/EddyVerbruggen/cordova-plugin-googleplus https://github.com/EddyVerbruggen/cordova-plugin-googleplus
https://ionicthemes.com/tutorials/about/google-plus-login-with-ionic-framework https://ionicthemes.com/tutorials/about/google-plus-login-with-ionic-framework
I've created all the google developer id's and all that stuff. 我创建了所有谷歌开发者ID和所有这些东西。 I've installed the cordova-plugin-googleplus using those two as they said.
正如他们所说,我已经使用这两个安装了cordova-plugin-googleplus。 But still my application showing the error i mentioned as header of this message...
但仍然我的应用程序显示我提到的错误作为此消息的标题...
In this line: window.plugins.googleplus.login(
在这一行:window.plugins.googleplus.login(
So, please help me with this one... I've stuck on this for 2 dayzz...Any help will be appreciated. 所以,请帮助我这个...我已经坚持这2天了...任何帮助将不胜感激。
Here below is an example of cordova plugins check in the $ionicPlatform.ready()
function wrapper: 下面是
$ionicPlatform.ready()
函数包装器中的cordova插件检查示例:
mainApp.run(["$ionicPlatform", "$window", function ($ionicPlatform, $window) {
$ionicPlatform.ready(function () {
if ($window.plugins && $window.plugins.googleplus) {
$window.plugins.googleplus.isAvailable(
function (available) {
if (available) {
// show the Google+ sign-in button
}
});
}
...
}
PS: $window
is an Angular wrapper for window
PS:
$window
是一个角包装window
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.