Compare commits

..

No commits in common. "main" and "1.0.2" have entirely different histories.
main ... 1.0.2

5 changed files with 67 additions and 10 deletions

View File

@ -4,12 +4,12 @@ import PackageDescription
let package = Package( let package = Package(
name: "tcmpush", name: "tcmpush",
platforms: [ platforms: [
.iOS(.v16) .iOS(.v14)
], ],
products: [ products: [
.library( .library(
name: "tcmpush", name: "tcmpush",
targets: ["tcmpushWrapper"] targets: ["tcmpush"]
) )
], ],
dependencies: [ dependencies: [
@ -19,17 +19,18 @@ let package = Package(
// 4. ( ) // 4. ( )
.binaryTarget( .binaryTarget(
name: "tcmpush_core", name: "tcmpush_core",
url: "https://git.ipstein.myds.me/api/packages/seonkyu.kim/generic/tcmpush/1.0.8/tcmpush.xcframework.zip", url: "https://git.ipstein.myds.me/api/packages/seonkyu.kim/generic/tcmpush/1.0.0/tcmpush.xcframework.zip",
checksum: "1b7d3cc1381d213f13f888015fce49f05ca6547846e8b8ab4e74d2cf9d2e426e" checksum: "097aa3e33ce234fa7146757a8236361f17090bb669a2463b13d311229de2d43d"
), ),
// 5. ( ) // 5. ( )
.target( .target(
name: "tcmpushWrapper", name: "tcmpush",
dependencies: [ dependencies: [
"tcmpush_core", "tcmpush_core", // .
.product(name: "FirebaseMessaging", package: "firebase-ios-sdk") .product(name: "FirebaseMessaging", package: "firebase-ios-sdk")
] ]
// path: "Sources/tcmpush" ( )
) )
] ]
) )

BIN
Sources/.DS_Store vendored

Binary file not shown.

View File

View File

@ -0,0 +1,59 @@
//
// tcmpush.swift
// tcmpush
//
// Created by TA9 on 11/26/25.
//
import UIKit
import FirebaseCore
import FirebaseMessaging
public class TCMPush: NSObject {
public static let shared: TCMPush = {
let inistance = TCMPush()
return inistance
}()
private override init() {}
public var isDebugMode: Bool = false
public func printLog<T>(_ object: T,_ function: String = #function, _ line: Int = #line){
if isDebugMode {
Swift.print("""
_____ _____ _____ _____ _____ _____ _____ _____ _____ _____
| NAME = [\(function)] || LINE = [\(line)]
|>>> PRINT = \(object)
""")
}
}
public func configure() {
if FirebaseApp.app() == nil {
FirebaseApp.configure()
printLog("[TCMPush] FirebaseApp configured")
}
}
public func setAPNSToken(_ deviceId: Data){
Messaging.messaging().apnsToken = deviceId
printLog("[TCMPush] set APNS Token: \(deviceId)")
}
public func getFCMToken(completion: @escaping (String?, Error?) -> Void) {
Messaging.messaging().token { [weak self] token, error in
guard let self = self else { return }
if let error = error {
self.printLog("[TCMPush] 토큰 가져오기 실패: \(error.localizedDescription)")
completion(nil, error)
} else if let token = token {
self.printLog("[TCMPush] 토큰 획득 성공: \(token)")
completion(token, nil)
}
}
}
}

View File

@ -1,3 +0,0 @@
import Foundation
@_exported import tcmpush