Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search for stock, stock can't be selected - Xcode 12 #8

Open
cheuwleeyeo opened this issue Dec 21, 2020 · 3 comments
Open

Search for stock, stock can't be selected - Xcode 12 #8

cheuwleeyeo opened this issue Dec 21, 2020 · 3 comments

Comments

@cheuwleeyeo
Copy link

Hello,
Just did a clone(and also install app from the App store); same behavior.

  When selecting search for "stock", it list the stock but I can't seem to select it from the table view ?

  I can see that it can get to the Alphavantage web to get the possible list of stocks.

  Thanks.

Lee

@markknopper
Copy link

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)")

@davidakoontz
Copy link

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)!

@davidakoontz
Copy link

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)!

Repository owner deleted a comment from oninn Mar 13, 2024
@github-staff github-staff deleted a comment from insite-la Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@markknopper @davidakoontz @cheuwleeyeo and others