Open cheuwleeyeo opened 3 years ago
I think I figured out this problem. In Networking/Request.swift, there is a query to financialmodelingprep.com, but that needs an API Key. So the solution is to add an API key in Configuration.swift, and change the code in func companyProfile to look something like this:
var urlString = companyProfileURL.replacingOccurrences(of: "{company}", with: identifier)
urlString.append("?apikey=\(configuration.financialmodelingprepApiKey)")
Has that fix been added to the REPO master / dev?
I just hand rolled it in to my code base (development Mar 22, 2022) and the app is crashing.
// MARK: Portfolio & Search Shared
private func companyProfile(identifier: String) -> AnyPublisher<CompanyProfileResponse, Never> {
var urlString = companyProfileURL.replacingOccurrences(of: "{company}", with: identifier)
urlString.append("?apikey=\(configuration.financialmodelingprepApiKey)")
let url = URL(string: urlString)!
DivRise/Request.swift:72: Fatal error: Unexpectedly found nil while unwrapping an Optional value 2022-03-22 18:44:24.419356-0500 DivRise[21900:1652350] DivRise/Request.swift:72: Fatal error: Unexpectedly found nil while unwrapping an Optional value
line 72 is DateFormatter func fetchUpcomingDividendDate(portfolioStock: PortfolioStock) -> AnyPublisher<UpcomingDividend, Never> { return getCompanyCashFlowStatement(identifier: portfolioStock.ticker, period: "quarter") .map { var date = DateFormatter.fullString.date(from: $0.financials.first!.date)!
Hello, Just did a clone(and also install app from the App store); same behavior.
Lee