-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[firebase_performance]: HTTP request fails when combined with cupertino_http #17095
Comments
Hey @koji-1009 - could you confirm that the response is different if |
@russellwheatley ![]() |
Hi @koji-1009, I'm unable to reproduce this issue. Both seems to work fine for me. |
@SelaseKay import 'package:cupertino_http/cupertino_http.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(title: 'Demo', home: const MyHomePage());
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
String _httpResponse = '';
String _cupertinoHttpResponse = '';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('HTTP Request Example')),
body: SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: SizedBox(
width: double.infinity,
child: Column(
children: [
Text('http package'),
ElevatedButton(
onPressed: () async {
final client = Client();
try {
final response = await client
.get(Uri.parse('https://httpbin.org/get'))
.timeout(const Duration(seconds: 5));
setState(() {
_httpResponse = response.body;
});
} on Exception catch (e) {
setState(() {
_httpResponse = e.toString();
});
} finally {
client.close();
}
},
child: const Text('Make HTTP Request'),
),
Text('http package response:'),
Text(_httpResponse),
const SizedBox(height: 16),
Text('cupertino_http package'),
ElevatedButton(
onPressed: () async {
final client = CupertinoClient.defaultSessionConfiguration();
try {
final response = await client
.get(Uri.parse('https://httpbin.org/get'))
.timeout(const Duration(seconds: 5));
setState(() {
_cupertinoHttpResponse = response.body;
});
} on Exception catch (e) {
setState(() {
_cupertinoHttpResponse = e.toString();
});
} finally {
client.close();
}
},
child: const Text('Make HTTP Request'),
),
Text('cupertino_http package response:'),
Text(_cupertinoHttpResponse),
],
),
),
),
);
}
} no_performance.mp4add_performance.mp4 |
Hi @koji-1009, I was able to reproduce the issue using your example app. However, I'm not sure if this can be resolved at the FlutterFire level. |
@SelaseKay |
I added FirebasePerformance with SPM and CocoaPods to see how it works. In both cases, the HTTP GET by the cupertino_http package is successful. https://github.com/koji-1009/pefromance_urlsession_example/tree/spm_performance |
Is there an existing issue for this?
Which plugins are affected?
Performance
Which platforms are affected?
iOS
Description
Adding firebase_performance to dependencies to a project using the cupertino_http package causes HTTP requests to fail, which is not a problem with the http package.
Reproducing the issue
Create the following application.
Check the behaviour in the case where firebase_performance is not added to
pubspec.yaml
and in the case where it is.Firebase Core version
3.11.0
Flutter Version
3.29.0
Relevant Log Output
Flutter dependencies
Expand
Flutter dependencies
snippetAdditional context and comments
When checked with dev tools, the status is null.
The text was updated successfully, but these errors were encountered: