LSWNovel 1.0.9

LSWNovel 1.0.9

“yipainbingxin”维护。



 
依赖项
AFNetworking>= 0
UIImage+Additions>= 0
Masonry>= 0
IQKeyboardManager>= 0
MJRefresh>= 0
FSTextView>= 0
SVProgressHUD>= 0
MJExtension>= 0
DZNEmptyDataSet>= 0
dsBridge>= 0
Reachability>= 0
SDCycleScrollView>= 0
ReactiveObjC>= 0
Colours>= 0
 

LSWNovel 1.0.9

  • 作者:
  • yipainbingxin

乐书屋小说SDK对接文档

快速开始

一、获取AppId和AppSecret

暂不支持后台获取,请联系商务获取您的appid和appsecret

二、环境配置

1、打开项目xcode,找到项目的plist文件,在Info.plist中添加NSAppTransportSecurity类型Dictionary。

2、在NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES

3、在info.plist的第三方支付下添加URL Schemes白名单

<key>LSApplicationQueriesSchemes</key>
<array>
   <!-- 微信 URL Scheme 白名单-->
   <string>wechat</string>
   <string>weixin</string>

   <!-- 支付宝  URL Scheme 白名单-->
   <string>alipay</string>
   <string>alipayshare</string>
</array>
如图所示:

Image text

4、添加URL types用于APP返回,identifier名字随意例如weixinpay URL Schemes

www.ysgtg.com

如图所示:

Image text

三、cocoapods集成

代码

pod 'LSWNovel'

依赖库:安装LSWNovel时会自动安装集成,无需手动安装


  pod 'AFNetworking', '~> 3.2.1'
  pod 'UIImage+Additions', '~> 2.1.4'
  pod 'Masonry', '~> 1.1.0'
  pod 'IQKeyboardManager', '6.4.2'
  pod 'MJRefresh', '~> 3.2.0'
  pod 'FSTextView', '~> 1.8'
  pod 'SVProgressHUD', '~> 2.2.5'
  pod 'MJExtension'
  pod 'DZNEmptyDataSet'
  pod 'Reachability', '~> 3.2'
  pod 'SDCycleScrollView', '~> 1.80'
  pod 'ReactiveObjC'
  pod 'Colours', '~> 5.13.0'
  pod 'dsBridge', '~> 3.0.6'
  

四、代码集成

  1. 导入头文件
#import <LSWNovel/LSWClient.h>

  1. APPdelegate中初始化SDK
/**
初始化乐书屋小说组件
@param appid 开发者联系商务获取您的appid
@param appSecret 开发者联系商务获取您的appSecret
*/
+ (void)initWithAppid:(NSString *)appid withAppSecret:(NSString *)appSecret;

3.APPdelegate中代理方法openURL中传URL用于处理支付结果

/**
处理收到的 URL 消息
@param url url
*/
+ (void)handleOpenUrl:(NSURL *)url;
  1. 推送显示小说界面
   /**
push出乐书屋小说
@param homeClass 当前的导航控制前
*/
+ (void)presetHomeVC:(UINavigationController*) homeClass;

5.阅读奖励设置指南 请联系商务开通阅读激励。

/**
设置用户标识
@param user_code 用户ID
*/
+ (void)initUsercode:(NSString*)user_code;

回调接口 GET http://xxx.xx?user_code=1&award_amount=100

参数 描述
url 回调奖励金地址(后台填写)
user_code 用户唯一标识
award_amount 奖励金额(后台填写)
返回成功结果示例: 
{
    "code":200,
    "msg":"成功",
    "err":""
}
返回失败结果示例:
{
    "code":-1,
    "msg":"失败",
    "err":"用户标识不存在"
}

注意返回结果请按给定格式返回,否则用户无法收到奖励