当前位置: 首页 > news >正文

asp网站源代码vs做网站通过e浏览器

asp网站源代码,vs做网站通过e浏览器,网站开发资费,受欢迎的锦州网站建设简单的第三方登录和分享功能 第三方登录系统 URL Scheme:App间的跳转及通信 App间跳转场景 登陆系统: 跨平台,跨App 标记用户,个性化的推送 使用第三方登录(减少注册成本 / 无须维护敏感信息) 微信 / Q…

简单的第三方登录和分享功能

第三方登录系统

·URL Scheme:App间的跳转及通信

·App间跳转场景

·登陆系统:

        ·跨平台,跨App

        ·标记用户,个性化的推送

        ·使用第三方登录(减少注册成本 / 无须维护敏感信息)

        ·微信 / QQ / 微博 / facebook / Twitter

·登录系统通用技术

        ·framework的使用和集成

        ·常用的第三方认证和账户体系

        ·业务逻辑的设计和实现

静态库 & 动态库

        ·库Library

                ·代码共享 / 保护核心代码

                ·提高编译速度 / 减少代码提及(系统)

        ·静态库

                ·.a文件

                ·编译时期拷贝

                ·增大代码提及 / 不可改变

        ·动态库

                ·.dylib

                ·编译时期只存储引用,运行时加载到内存

                ·无须拷贝减少体积 / 性能损失 / 安全性

 IOS中静态库的创建和使用

·Framework

        ·资源的打包方式

        ·支持静态库 / 动态库

        ·系统的Framework都是动态库

        ·支持Extension共享 - Embedded framework

静态库的制作:

        ·创建static Library实现业务逻辑

        ·设置需要暴露的头文件

        ·模拟器 / 设备分别编译 / 设置Settings

        ·合并静态库lipo - create ***.a ***.a -output ***.a

·静态库(.a)本身是二进制文件

·需要手动引入头文件使用

·一般需要设置Other Linker Flags等

IOS中Framework的制作和使用

·创建framework实现业务逻辑

·设置public的头文件

·模拟器 / 设备 / 分别编译 / 设置Settings

·合并framework

·引入framework 即包含头文件

·头文件的引入

·一般需要设置Other Linker Flags等

OAuth & OpenID 

OAuth授权

        ·第三方登录使用用户名 / 密码(安全 / 用户成本)

        ·开放协议,标准的方式去访问需要用户授权的API服务

OpenID

        ·明文的安全性 / 不同的业务,无法隔离

        ·隐藏明文 / 每个App独立的openID

集成QQ SDK实现登录和分享功能

首先下载TencentOpenApi,在podfile中添加:

# pod TencentOpenAPI
pod 'TencentOpenAPI', :git => 'https://github.com/everfire130/TencentOpenAPI.git'

或者在腾讯开放平台中下载SDK:SDK下载 — QQ互联WIKI 

