In my flutter IOS application, am having a TextDropdownFormField which will load the list of values. This is working fine in debug mode but in release mode, the app crashes when we click the dropdown.
TextDropdownFormField(
onChanged: (dynamic str) {
setState(() {
_playerchosenValue =
str.toString();
});
},
options: teamPlayerList,
labelText: MyStrings
.AshShotTakenBy,
dropdownHeight: 120,
),
Getting this error. I don't know what I am missing. Any suggestion on how to find the error?
Related
The app we have been developing has been working without problems, until iOS 16.1 was installed (on iPhone 11). We have also encountered this problem on iPhone 14, version 16.0.2. Updating to iOS 16.3 does fix the problem -- however we have a mandate to work on whatever iOS version the user is running -- since this is a app to be used in emergency situations, and the user won't have time to update. So we are looking for programmatic solutions or workarounds -- if that is not possible, settings users can change on their devices that will be quick. The geolocation library we are using is react-native-geolocation/community. Thank you for any help.
work for me
// install this -->
npm install #react-native-community/geolocation --save
if (Geolocation) {
Geolocation.getCurrentPosition(
position => {
const latitude = position.coords.latitude;
const longitude = position.coords.longitude;
console.log(`Latitude: ${latitude}, Longitude: ${longitude}`);
},
error => {
console.log(error);
},
{ enableHighAccuracy: true, timeout: 20000, maximumAge: 1000 }
);
} else {
console.log('Geolocation is not supported on this device');
}
I am facing a strange issue, I am working on an app that is already built by another developer flutter, and is also available on the app store. When I run the code on the simulator it does not show the login and signup screen but shows the recruiter screen while it works fine on android here is a condition that we check if a user is login or not
Future.delayed(
const Duration(seconds: 2),
() => {
if (_result.userData?.uid != null)
{
_permissions(_result.userData?.uid ?? 'oh'),
if (_result.userData?.atype == 'Recruiter')
{
Navigator.pushReplacementNamed(
context, "/Ind_select_ricruiter")
}
else
{
if ((_result.userData?.industry1 == '' ||
_result.userData?.industry2 == '' ||
_result.userData?.industry3 == ''))
{
Navigator.pushReplacementNamed(
context, "/Ind_select_jobseaker")
}
else
{
print(_result.userData?.video),
if (_result.userData?.video == '')
{
Navigator.pushReplacementNamed(
context, "/ManageVideo")
}
else
{
downloadFile(
'my file'),
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => HOmepage_jobseaker(
_result.userData?.video ?? 'oh')),
(Route<dynamic> route) => false),
}
}
}
}
else
{Navigator.pushReplacementNamed(context, "/signIn")},
});
Is it because of some kind of cache in Xcode that takes the user register and does not show the login screen while I run the app for the first time? I want to show the login screen when the user run the app first time on ios. On Android, it works fine.
I'm guessing that the _result.userData?.uid is a locally saved property and already has a value set on your current simulator?
You could try running the app with another iOS device,
if you're running the app on Xcode, click on the device name shown at the top panel and select a different device from the dropdown.
if you're running the app on VSCode, go to the Simulator window, and select a new device as follows,
then you can close the previous window and run the app with the new device.
See whether this works.
After 2 days I'm driving myself nuts because I can't resolve this. My issue is as follows:
1.) I am trying to use javascript target an iOS device (regardless of browser being Chrome on apple, Safari, Firefox on apple etc...) to show a different DOM element verses non iOS browsers.
2. ) My iOS detection code is as follows, which I've seen in several other threads: // Detects if device is on iOS
const isIos = () => {
const userAgent = window.navigator.userAgent.toLowerCase();
return /iphone|ipad|ipod/.test( userAgent );
}
3.) After running this check I am attempting the following in both Safari and Chrome on iOS "my way which I'm assuming is incorrect because it's not working lol!" :
if(!isIos()) {
setTimeout(function() {
console.log('showing non iOS banner prompt after delay');
}, 10000);
} else if (isIos()) {
setTimeout(function() {
console.log('showing iOS banner prompt after delay');
}, 10000);
}
4.) The proper log is shown through chrome dev tools on my windows laptop when selecting an iOS device (which I know is not an actual iOS enviroment), but no matter what i do, once loaded to the live site it ALWAYS shows the non Ios log on my iPad.
SOLVED (for iPAD)
After finding this post enter link description here i changed my detection method. I was testing on an iPAD (as this is the only Apple product i own because I'm not a fan) and after this correction my current issue was resolved. I hope this works on other devices as well but won't know until I borrow a freind's. Hope someone else finds this helpful.
||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)
const isIos = () => {
const userAgent = window.navigator.userAgent.toLowerCase();
return /iphone|ipad|ipod/.test( userAgent ) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
}
I'm building a cross platform app using Ionic 3.19.1,
On Android everything runs fine, but when i build the app for IOS and then run it on a device using Xcode i get some unexpected behaviour:
Expected:
1) Clicking on a button, the dialer should open and make a call
2) Clicking on a button, the camera should open
Actual:
None of those actions happen until the app gets into background, for example when opening the notifications bar or the tools bar on the bottom.
CODE:
This is the code used for making a phone call, using #ionic-native/call-number
this.callNumber.callNumber("+123456789", true)
.then(() => this.navCtrl.setRoot(CompletedPage))
.catch((error) => console.log(error));
This is the code used to open the camera, using #ionic-native/camera
const options: CameraOptions = {
quality: 60,
targetHeight: 600,
targetWidth: 600,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imageData) => {
}
The code and cordova plugins are correctly set up and working fine, the only problem is that they don't get executed until some event occurs on the page (i guess focus event or something related),
i'm not getting errors for the call-number, but i'm getting a warning for the camera:
Attempt to present <CDVCameraPicker: 0x17a84e00> on <MainViewController: 0x176345a0> whose view is not in the window hierarchy!
I looked around for that message but i couldn't fine nothing related to ionic.
Any kind of help or just link to resources will be appreciated!
I'm developing a App with Ionic 2 and I'm have problems with #ionic-native/Camera. I've this code on Upload.ts
let loader = this.loading.create({
content: 'Carregando video....'
});
loader.present().then(() => {
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
mediaType: this.camera.MediaType.VIDEO,
}
this.camera.getPicture(options).then((videoData) => {
this.uploadForm.controls['file'].setValue(videoData)
loader.dismiss();
}, (err) => {
console.log(err);
});
});
This code works fine in Android, but when I run ionic cordova run ios -lc, the promise this.camera.getPicture(options) is never resolved, so the loader keep running forever.
Thanks in advance!
So, I found the problem. First thing is that native components bugs with -l (--livereload). I don't know how to explain why but I got this information from the Ionic Worldwide slack. A member from Ionic Team said:
"live-reload on a device can cause issues with plugins and file system".
So I used this video to understand how to debbug the APP using the iOS emulator and Safari.
https://www.youtube.com/watch?v=Aob749bkoLY
A little brief of the video: when using iOS emulator, you can access the menu Developer > Emulator > <App Name>. A new window with inspector tools will open and logs from the emulator will appear on this window.
I found out that's the video url was incorrect. Before, to be compatible with Android, I've this code responsible to find the video pointer in system and send to the server:
filePath = 'file:///' + this.uploadForm.controls['file'].value;
But, iOS File Picker already has a "file:///" prefix. So prefixing it again made it wrong. So I updated the code to be like this:
if (this.platform.is('android')) {
filePath = 'file:///' + this.uploadForm.controls['file'].value;
} else {
filePath = this.uploadForm.controls['file'].value;
}
This resolved the problem.