From 0aeb058fcc32f07eec054ce6aa45d15753795a19 Mon Sep 17 00:00:00 2001 From: GalvinGao Date: Mon, 30 Jun 2025 12:57:07 +0900 Subject: [PATCH] fix: idToken NSJSONSerialization --- ios/LineLoginModule.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ios/LineLoginModule.swift b/ios/LineLoginModule.swift index c1a75c2..6b81dcd 100644 --- a/ios/LineLoginModule.swift +++ b/ios/LineLoginModule.swift @@ -135,12 +135,17 @@ import LineSDK } private func parseAccessToken(_ token: AccessToken) -> NSDictionary { - return [ + var result = [ "accessToken": token.value, "createdAt": token.createdAt, "expiresIn": token.expiresAt, - "idToken": try? JSONSerialization.data(withJSONObject: token.IDToken ?? [:], options: []) - ] + ] as [String : Any] + + if let idToken = token.IDTokenRaw { + result["idToken"] = idToken + } + + return NSDictionary(dictionary: result) } private func parseFriendshipStatus(_ status: GetBotFriendshipStatusRequest.Response) -> NSDictionary {