Compare commits
No commits in common. "main" and "1.0.2" have entirely different histories.
|
|
@ -4,12 +4,12 @@ import PackageDescription
|
|||
let package = Package(
|
||||
name: "tcmpush",
|
||||
platforms: [
|
||||
.iOS(.v16)
|
||||
.iOS(.v14)
|
||||
],
|
||||
products: [
|
||||
.library(
|
||||
name: "tcmpush",
|
||||
targets: ["tcmpushWrapper"]
|
||||
targets: ["tcmpush"]
|
||||
)
|
||||
],
|
||||
dependencies: [
|
||||
|
|
@ -19,17 +19,18 @@ let package = Package(
|
|||
// 4. 바이너리 타겟 (내부용 이름)
|
||||
.binaryTarget(
|
||||
name: "tcmpush_core",
|
||||
url: "https://git.ipstein.myds.me/api/packages/seonkyu.kim/generic/tcmpush/1.0.8/tcmpush.xcframework.zip",
|
||||
checksum: "1b7d3cc1381d213f13f888015fce49f05ca6547846e8b8ab4e74d2cf9d2e426e"
|
||||
url: "https://git.ipstein.myds.me/api/packages/seonkyu.kim/generic/tcmpush/1.0.0/tcmpush.xcframework.zip",
|
||||
checksum: "097aa3e33ce234fa7146757a8236361f17090bb669a2463b13d311229de2d43d"
|
||||
),
|
||||
|
||||
// 5. 래퍼 타겟 (최종 모듈 이름)
|
||||
.target(
|
||||
name: "tcmpushWrapper",
|
||||
name: "tcmpush",
|
||||
dependencies: [
|
||||
"tcmpush_core",
|
||||
"tcmpush_core", // 여기를 바이너리 타겟 이름으로 수정했습니다.
|
||||
.product(name: "FirebaseMessaging", package: "firebase-ios-sdk")
|
||||
]
|
||||
// path: "Sources/tcmpush" (기본 경로에 폴더를 만드셨다면 생략 가능합니다)
|
||||
)
|
||||
]
|
||||
)
|
||||
)
|
||||
BIN
Sources/.DS_Store
vendored
BIN
Sources/.DS_Store
vendored
Binary file not shown.
0
Sources/tcmpush/Dummy.swift
Normal file
0
Sources/tcmpush/Dummy.swift
Normal file
59
Sources/tcmpush/tcmpush.swift
Normal file
59
Sources/tcmpush/tcmpush.swift
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
import Foundation
|
||||
@_exported import tcmpush
|
||||
Loading…
Reference in New Issue
Block a user