I have the correctly encoded base64 string that I can decode it online, but when I use the code below and try to decode it using swift it report Unexpectedly found nil while unwrapping an Optional value
error.
// the base64Code can be decode online.
let decodeBase64Code = Data(base64Encoded: base64Code)!
The base64 code
eyJyb2xlcyI6WyJVc2VyIiwiTWFpbnRhaW5lciJdLCJhdWQiOiJzdHVkZW50cyIsImV4cCI6MTYwMTk5MjU5OCwiaWF0IjoxNjAxOTg4OTk4LCJpc3MiOiJzZXJ2aWNlIHByb2plY3QiLCJzdWIiOiI0NWI1ZmJkMy03NTVmLTQzNzktOGYwNy1hNThkNGEzMGZhMmYifQ