WWAppFirstInstall

Swift-5.6 iOS-14.0 TAG Swift Package Manager-SUCCESS LICENSE

Introduction - 簡介

WWKeychain

Installation with Swift Package Manager

dependencies: [
    .package(url: "https://github.com/William-Weng/WWAppFirstInstall.git", .upToNextMajor(from: "1.0.1"))
]

Function - 可用函式

函式 功能
insert(appId:) 加入AppId到纪录之中
detect(appId:) 检测该AppId是否安装过?
reset(appId:) 将安装过的记录删除
installTime(appId:) 获取安装时间 (秒)
dictionary() 获取安装过的全记录 => [《AppId》:《安装时间》]
clean() 全记录清除

Example

import UIKit
import WWPrint
import WWAppFirstInstall

final class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        demo()
    }
}

private extension ViewController {
    
    func demo() {
        
        WWAppFirstInstall.shared.clean()
        
        let appIdArray = [
            "idv.william.Example1",
            "idv.william.Example2",
            "idv.william.Example3",
        ]
        
        wwPrint("DICT => \(WWAppFirstInstall.shared.dictionary())")

        appIdArray.forEach { appId in
            _ = WWAppFirstInstall.shared.insert(appId: appId)
            wwPrint("DICT => \(WWAppFirstInstall.shared.dictionary()!)")
        }
        
        appIdArray.forEach { appId in
            wwPrint(WWAppFirstInstall.shared.installTime(appId: appId))
        }
        
        _ = WWAppFirstInstall.shared.reset(appId: appIdArray[1])
        wwPrint("DICT => \(WWAppFirstInstall.shared.dictionary()!)")
    }
}