//
//  GSCLogin.h
//  GSCApp1
//
//  Created by gsc on 2024/6/22.
//#import <Foundation/Foundation.h>NS_ASSUME_NONNULL_BEGINtypedef void(^GSCLoginFinishBlock)(BOOL isLogin);@interface GSCLogin : NSObject@property(nonatomic,strong,readonly)NSString *nick;
@property(nonatomic,strong,readonly)NSString *address;
@property(nonatomic,strong,readonly)NSString *avatarUrl;+(instancetype)sharedLogin;#pragma - mark - 登录-(BOOL)isLogin;
-(void)loginWithFinishBlock:(GSCLoginFinishBlock)finishBlock;
-(void)logOut;#pragma - mark - 分享
-(void)shareToQQWithArticleUrl:(NSURL *)articleUrl;//
//  GSCLogin.m
//  GSCApp1
//
//  Created by gsc on 2024/6/22.
//#import "GSCLogin.h"
#import "TencentOpenAPI/QQApiInterface.h"
#import "TencentOpenAPI/TencentOAuth.h"@interface GSCLogin () <TencentSessionDelegate>@property (nonatomic, strong, readwrite) TencentOAuth *oauth;
@property (nonatomic, copy, readwrite) GSCLoginFinishBlock finishBlock;
@property (nonatomic, assign, readwrite) BOOL isLogin;@end@implementation GSCLogin+(instancetype)sharedLogin{static GSCLogin *login;static dispatch_once_t onceToken;dispatch_once(&onceToken, ^{login = [[GSCLogin alloc] init];});return login;
}-(instancetype)init{self = [super init];if(self){_isLogin = NO;_oauth = [[TencentOAuth alloc] initWithAppId:@"123456" andDelegate:self];}return self;
}
#pragma - mark - 登录-(BOOL)isLogin{return _isLogin;
}
-(void)loginWithFinishBlock:(GSCLoginFinishBlock)finishBlock{_finishBlock = [finishBlock copy];_oauth.authMode = kAuthModeClientSideToken;[_oauth authorize:@[kOPEN_PERMISSION_GET_USER_INFO,kOPEN_PERMISSION_GET_SIMPLE_USER_INFO,kOPEN_PERMISSION_ADD_ALBUM,kOPEN_PERMISSION_ADD_TOPIC,kOPEN_PERMISSION_CHECK_PAGE_FANS,kOPEN_PERMISSION_GET_INFO,kOPEN_PERMISSION_GET_OTHER_INFO,kOPEN_PERMISSION_LIST_ALBUM,kOPEN_PERMISSION_UPLOAD_PIC,kOPEN_PERMISSION_GET_VIP_INFO,kOPEN_PERMISSION_GET_VIP_RICH_INFO]];}
-(void)logOut{[_oauth logout:self];_isLogin = NO;
}#pragma mark - delegate-(void)tencentDidLogin{_isLogin = YES;[_oauth getUserInfo];
}-(void)tencentDidNotLogin:(BOOL)cancelled{if(_finishBlock){_finishBlock(NO);}
}-(void)tencentDidNotNetWork{}-(void)tencentDidLogout{}-(void)getUserInfoResponse:(APIResponse *)response{NSDictionary *userInfo = response.jsonResponse;_nick = userInfo[@"nickname"];_address = userInfo[@"city"];_avatarUrl = userInfo[@"figureurl_qq_2"];if(_finishBlock){_finishBlock(YES);}
}
#pragma - mark - 分享
-(void)shareToQQWithArticleUrl:(NSURL *)articleUrl{QQApiNewsObject *newsObj = [QQApiNewsObject objectWithURL:articleUrl title:@"ios" description:@"iosDevLearn" previewImageURL:nil];SendMessageToQQReq *req = [SendMessageToQQReq reqWithContent:newsObj];__unused QQApiSendResultCode sent = [QQApiInterface SendReqToQZone:req];
}@end@endNS_ASSUME_NONNULL_END
//
//  GSCMineViewController.m
//  GSCApp1
//
//  Created by gsc on 2024/6/22.
//#import "GSCMineViewController.h"
#import "GSCLogin.h"
#import "SDWebImage/SDWebImage.h"@interface GSCMineViewController ()<UITableViewDelegate, UITableViewDataSource>@property (nonatomic, strong, readwrite) UITableView *tableView;
@property (nonatomic, strong, readwrite) UIView *tableViewHeaderView;
@property (nonatomic, strong, readwrite) UIImageView *headerImageView;@end@implementation GSCMineViewController-(instancetype)init{self = [super init];if(self){self.tabBarItem.title = @"我的";self.tabBarItem.image = [UIImage imageNamed:@"icon.bundle/home@2x.png"];self.tabBarItem.selectedImage = [UIImage imageNamed:@"icon.bundle/home_selected@2x.png"];}return self;
}- (void)viewDidLoad {[super viewDidLoad];self.view.backgroundColor = [UIColor whiteColor];[self.view addSubview:({_tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];_tableView.delegate = self;_tableView.dataSource = self;_tableView;})];
}#pragma mark - Navigation-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{return 2;
}-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"mineTableViewCell"];if(!cell){cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"mineTableView"];}return cell;
}-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{return 60;
}-(nullable UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{if(!_tableViewHeaderView){_tableViewHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 30, self.view.frame.size.width, self.view.frame.size.height)];_tableViewHeaderView.backgroundColor = [UIColor whiteColor];[_tableViewHeaderView addSubview:({_headerImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 30, self.view.frame.size.width, self.view.frame.size.height)];_headerImageView.backgroundColor = [UIColor whiteColor];_headerImageView.contentMode = UIViewContentModeScaleAspectFit;_headerImageView.clipsToBounds = YES;_headerImageView.userInteractionEnabled = YES;_headerImageView;})];[_tableViewHeaderView addGestureRecognizer:({UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_tapImage)];tapGesture;})];}return _tableViewHeaderView;
}-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{return 200;
}-(void)tableView:(UITableView *)tableView willDisplayHeaderView:(nonnull UIView *)view forSection:(NSInteger)section{if(![[GSCLogin sharedLogin] isLogin]){[_headerImageView setImage:[UIImage imageNamed:@"icon.bundle/prettydog.png"]];}else{[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:[GSCLogin sharedLogin].avatarUrl]];}
}-(void)tableView:(UITableView *)tableView willDisplayCell:(nonnull UITableViewCell *)cell forRowAtIndexPath:(nonnull NSIndexPath *)indexPath{if(indexPath.row == 0){cell.textLabel.text = [[GSCLogin sharedLogin] isLogin] ? [GSCLogin sharedLogin].nick: @"昵称";}else{cell.textLabel.text = [[GSCLogin sharedLogin] isLogin] ? [GSCLogin sharedLogin].address:@"地区";}}#pragma mark --(void)_tapImage{__weak typeof(self) weakSelf = self;if(![[GSCLogin sharedLogin] isLogin]){// 如果未登录则拉起登录[[GSCLogin sharedLogin] loginWithFinishBlock:^(BOOL isLogin){__strong typeof(self) strongSelf = self;if(isLogin){[strongSelf.tableView reloadData];}}];}else{// 已登录则退出登录[[GSCLogin sharedLogin] logOut];[self.tableView reloadData];}
}@end

