mirror of
https://github.com/purplecabbage/phonegap-plugins.git
synced 2026-04-24 03:00:11 -04:00
Changed getTwitterUserName to use the correct callback mechanism to avoid crashes
This commit is contained in:
@@ -156,7 +156,11 @@
|
||||
NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];
|
||||
ACAccount *twitterAccount = [accountsArray objectAtIndex:0];
|
||||
NSString *username = twitterAccount.username;
|
||||
[super writeJavascript:[[CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:username] toSuccessCallbackString:callbackId]];
|
||||
|
||||
NSString *jsResponse = [[CDVPluginResult resultWithStatus:CDVCommandStatus_OK
|
||||
messageAsString:username]
|
||||
toSuccessCallbackString:callbackId];
|
||||
[self performCallbackOnMainThreadforJS:jsResponse];
|
||||
}
|
||||
}];
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ Twitter.prototype.getMentions = function(success, failure){
|
||||
cordova.exec(success, failure, "TwitterPlugin", "getMentions", []);
|
||||
};
|
||||
|
||||
Twitter.prototype.getTwitterUsername = function(response){
|
||||
cordova.exec(response, null, "TwitterPlugin", "getTwitterUsername", []);
|
||||
Twitter.prototype.getTwitterUsername = function(success, failure) {
|
||||
cordova.exec(success, failure, "TwitterPlugin", "getTwitterUsername", []);
|
||||
};
|
||||
|
||||
cordova.addConstructor(function() {
|
||||
|
||||
Reference in New Issue
Block a user