2 Star 0 Fork 1

无忧开源IOS / SDK_Ali

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

SDK_Ali

项目介绍

[非越狱渠道]阿里SDK+SuperSDK

更新日志

日期 渠道版本 Pods资源版本 备注
2021.05.18 2.4.16 0.0.26 常规更新
2021.05.06 2.4.15 0.0.25 SDK手动传入idfa
2021.04.06 2.4.14 0.0.24 避免跟极光SDK冲突
2021.04.06 2.4.13 0.0.23 修复实名制流程崩溃的问题
2021.04.02 2.4.12.1 0.0.22 拒审更新
2020.11.04 2.4.12 0.0.22 常规更新
2020.05.25 2.4.10 0.0.20 增加支付参数
2020.05.25 2.4.9 0.0.19 增加防刷机制
2020.04.01 2.4.8 0.0.18 渠道SDK下单时增加参数,品牌替换为灵犀
2020.03.19 2.4.7 0.0.17 渠道SDK解决了支付时导致游戏屏幕横竖屏切换错乱的问题
2020.03.13 2.4.6 0.0.16 渠道SDK做了下兼容处理
2020.03.06 2.4.5 0.0.15 渠道SDK常规更新
2019.12.14 2.4.3 0.0.14 添加实名认证,防沉迷功能
2019.05.13 2.4.1 0.0.12 修复苹果PromoCode一个偶现问题
2019.04.11 2.4.0 0.0.11 添加苹果PromoCode
2018.11.06 2.0.2 0.0.9 渠道SDK常规更新
2018.09.15 1.11.0 0.0.8 接入阿里SDK登录和支付

导入

  1. 安装CocoaPods
  2. 在项目根目录,输入pod init命令,创建Podfile
  3. Podfile内容如下:
    # Uncomment the next line to define a global platform for your project
    install! 'cocoapods', :deterministic_uuids => false
    
    source 'https://gitee.com/wyky_ios/Spec.git'
    source 'https://github.com/CocoaPods/Specs.git'
    
    platform :ios, '8.0'
    
    target '你的项目名' do
        #指定SuperSDK资源
        pod 'YCSuperSDK'
    
        #指定阿里SDK资源
        pod 'SDK_Ali'
    end
  4. 输入pod install命令,安装相关依赖
  5. 打开新生成的.xcworkspace,进行后续的开发和调试

Info.plist配置

  1. 添加SuperSDK相关参数的配置SSDKConfig

    <key>SSDKConfig</key>
    <dict>
    	<key>IS_LANDSCAPE</key>
    	<true/>
    	<key>REMOTE_SDKCONFIG_ENABLE</key>
    	<false/>
    	<key>SDKParameters</key>
    	<dict>
    		<key>game_id</key>
    		<string>阿里参数gameId</string>
    		<key>app_key</key>
    		<string>阿里参数appKey</string>
    		<key>callback_url</key>
    		<string>supersdk支付回调地址</string>
    	</dict>
    	<key>SDK_CLASS</key>
    	<string>SSDKAliSDK</string>
    	<key>SDK_INNER_VERSION</key>
    	<string>渠道Pods资源版本</string>
    	<key>SDK_VERSION</key>
    	<string>渠道版本</string>
    	<key>SSDK_CHANNEL_ID</key>
    	<string>IOS0019</string>
    	<key>SSDK_FRAMEWORK_VERSION</key>
    	<string>SuperSDK框架Pods资源版本</string>
    	<key>SURL</key>
    	<string>SuperSDK服务器域名</string>
    </dict>

    如果某些参数不清楚,游戏方可以联系SuperSDK相关人员

  2. 设置允许http访问:添加NSAppTransportSecurity配置

    <key>NSAppTransportSecurity</key>
    <dict>
    	<key>NSAllowsArbitraryLoads</key>
    	<true/>
    </dict>

    avatar

  3. 声明相机及相册功能相关的权限:

    <!-- 相机 --> 
    <key>NSCameraUsageDescription</key> 
    <string>请允许访问相机,用于扫码、拍照功能</string> 
    <key>NSPhotoLibraryUsageDescription</key>
    <string>用于访问相册图片来修改头像、上传截图</string>
  4. 支付密钥文件

    为确保支付数据安全,接入时,请将开放平台下载的密钥文件ali_ugp.dat,添加到项目中, 注意:密钥文件无效将导致支付失败.

工程配置

  1. 在Build Settings -> Header Search Paths中添加$(inherited)
  2. 在Build Settings -> Other Linker Flags中添加$(inherited)-ObjC,并且在Release下设置-Wl,-sectcreate,__RESTRICT,__restrict,/dev/null otherlinkerflag
  3. 在Build Settings -> Enable Bitcode设置成No

支持通过游戏中心拉起

游戏中心拉起登录,需要配置的identifier和URLScheme如下图所示: 授权登录scheme 注: URL Scheme请填写从开放平台获取的appKey

PromoCode兑换

1.简介

PromoCode兑换 是指由 App 运营方在 Apple Connect 管理后台为已审核通过的商品生成兑换码,用户在 App Store中输入该兑换码即可免费获得相应道具,这种方式的内购与在游戏内的购买行为的唯一区别是:没有游戏内 CP 或 SDK 侧的支付下单行为,这导致无法关联订单发货

为了能区分 PromoCode 兑换的订单,需要在 Apple Connect 管理后台创建新的商品,且该商品只能用于 PromoCode 兑换,切勿用于游戏内正常购买

2.接入说明
  1. SDK 接入无需特殊处理,但需保证 游戏上报SuperSDK进入游戏的事件 方法正确触发,SDK 会在此事件(角色进入游戏)发生时,触发 PromoCode 兑换过程(比如弹出兑换确认框,确认PromoCode兑换给此游戏角色)
  2. 在 Apple Connect 管理后台创建新的商品,并由阿里游戏支付中心在后台配置商品为 PromoCode 商品,兑换活动的限制、有效期等
3.测试方法
  1. 确认 PromoCode 商品创建好,且阿里游戏支付中心已配置兑换活动

  2. 端内可通过直接调起苹果支付接口,不走 SDK 下单支付正常流程来模拟 PromoCode 兑换,示例代码

SKPayment *payment = [SKPayment paymentWithProductIdentifier:@"{你的PromoCode商品Id}"];
[[SKPaymentQueue defaultQueue] addPayment:payment];
4.注意事项
  1. PromoCode 商品只能用于 PromoCode 兑换,切勿用于游戏内正常购买
  2. 由于新建的商品,需要经过苹果的审核,因此在审核阶段需要在游戏内可购买该商品,会走正常的支付流程,此时阿里游戏支付中心后台不能将该商品配置为 PromoCode 商品,待审核通过,上架之前,游戏需要将商品从游戏内隐藏,并且阿里游戏支付中心后台需要将该商品配置为 PromoCode 商品

接入SuperSDK框架

参考文档

在系统回调函数,添加SuperSDK代码

参考文档

作者

  • jasontujun
  • maqianzheng
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2018 jasontujun Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

SuperSDK+阿里SDK 展开 收起
Objective-C 等 2 种语言
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Objective-C
1
https://gitee.com/wyky_ios/SDK_Ali.git
git@gitee.com:wyky_ios/SDK_Ali.git
wyky_ios
SDK_Ali
SDK_Ali
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891