Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7bc009bef | ||
|
|
fd9fd3127a | ||
|
|
39e3755bd4 | ||
|
|
6268b559ae | ||
|
|
80702c0c3f | ||
|
|
a0b21401ad | ||
|
|
c7430c3f58 | ||
|
|
aa6f120dfd | ||
|
|
e52fa0aa20 | ||
|
|
56582f19d6 | ||
|
|
d2a9d9e463 | ||
|
|
83bbb3b9e9 | ||
|
|
12ba9f3faa | ||
|
|
5c8bb517cb |
|
|
@ -4,12 +4,12 @@ import PackageDescription
|
||||||
let package = Package(
|
let package = Package(
|
||||||
name: "tcmpush",
|
name: "tcmpush",
|
||||||
platforms: [
|
platforms: [
|
||||||
.iOS(.v14)
|
.iOS(.v16)
|
||||||
],
|
],
|
||||||
products: [
|
products: [
|
||||||
.library(
|
.library(
|
||||||
name: "tcmpush",
|
name: "tcmpush",
|
||||||
targets: ["tcmpush"]
|
targets: ["tcmpushWrapper"]
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
|
|
@ -19,18 +19,17 @@ 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.0/tcmpush.xcframework.zip",
|
url: "https://git.ipstein.myds.me/api/packages/seonkyu.kim/generic/tcmpush/1.0.8/tcmpush.xcframework.zip",
|
||||||
checksum: "097aa3e33ce234fa7146757a8236361f17090bb669a2463b13d311229de2d43d"
|
checksum: "1b7d3cc1381d213f13f888015fce49f05ca6547846e8b8ab4e74d2cf9d2e426e"
|
||||||
),
|
),
|
||||||
|
|
||||||
// 5. 래퍼 타겟 (최종 모듈 이름)
|
// 5. 래퍼 타겟 (최종 모듈 이름)
|
||||||
.target(
|
.target(
|
||||||
name: "tcmpush",
|
name: "tcmpushWrapper",
|
||||||
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
Normal file
BIN
Sources/.DS_Store
vendored
Normal file
Binary file not shown.
|
|
@ -1,59 +0,0 @@
|
||||||
//
|
|
||||||
// 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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
3
Sources/tcmpushWrapper/Dummy.swift
Normal file
3
Sources/tcmpushWrapper/Dummy.swift
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
@_exported import tcmpush
|
||||||
Loading…
Reference in New Issue
Block a user