Hỗ trợ làm màn hình thanh toán trên ứng dụng iOS/ iPad OS.

Overview

PayerModule

Hướng dẫn sử dụng module

Swift Package Manager: File -> Swift Package -> Add Package Dependency ...

dependencies: [
    .package(url: "https://github.com/absolutvodka8888/PayerModule.git", .upToNextMajor(from: "0.0.1"))
]

Import Module

import PayerModule

Cài đặt Module trong AppDelegate.swift :

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    Payer.shared.config(listSubscription: ["com.yourcompany.test.premium.weekly",
                                           "com.yourcompany.test.premium.monthly",
                                           "com.yourcompany.test.premium.yearly"],
                        appleSharedSecretKey: "you secret key")
    Payer.shared.completeTransactions { _, _ in}
    return true
}

Tải giá từ server về Vui lòng chạy trên máy thật và add sandbox tester

func getProductsInfo() {
    Payer.shared.getInfoSubscriptions { products in
        products.forEach { skProduct in
            if skProduct.productIdentifier == "com.yourcompany.premium.weekly" {
                let price = skProduct.localizedPrice ?? "Weekly $5.99 per week"
                self.btnWeekly.setTitle(price, for: .normal)
            }
            
            if skProduct.productIdentifier == "com.yourcompany.premium.monthly" {
                let price = skProduct.localizedPrice ?? "Monthly $9.99 per month"
                self.btnMonthly.setTitle(price, for: .normal)
            }
            
            if skProduct.productIdentifier == "com.yourcompany.premium.yearly" {
                let price = skProduct.localizedPrice ?? "Yearly $59.99 per year"
                self.btnYearly.setTitle(price, for: .normal)
            }
        }
    }
}

Thực thi lệnh mua hàng

func purchaseAProduct() {
    Payer.shared.purchase(product: "com.yourcompany.test.premium.weekly") { success, errorMsg in
        if success {
            //TODO: Thực hiện lệnh khi thanh toán thành công
            // ví dụ: ẩn màn hình IAP
        } else {
            //TODO: Hiển thị message lỗi thanh toán
            
        }
    }
}

func restore() {
    Payer.shared.restore { success, errorMsg in
        if success {
            //TODO: Thực hiện lệnh khi thanh toán thành công
            // ví dụ: ẩn màn hình IAP
        } else {
            //TODO: Hiển thị message lỗi thanh toán
        }
    }
}

Hàm hỗ trợ kiểm tra trạng thái IAP

let status = Payer.shared.isPurchased
You might also like...
Learning iOS Frontend: Aplikasi iOS Pemesanan Makanan dengan SwiftUI, WidgetKit, Google Fonts, dan Assets dari Figma
Learning iOS Frontend: Aplikasi iOS Pemesanan Makanan dengan SwiftUI, WidgetKit, Google Fonts, dan Assets dari Figma

Foody Aplikasi Foody adalah Aplikasi iOS Pemesanan Makanan dengan SwiftUI, WidgetKit, Google Fonts, dan Assets dari Figma untuk Mempelajari Ilmu Front

Wasmic allows you to run WebAssembly in a safe way on iOS.
Wasmic allows you to run WebAssembly in a safe way on iOS.

wasmic-ios Bootstrap $ git clone https://github.com/kateinoigakukun/wasmic-ios.git $ git -c submodule."fastlane".update=none submodule update --init -

iOS architectures - MVC, MVP, MVVM, MVVM-C, ReactorKit, VIPER, Clean Architecture
iOS architectures - MVC, MVP, MVVM, MVVM-C, ReactorKit, VIPER, Clean Architecture

iOS architectures - MVC, MVP, MVVM, MVVM-C, ReactorKit, VIPER, Clean Architecture, RIBs; Repository Pattern, Rxflow, Swinject, Tuist, Xcodegen, Cocoapods, SPM, Carthage + Rome

Demo of using Metal to render EDR / HDR content on iOS platform
Demo of using Metal to render EDR / HDR content on iOS platform

MetalEDR-iOS Demo of using Metal to render EDR/HDR content on iOS platform. How it works This demo uses a hack to activate EDR display on iOS platform

ConfettiKit is a custom framework used to add Confetti on your iOS/iPadOS projects.
ConfettiKit is a custom framework used to add Confetti on your iOS/iPadOS projects.

ConfettiKit is a custom framework used to add Confetti on your iOS/iPadOS projects. The kit provides variety of customisations inorder to design a confetti which matches your project's UI. ConfettiKit makes your work of adding Confetti on your project with just one line of code.

🛠 A flexible and easy template created to speed up the development of your iOS application based on the MVP pattern.
🛠 A flexible and easy template created to speed up the development of your iOS application based on the MVP pattern.

Model-View-Presenter template A flexible and easy template created to speed up the development of your iOS application based on the MVP pattern. This

Control Nvidia jetbot which is based on Jetson Nano via iOS app

jetbot-remote-control This is very basic example project which control Nvidia Jetbot remotely via iOS app Based on jetbot of Nvidia, adding sample sou

Turbo-iOS base project that's entirely driven from your backend Rails app.

Turbo-iOS base project that's entirely driven from your backend Rails app.

PlayCover is a project that allows you to sideload iOS apps on macOS( currently arm, Intel support will be tested.

PlayCover is a project that allows you to sideload iOS apps on macOS( currently arm, Intel support will be tested.

Releases(0.0.1)
Owner
I'm Spider man
null
iPad Comic reader based on ComicFLow

Overview Finally a comic reader for iPad done right! ComicFlow was designed with one goal in mind: providing the best experience for comic fans with l

Pablo Clemente Pérez 0 Dec 2, 2021
Spiro - Swift Playgrounds 4 app created on the iPad

Spiro Swift Playgrounds 4 app created on the iPad^. ^ Xcode also used as explain

An Trinh 47 Nov 18, 2022
Kushal Shingote 1 Feb 2, 2022
iOS's Stocks App clone written in React Native for demo purpose (available both iOS and Android).

FinanceReactNative iOS's Stocks App clone written in React Native for demo purpose (available both iOS and Android). Data is pulled from Yahoo Finance

kf 2k Dec 29, 2022
Project 03 I created for "iOS & Swift - The Complete iOS App Development Bootcamp"

Dicee This is the third project I created for "iOS & Swift - The Complete iOS App Development Bootcamp" Our Goal The objective of this tutorial is to

Lukas Goodfellow 0 Dec 23, 2021
IOS-Prework - CodePath intro to iOS prework.

Hello World App Submitted by: Emmanuel Assumang Time spent: 1.5 hours spent in total App Description This is a simple mobile app programmed in Swift t

null 0 Dec 31, 2021
Home Assistant Native iOS Application built with SwiftUI for iOS 15+

Home Assistant - Native iOS SwiftUI Application Screenshots Disclaimer - Please read This application is mostly a not-working mockup written in SwiftU

Alessio Santoru 34 Dec 13, 2022
Google-Blogger-iOS-App - Using Google Blogger API to build an iOS app like Medium

Google Blogger iOS App Using Google Blogger API to build an iOS app like Medium!

Ricky Chuang 9 Dec 13, 2022
Ios jetpack - A codabase for iOS projects foundations

iOSJetpack A codabase for iOS projects foundations Neworking Data Reusable Proto

MonsterTechStudio 1 Jan 24, 2022
A native iOS UI widget for adding Spokestack to any iOS app.

A native iOS library for adding Spokestack to any iOS app. Installation Edit Podfile CocoaPods is a dependency manager for Cocoa projects. For usage a

Spokestack 6 Jun 8, 2021