Giter Club home page Giter Club logo

youzanmobilesdk-ios's Introduction

License Platform Pod Version

有赞logo

简介

为了满足移动应用搭建商城的需求,有赞云将有赞积累多年的电商交易系统开放,移动开发者通过一个 SDK 便可以在 App 内集成有赞提供的整个交易服务,除了享受完善的商城功能、丰富的营销玩法,更有有赞强劲的技术及服务作保障,实现低成本、高效率、强融合的移动电商方案,快速获得 App 流量的商业化变现。

有赞 AppSDK 基于 WebView 将有赞提供的 HTML5 页面嵌入到 App 中,基于此提供帐号打通、资产合并、客服 IM、多渠道支付、营销能力开放等 App 应用特色功能,更拥有媲美原生页面的性能。该方案由于接入极速、功能完善、性能稳定,现已被大多数电商 App 开发者采用。

对接过程中有任何问题、需求、建议,或是想了解 AppSDK 更多玩法,欢迎联系有赞青溪,youzan_qingxi(微信)。

安装

通过 CocoaPods 安装

  1. 在你的 Podfile 文件中添加 pod 'YZAppSDK'
  2. 在命令行中运行 pod installpod update.

手动导入

  1. 下载最新的 Release 版本
  2. YZBaseSDK 文件夹中的内容添加到你的 Xcode 工程中。

Demo 注意事项

  • 使用 demo 前,需要先运行 pod install
  • 填写 YZDemoConfig.h 中的 CLIENT_ID 和 CLIENT_SECRET 来使用 Demo.

文档

https://github.com/youzan/YouzanMobileSDK-iOS/wiki

License

MIT

youzanmobilesdk-ios's People

Contributors

enternalrain avatar mrpans avatar or0fun avatar sanyang01 avatar vajrasheng avatar yangqian111 avatar youzanaling avatar yuzeyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

youzanmobilesdk-ios's Issues

后台配置iOS的安全码了,还是报❌❌❌ App开店SDK ======> clientID 未通过校验,请更新后重试!!!

从7.0.0开始,SDK添加安全码校验功能,未通过校验的App将无法正常打开WebView进行页面渲染,且控制台会有如下报错日志打印:

❌❌❌ App开店SDK ======> clientID 未通过校验,请更新后重试!!!
解决方案

开发者需要前往有赞云开发者控制台新增App安全码配置,然后在初始化YZConfig配置类初始化时传入clientId及appKey,初始化方法调整如下:

加载商城首页速度太慢

SDK 7.1.7

NSURL *url = [NSURL URLWithString:@"https://h5.youzan.com/xxxx"];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:urlRequest];

有赞加载网页速度太慢,有什么api或者其他方法来对加载网页提速嘛?

使用pod安装的,模拟器一直崩溃dyld: Library not loaded: @rpath/YZSDKCore.framework/YZSDKCore

在模拟器上跑不起来,一直报错
dyld: Library not loaded: @rpath/YZSDKCore.framework/YZSDKCore
Referenced from: /Users/chao/Library/Developer/CoreSimulator/Devices/D5B5FFDD-F60A-4454-A30A-A5ECEBCA8ADF/data/Containers/Bundle/Application/2FCA84C5-FC80-4B50-A519-374BB2D517CE/CLMicroWork.app/Frameworks/YZBaseSDK.framework/YZBaseSDK
Reason: no suitable image found. Did find:
/Users/chao/Library/Developer/CoreSimulator/Devices/D5B5FFDD-F60A-4454-A30A-A5ECEBCA8ADF/data/Containers/Bundle/Application/2FCA84C5-FC80-4B50-A519-374BB2D517CE/CLMicroWork.app/Frameworks/YZSDKCore.framework/YZSDKCore: no matching architecture in universal wrapper
/Users/chao/Library/Developer/CoreSimulator/Devices/D5B5FFDD-F60A-4454-A30A-A5ECEBCA8ADF/data/Containers/Bundle/Application/2FCA84C5-FC80-4B50-A519-374BB2D517CE/CLMicroWork.app/Frameworks/YZSDKCore.framework/YZSDKCore: no matching architecture in universal wrapper
/Users/chao/Library/Developer/CoreSimulator/Devices/D5B5FFDD-F60A-4454-A30A-A5ECEBCA8ADF/data/Containers/Bundle/Application/2FCA84C5-FC80-4B50-A519-374BB2D517CE/CLMicroWork.app/Frameworks/YZSDKCore.framework/YZSDKCore: no matching architecture in universal wrapper
/Users/chao/Library/Developer/CoreSimulator/Devices/D5B5FFDD-F60A-4454-A30A-A5ECEBCA8ADF/data/Containers/Bundle/Application/2FCA84C5-FC80-4B50-A519-374BB2D517CE/CLMicroWork.app/Frameworks/YZSDKCore.framework/YZSDKCore: no matching architecture in universal wrapper
(lldb)

Type 'YZWebViewType' has no member 'uiWebView

master 分支代码拉取下来之后。

执行pod install 和pod update

编译不通过。

