Closed thatsenam closed 3 years ago
@thatsenam can you provide you app log ? check the log for any error
i already checked the log but found nothing. @medyas
have you run the example app ? it should work.
I implemented on my existing project. I am using the latest version
flutter_compass: ^0.5.1 flutter_qiblah: ^1.0.3+2
.
I copied all code from the example app and successfully run it on android version. but its not working on iOS version. I DID NOT CHANGED ANY SINGLE LINE OF YOUR EXAMPLE CODE. except the main class name. MyApp to QiblaScreen to launch from another activity/widget.
@medyas this is the code i am using
import 'package:Oldham/widgets/header.dart';
import 'package:flutter/material.dart';
import 'package:flutter_qiblah/flutter_qiblah.dart';
import 'package:Oldham/screens/qibla/loading_indicator.dart';
import 'package:Oldham/screens/qibla/qiblah_compass.dart';
import 'package:Oldham/screens/qibla/qiblah_maps.dart';
class QiblaScreen extends StatefulWidget {
@override
_QiblaScreenState createState() => _QiblaScreenState();
}
class _QiblaScreenState extends State<QiblaScreen> {
final _deviceSupport = FlutterQiblah.androidDeviceSensorSupport();
@override
Widget build(BuildContext context) {
return buildHeader(title: "Qibla",child: FutureBuilder(
future: _deviceSupport,
builder: (_, AsyncSnapshot<bool> snapshot) {
if (snapshot.connectionState == ConnectionState.waiting)
return LoadingIndicator();
if (snapshot.hasError)
return Center(
child: Text("Error: ${snapshot.error.toString()}"),
);
return QiblahCompass();
},
));
}
}
@medyas i tried running the example app and here is the log Here is the screenshot of the result -> https://imgur.com/a/Izo03Td
event sent after app closed: {id: 0, progressId: null, message: Running "flutter pub get" in example...}
event sent after app closed: {id: 0, progressId: null, finished: true}
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
Warning: Missing build name (CFBundleShortVersionString).
Warning: Missing build number (CFBundleVersion).
Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store.
Running pod install...
Running Xcode build...
Xcode build done. 62.5s
Waiting for iPhone 12 Pro Max to report its views...
Debug service listening on ws://127.0.0.1:51947/t062pZxzWAg=/ws
Syncing files to device iPhone 12 Pro Max...
@thatsenam are you testing in an Ios Simulator ?
@medyas yes
you need to test on real ios device for this to work. ios simulator are not as the android emulator, they do not support alot of things.
you need to test on real ios device for this to work. ios simulator are not as the android emulator, they do not support alot of things.
Confirmed. There's nothing wrong with the code. The simulator just can't get the "snapshot.connectionState" properly. Thank you.
I added permission in info.list
`NSLocationAlwaysUsageDescription
its not working and showing a loading ... forever screen instead when I am showing compass.