集成SDK实现登录与分享:

        ·申请接入,获取appid和apikey

        ·集成SDK设置对应的settings及URL Scheme

        ·业务逻辑的基础UI和交互(登录 / 分享 ...)

        ·通过用户登录验证和授权,获取Access Token

        ·通过Access Token获取用户的OpenID

        ·通过OpenAPI请求访问或修改用户授权的资源

        ·客户端保存相应用户信息,按需展示

        ·调用其它API实现分享等逻辑

http://www.yayakq.cn/news/120578/

相关文章:

  • 长沙企业网站建设优度个人备案用作资讯网站
  • 企业网站建站费用金蝶软件收费价目表
  • 石铜路网站建设自助建网站代理
  • 公司宣传网站dede网站安全设置
  • 常州网站建设网站无极兼职网
  • c#网站开发 pdf个人可以做几个网站吗
  • 杭州网站制作培训大一学生做的网站
  • 制作网站的完整步骤网站如何盈利
  • 怎么做自助提卡网站网络搭建与维护
  • 使用top域名做网站手机版网站如何建设
  • iis部署网站项目学校门户网站的网站建设方案
  • 湘潭县建设投资有限公司网站萧山区建设局网站
  • 厂家网站怎么做做外贸找工厂货源网站
  • 免抵退税在哪个网站做山东省建设厅官方网站怎么样
  • 商业网站设计方案模板炒股软件排名
  • 哪做网站比较好建设银行网站app
  • 浙江省网站备案注销申请表短网址在线生成短网址
  • 网站seo网络优化公司银川做网站哪家好
  • 成都高端网站建设公司中国临沂网站优化
  • 回老家做PHP网站个人网站主机的配置
  • 网站开发和企业级开发有什么区别wordpress vip会员主题
  • 四川做网站公司网站建设报价ppt模版
  • 招商局网站建设方案做外贸有哪些免费的网站有哪些
  • 宝安西乡做网站.net做网站安全吗
  • 36岁了初中毕业想提升学历北京seo技术交流
  • 网站建设企业所得税提供邯郸做移动网站
  • 网站建设方案评审中国上海官网
  • 清远企业网站排名班主任工作总结
  • 广东省建设厅网站怎么查询证件wordpress js加载慢
  • 做网站服务器配置应该怎么选dw网页代码