Type 'YZWebViewType' has no member 'uiWebView'
Value of type '(YZWebViewProtocol, YZNotice) -> ()' has no member 'frame'
Value of type '(YZWebViewProtocol, YZNotice) -> ()' has no member 'delegate'
Value of type '(YZWebViewProtocol, YZNotice) -> ()' has no member 'noticeDelegate'
Value of type '(YZWebViewProtocol, YZNotice) -> ()' has no member 'noticeDelegate'
Value of type '(YZWebViewProtocol, YZNotice) -> ()' has no member 'noticeDelegate'

请教一下,如何解决? @winglechen

从微信回到自己App,如何判断是否支付成功?

我是已经购买App开店,然后接的是原生App开发,因为支付页面必须是 h5 页面,进入h5支付页面,然后跳转微信支付,回来后怎么知道是否支付成功呢?或者说我跳转到微信支付后,用户并没有支付,然后手动调回App,那App怎么判断用户是否支付呢?

6.4.3 release版本有bug

当我用新版sdk时,YZWebView初始化为WKWebView,那么给YZSDK传递登录态token后,还是会给我发送需要登录的通知,每次都是这样,但是当YZWebView初始化为UIWebView时,传递登录态token后就正常了,希望开发人员能够找一下这个原因。

1

1

使用 SDK v7.0.3 初始化 YZWebView 失败

SDK v7.0.3,CocoaPods 方式接入,填入了 appKey,初始化后,尝试初始化 YZWebView 遇到下面情况

1605701599422

如图,初始化后,得到的是空的对象,请问如何解决?

6.4.9 release版本有bug

使用6.4.9版本的SDK,并且webView初始化为WKWebView,进入商品详情页,再随便打开一个新页面,调用goBack返回上一个网页时,会报错,-999的错误,如果webView初始化为UIWebView,那么就不会有这个问题。

集成有赞时候未收到登录的通知

YZWebViewNoticeDelegate中我实现了- (void)webView:(YZWebView *)webView didReceiveNotice:(YZNotice *)notice方法 但是就是没有收到YZNoticeTypeLogin登录请求,麻烦解决下

[__NSCFString hasPrefix:]: nil argument Raw Text

Fatal Exception: NSInvalidArgumentException-[__NSCFString hasPrefix:]: nil argument Raw Text

0 | CoreFoundation | __exceptionPreprocess
3 | CoreFoundation | -[__NSCFString hasPrefix:]
4 | ting | YZSMCacheManager.m line 357__38-[YZSMCacheManager writeCache:toPath:]_block_invoke
5 | libdispatch.dylib | _dispatch_call_block_and_release
12 | libsystem_pthread.dylib | start_wqthread

无法调起【支付宝】【微信】支付

按照你们 FAQ 里说的:

2.iOS点击去支付无法跳转到对应客户端(微信、支付宝)
首先确认用户设备是否安装相应客户端,其次确认 shouldStartLoadWithRequest 里是否拦截微信/支付宝的scheme,最后确认工程是否加了微信/支付宝scheme白名单。

我自己尝试在我的 App 里打开支付宝是可以的:
UIApplication.shared.open(URL(string: "alipay://")!, options: [:], completionHandler: nil)

但是通过有赞就是不行。

IMG_2714

demo里的登陆拦截 不走代理

demo点击完整后登录,进入自己页面,然后购买商品,不出发登录请求,无法吊起原生登录,
CLIENT_ID 跟CLIENT_SECRET 都填了,不知道什么原因,是最新版本的sdk

switch (notice.type) {
case YZNoticeTypeLogin: // 收到登陆请求
{
[self showLoginViewControllerIfNeeded];
break;}

下载demo, 配置完成后还是需要二次登陆

登陆的时候先调用了
https://account.youzan.com/api/login/native/open/login-or-register.json
然后再调用sdk的函数

 [YZSDK.shared loginWithOpenUserId:info[@"data"][@"yz_open_id"] avatar:@"" extra:@"" nickName:@"" gender:2 andCompletion:^(BOOL isSuccess, NSString * _Nullable yzOpenId) {

            if (!isSuccess) {
                NSLog(@"loginWithOpenUserId 失败");
                return;
            }
            dispatch_async(dispatch_get_main_queue(), ^{
                [self dismissViewControllerAnimated:YES completion:^{
                    [self callBlockWithResult:YES];
                }];
            });
        

 }];

返回商品页面后, 还是
image

我已经按照https://doc.youzanyun.com/resource/faq/27034/28995/34009
文档中的检查步骤,检查过了

不知道我还可以从哪个步骤去检查呢?

如果需要我demo的话,加我的QQ:332439409 我发给你

请问如何将认证信息同步给 SDK?

ios SDK 7.1.2版本中, 找不到该方法 pod 'YZAppSDK', '~> 7.1.2'
-(void)synchronizeCookieKey:(NSString *)cookieKey cookieValue:(NSString *)cookieValue;
demo中也找不到, 报错;
请问如何将认证信息同步给 SDK?
image

能否兼容JSContext

目前app项目中使用JSContext实现与h5联动,如果换成YZWebView的话,不知是否兼容JSContext?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.