zoukankan      html  css  js  c++  java
  • 友盟第三方登陆

    友盟第三方登陆

    #pragma mark 使用第三方登陆需要重写下面两个方法 - (void)applicationDidBecomeActive:(UIApplic ation*)application {

    //登陆需要编写 [UMSocialSnsService

    applicationDidBecomeActive];
    }
    #pragma mark 使用第三方的路需要重写两个方法

    - (BOOL)application:(UIApplication *)application

    openURL:(NSURL *)url sourceApplication:(NSString

    *)sourceApplication annotation:(id)annotation

    {
    return [UMSocialSnsService

    handleOpenURL:url wxApiDelegate:nil]; }

    #pragma mark 个人资料 点击触发方法 - (void)resumeview
    {

    if (self.isBig) { [self.bigCodeImageV

    removeFromSuperview]; self.isBig = NO;

    }else if(!self.isBig) {

    UMSocialSnsPlatform *snsPlatform = [UMSocialSnsPlatformManager

    getSocialPlatformWithName:UMShareToSina]; snsPlatform.loginClickHandler(self

    ,[UMSocialControllerService defaultControllerService],YES,^(UMSocialRe sponseEntity *response){

    NSLog(@"response is %@",response);

    //如果是授权到新浪微博,SSO之后如果 想获取用户昵称,头像,需要再获取一次账户细腻

    [[UMSocialDataService defaultDataService]

    requestSocialAccountWithCompletion:^(UMSoc ialResponseEntity *response) {

    //获取用户昵称

    NSString

    *str=[[[response.data objectForKey:@"accounts"]objectForKey:UMSh areToSina]objectForKey:@"username"];

    //获取图片地址

    NSString

    *url=[[[response.data objectForKey:@"accounts"]objectForKey:UMSh areToSina]objectForKey:@"icon"];

    // UMSocial AccountEntity *snsAccount =

    [[UMSocialAccountManager

    socialAccountDictionary]valueForKey:UMShar eToSina];

    // NSLog(@" %@",snsAccount);

    self.myView.nameL.text =

    str; sd_setImageWithURL:[NSURL

    [self.myView.imageV URLWithString:url]];

    NSString *docPath = [NSSearchPathForDirectoriesInDomains(9, 1,

    1)lastObject];

    NSString *filePath = stringByAppendingPathComponent:@"user.txt"

    //数组写入文件

    NSArray *array = [NSArray arrayWithObjects:str,url, nil];

    [array writeToFile:filePath atomically:YES];

    //字符串写入文件

    // [str writeToFile:filePath atomically:YES

    encoding:NSUTF8StringEncoding error:nil];

    }];

    //写入本地 });

    }

    [docPath ];

  • 相关阅读:
    构建调试Linux内核网络代码的环境MenuOS系统
    stm32内存管理
    STM32CubeMx——ADC多通道采集
    STM32CubeMx——串口使用DMA收发数据
    STM32CubeMx——串口收发
    stm32CubeMx+TrueSTUDIO+uc/os-III移植开发(二)
    stm32CubeMx+TrueSTUDIO+uc/os-III移植开发(一)
    STM32F103RCT6移植到STM32F103C8T6注意事项
    关于STM32F103系列从大容量向中容量移植的若干问题
    KEIL软件中编译时出现的Error L6200E: symbol multiply defined ...的解决方法
  • 原文地址:https://www.cnblogs.com/lidongxiao/p/4950000.html
Copyright © 2011-2022 走看看