@chuseok22/capacitor-kakao-login 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- export const APP_VERSION = '0.1.6';
1
+ export const APP_VERSION = '0.1.7';
2
2
  //# sourceMappingURL=version.js.map
@@ -20,15 +20,28 @@ public class KakaoLoginPlugin: CAPPlugin, CAPBridgedPlugin {
20
20
  return
21
21
  }
22
22
  KakaoSDK.initSDK(appKey: appKey)
23
- // handleOpenUrl 오버라이드로 URL 처리 ApplicationDelegateProxy.add() 불필요
23
+ // Capacitor 8: CAPPlugin에 handleOpenUrl 오버라이드 불가NotificationCenter로 URL 수신
24
+ NotificationCenter.default.addObserver(
25
+ self,
26
+ selector: #selector(handleOpenURL(_:)),
27
+ name: .capacitorOpenURL,
28
+ object: nil
29
+ )
24
30
  }
25
31
 
26
- // Capacitor가 AppDelegate.application(_:open:options:)를 플러그인으로 라우팅
27
- @objc public override func handleOpenUrl(_ url: URL, _ options: [UIApplication.OpenURLOptionsKey: Any]) -> Bool {
28
- guard AuthApi.isKakaoTalkLoginUrl(url) else { return false }
29
- // AuthController.handleOpenUrl은 @MainActor — URL 콜백은 메인 스레드 보장
30
- return MainActor.assumeIsolated {
31
- AuthController.handleOpenUrl(url: url)
32
+ deinit {
33
+ NotificationCenter.default.removeObserver(self)
34
+ }
35
+
36
+ // Capacitor 8 URL 라우팅: AppDelegate → ApplicationDelegateProxy → capacitorOpenURL 알림
37
+ // notification.object = ["url": URL, "options": [UIApplication.OpenURLOptionsKey: Any]]
38
+ @objc private func handleOpenURL(_ notification: Notification) {
39
+ guard let object = notification.object as? [String: Any],
40
+ let url = object["url"] as? URL else { return }
41
+ guard AuthApi.isKakaoTalkLoginUrl(url) else { return }
42
+ // capacitorOpenURL은 메인 스레드에서 발송 — MainActor.assumeIsolated 안전
43
+ MainActor.assumeIsolated {
44
+ _ = AuthController.handleOpenUrl(url: url)
32
45
  }
33
46
  }
34
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chuseok22/capacitor-kakao-login",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Capacitor plugin for Kakao social login (iOS & Android)",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/plugin.esm.mjs",