Created
October 27, 2011 06:36
-
-
Save cardinalblue/1318922 to your computer and use it in GitHub Desktop.
logout and authroization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//============================ | |
// mixi setup | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
_mixi = [[Mixi sharedMixi] setupWithType:kMixiApiTypeSelectorGraphApi | |
clientId:@"87b9651a2291e4853ac0" | |
secret:@"98866989c89c42e47d7d38394637faa84341ebb4" | |
appId:@"piccollage"]; | |
[_mixi restore]; | |
[_mixi reportOncePerDay]; | |
//.....other setup | |
} | |
//============================ | |
// mixi logout buttonPressed | |
- (void)logout | |
{ | |
[_mixi logout]; | |
[self cancelImagePicker]; | |
} | |
//=========================== | |
// authorization | |
- (void)presentMixiPicker | |
{ | |
Mixi *mixi = [Mixi sharedMixi]; | |
if (![mixi isAuthorized]) { | |
NSArray *permissions = | |
[NSArray arrayWithObjects:@"r_profile", @"r_photo", @"w_photo", @"w_voice", @"r_voice", nil]; | |
if (![mixi authorizeForPermissions:permissions]) { | |
MixiWebViewController *vc = MixiUtilDownloadViewController(self, @selector(closeDownloadView:)); | |
[self presentModalViewController:vc animated:YES]; | |
} | |
} | |
else { | |
// show mixi image picker | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment