I am trying to login with Twitter on Android using Cordova/PhoneGap. I haved used this example :
TwitterConnect.login( function(result) {
console.log('Successful login!');
console.log(result);
}, function(error) {
console.log('Error logging in');
console.log(error);
} );
It throws the following error: uncaught type error: cannot call method 'login' of undefined
.
The error tells you that TwitterConnect
is undefined
. One of the following reasons could be your case:
cordova plugin add twitter-connect-plugin
android
and ios
support, you can't test in a browser. Run the app on a device with:
cordova run android
cordova run ios
您应该确保将Fabric API密钥放入
cordova plugin add twitter-connect-plugin --variable FABRIC_KEY=<Fabric API Key>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.