Skip to content

Can't download images from Facebook after call FirebaseApp.configure() - when app linked to FirebasePerformance. #486

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

Closed
vgorloff opened this issue Nov 22, 2017 · 14 comments

Comments

@vgorloff
Copy link

vgorloff commented Nov 22, 2017

[READ] Step 1: Are you in the right place?

When i'm calling method for image download before FirebaseApp.configure() it works.
When i'm calling method for image download after FirebaseApp.configure() - getting iOS Networking error finished with error - code: -1001.

Line above FirebaseApp.configure() - OK.
Line below FirebaseApp.configure() - Not OK.

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 9.1 (AppStore) or 9.2 beta (9C34b)
  • Firebase SDK version: 4.6.0

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

  • Use sample URL: https://graph.facebook.com/v2.11/109693813139899/picture?type=square&width=140&height=140

  • Download image from sample URL before calling FirebaseApp.configure().
    As result image downloaded

  • Download image from sample URL after calling FirebaseApp.configure()
    As result iOS Networking error: Task <ADC5BE66-ACD8-49FD-9863-D37AAEF25C31>.<1> finished with error - code: -1001

Relevant Code:

class SampleDownloader {
   
   let urlSession = URLSession(configuration: URLSessionConfiguration.default)
   var task: URLSessionTask?
   let url = URL(string: "https://graph.facebook.com/v2.11/109693813139899/picture?type=square&width=140&height=140")!

   func download() {
      print(url)
      task = urlSession.dataTask(with: url) { data, response, error in
         print(data)
         print(response)
         print(error)
      }
      task?.resume()
   }
}

// ---
let sd = SampleDownloader()
sd.download() // Works
FirebaseApp.configure()

// ---
let sd = SampleDownloader()
FirebaseApp.configure()
sd.download() // `Task <...>.<1> finished with error - code: -1001`

@vgorloff vgorloff changed the title Can't download images from Facebook after call FirebaseApp.configure() Can't download images from Facebook after call FirebaseApp.configure() Nov 22, 2017
@morganchen12
Copy link
Contributor

Apple's docs say this is a timeout error.

Does replacing your download link with a small file hosted locally make the issue go away? If so, it's likely not a Firebase issue.

@vgorloff
Copy link
Author

Interesting that same URLSession used to download other images. Issue observed only when downloading image from Facebook. And only if Firebase app is configured (by calling FirebaseApp.configure()). :0

@vgorloff
Copy link
Author

Curl working well: curl -v -L --url 'https://graph.facebook.com/v2.11/109693813139899/picture?type=square&width=140&height=140'

@vgorloff
Copy link
Author

Same thing on Firebase 4.3.0. :0

@vgorloff
Copy link
Author

Firebase 4.3.0:
Not linking to FirebasePerformance solved issue .)

Flags removed: -framework FirebasePerformance -framework GTMSessionFetcher

So issue in FirebasePerformance module.

@vgorloff vgorloff changed the title Can't download images from Facebook after call FirebaseApp.configure() Can't download images from Facebook after call FirebaseApp.configure() - when app linked to FirebasePerformance. Nov 22, 2017
@vgorloff
Copy link
Author

vgorloff commented Nov 22, 2017

Theoretically issue related to FirebasePerformance + HTTP2. Because Facebook CDN uses HTTP2.

@morganchen12
Copy link
Contributor

I see, thanks for digging into that.

@vgorloff
Copy link
Author

Firebase 4.6.0, Xcode 9.2 beta (9C34b), iOS 11.2:

Not linking to FirebasePerformance solved issue .)
Flags removed: -framework FirebasePerformance -framework GTMSessionFetcher

So issue definitely in FirebasePerformance module.

@morganchen12
Copy link
Contributor

Filed internal but b/69680733; I'll keep this ticket updated as progress is made.

@vgorloff
Copy link
Author

Thanks! .)

@mikehaney24
Copy link
Contributor

This will be fixed in the next version of the SDK. Leaving open until then.

@votson
Copy link

votson commented Dec 18, 2017

So I should be good now

@votson
Copy link

votson commented Dec 18, 2017

So I be getting better now

@mikehaney24
Copy link
Contributor

This issue should be fixed in the latest FirebasePerformance pod, v1.1.0. Please feel free to reopen if that's not the case!

@firebase firebase locked and limited conversation to collaborators Nov 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants