Latest 0.1.0
Homepage https://github.com/o0starshine0o/iOS-ArtSignProDemo
License MIT
Platforms ios 8.0
Dependencies Alamofire, Kingfisher, EZSwiftExtensions, SwiftyJSON, CryptoSwift, SwiftSpinner, Toast-Swift, M13Checkbox, IQKeyboardManager, AutoLayoutTextViews
Authors

ArtSignProDemo:The demo for ArtSignProSdk

Fill your app with expert sign and share the order amount.


Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate ArtSignProSdk into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
pod 'ArtSignProSdk'
end

Then, run the following command:

$ pod install

Usage

Prepare

1.Get Key And Secret

  • for test environment , please click Here
  • for production environment , please click Here

Our business platform use different account in test and production environment. So , you have to register in test and production

2.Submit Business-Name, App-Identify and App-Version

In our business platform , fill your business name , app identify and app version .

Xcode

1. info.plist > Add Schemes

<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string></string>
<key>CFBundleURLSchemes</key>
<array>
<string>your app name</string>
</array>
</dict>
</array>

please replace your app name with Your App Name

2. info.plist > Add Queries Schemes

<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
<string>wechat</string>
<string>alipay</string>
<string>alipays<string>
<string>mqq<string>
</array>

3. info.plist > Enable http

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

4.AppDelegate.swift > Import ArtSignProSdk , define variable

import ArtSignProSdk

class AppDelegate: UIResponder, UIApplicationDelegate  {

var artSignPro:ArtSignPro?

···
}

5.AppDelegate.swift > Init SDK and set environment

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
artSignPro = ArtSignPro.init(key: "key_XXX", secret: "secret_XXX", scheme: "ArtSignProSdkDemo")
artSignPro?.setEnvironment(environment: .Test)

···
return true
}
  1. the key and secret in Prepare
  2. the scheme is your app name , when complete perchase , return to your app
  3. the key and secret will be different in Test and Production environment
  4. in Test environment the perchase is free
  5. in Production environment the perchase will be REAL

6.AppDelegate.swift > Handle url

public func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool{
return (artSignPro?.handleOpen(url: url))!
}

public func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
return (artSignPro?.handleOpen(url: url))!
}

7.ViewController.swift > Can we show?

import ArtSignProSdk

import ArtSignProSdk

override func viewDidLoad() {
super.viewDidLoad()
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.artSignPro?.isShowSdk(delegate: self)

···
}

implement ArtSignProSdkDelegate

class ViewController: UIViewController, ArtSignProSdkDelegate {
var isShowSdk:Bool = false
func isShowSdk(show:Bool){
isShowSdk = show
}

···
}

when some event happend eg:click,to show expert sign list or not

@IBAction func onClick(_ sender: UIButton) {
if isShowSdk {
performSegue(withIdentifier: "ShowExpertSignList", sender: self)
}else{
print("set pay method for this production before show expert sign list")
}
}

8.ViewController.swift > Show ViewController

please show ExpertSignListViewController with

StoryBoard     >> ArtSignPro
Referenced ID  >> ExpertSignListViewController
Bundle         >> org.cocoapods.ArtSignProSdk

Latest podspec

{
    "name": "ArtSignProSdk",
    "version": "0.1.0",
    "platforms": {
        "ios": "8.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "homepage": "https://github.com/o0starshine0o/iOS-ArtSignProDemo",
    "authors": {
        "AbelHu": "[email protected]"
    },
    "summary": "The core function of ArtSignPro",
    "description": "The core function of ArtSignPro.With this sdk,you can offer expert sign to your users,at the same time you will share the amount of the charge",
    "dependencies": {
        "Alamofire": [],
        "Kingfisher": [],
        "EZSwiftExtensions": [],
        "SwiftyJSON": [],
        "CryptoSwift": [],
        "SwiftSpinner": [],
        "Toast-Swift": [],
        "M13Checkbox": [],
        "IQKeyboardManager": [],
        "AutoLayoutTextViews": []
    },
    "source": {
        "git": "https://github.com/o0starshine0o/iOS-ArtSignPro_Sdk.git",
        "tag": "v0.1.0"
    },
    "default_subspecs": [
        "Core",
        "Pay",
        "Alipay",
        "WeChat"
    ],
    "pushed_with_swift_version": "3.0",
    "subspecs": [
        {
            "name": "Core",
            "source_files": [
                "Source/**/*.swift",
                "Headers/*.h"
            ],
            "resources": "Resources/**/*.*",
            "private_header_files": "Headers/*.h",
            "dependencies": {
                "ArtSignProSdk/Pay": []
            }
        },
        {
            "name": "Pay",
            "source_files": [
                "lib/*.h",
                "lib/Dependencies/Network/*.h"
            ],
            "public_header_files": [
                "lib/*.h",
                "lib/Dependencies/Network/*.h"
            ],
            "vendored_libraries": [
                "lib/*.a",
                "lib/Dependencies/Network/*.a"
            ],
            "resources": "lib/*.bundle",
            "frameworks": [
                "CFNetwork",
                "SystemConfiguration",
                "Security"
            ],
            "ios": {
                "libraries": [
                    "c++",
                    "stdc++",
                    "z"
                ]
            },
            "xcconfig": {
                "OTHER_LDFLAGS": "-ObjC"
            }
        },
        {
            "name": "Alipay",
            "vendored_libraries": "lib/Channels/Alipay/*.a",
            "ios": {
                "vendored_frameworks": "lib/Channels/Alipay/AlipaySDK.framework"
            },
            "resources": "lib/Channels/Alipay/AlipaySDK.bundle",
            "frameworks": [
                "CoreMotion",
                "CoreTelephony"
            ],
            "dependencies": {
                "ArtSignProSdk/Pay": []
            }
        },
        {
            "name": "WeChat",
            "dependencies": {
                "ArtSignProSdk/Pay": []
            }
        }
    ]
}

Pin It on Pinterest

Share This