Location sensor not giving location on ios when enabled on Delphi - ios

I'm developing an app for ios and android on Delphi. I have a location sensor that is active. It works without problems on android but on ios it does not work. The program never goes into onlocationchanged event of the sensor location so I cannot get the location of the device. Do I forget anything about uses or something to make the sensor work on ios?
Thank you.

Thank you, Dave! I have to visit the quality portal more...
The solution is:
The problem can be worked around by copying the unit to the project
folder, and commenting out line 151 (the MethodName attribute for
locationManagerDidUpdateLocations)

Related

ZXing Scanner not scanning on iOS in Xamarin Forms app

I'm using the 3.1.0-beta version of ZXing.Net.Mobile and ZXing.Net.Mobile.Forms in my Xamarin Forms 5 app.
Everything is working fine on Android but on iOS, it just doesn't seem to scan at all on an actual device connected to my PC via USB. I also packaged the app and uploaded it for TestFlight testing. When I test it as a fully installed app on my iPhone, it actually crashes the app all together.
My research shows this may happen due to permission issues. I do have the following in Info.plist:
<key>NSCameraUsageDescription</key>
<string>MyApp would like to access your camera</string>
<key>NSMicrophoneUsageDescription</key>
<string>MyApp would like to access your microphone</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>MyApp would like to access your photo library</string>
Though it's not working on my iPhone Xs, the same setup is working just fine on both Android emulator and a cheap LG phone.
There's not much code to show here but here's what I have in my XAML file:
<zxing:ZXingScannerView
IsScanning="True"
OnScanResult="OnScanCompleted"/>
I also want to mention that my app uses the MVVM pattern so here's what I've done to wire things: the OnScanCompleted is in XAML page's code behind that looks like this:
private async void OnScanCompleted(ZXing.Result result)
{
await _vm.On_Code_Scanned(result.Text);
}
So, I call a method in my view model from OnScanCompleted which is in code behind.
And the method in view model is fairly simple:
public async Task On_Code_Scanned(string code)
{
// Process code
}
Any idea how to fix this issue?
UPDATE:
I started a fresh new Xamarin Forms app. I then added ZXing.NetMobile and ZXing.Net.Mobile.Forms and nothing else. When I test scanning a QR code on my iPhone Xs, it still fails. So, it looks like this particular libary just doesn't work on iOS at all
I had the same issue.
The only thing I did was that I've changed the Xamarin.IOS to the latest version (16.0.0.75).
By using Visual Studio => go to Help/Check for Updates
It solved the problem.
i had similar issue, it was working for more than a year then all of sudden all my users complaint its not working anymore, after ios update. the apps just crash whenever it tried to call the barcode scanning camera using zxing.
the solution was easy in my case, just recompile it using latest xamarin.ios version. just need to make sure the version is up to date
I also faced this issue and found the solution.
Instead of using metadataoutput.AvailableMetadataObjectTypes, you need to set all code types in an array of AVMetadataObjectType, for ex:
AVMetadataObjectType.EAN8Code | AVMetadataObjectType.EAN13Code |
AVMetadataObjectType.Code39Code | AVMetadataObjectType.Code128Code |......

How to dismiss or suppress permission issue automatically related to Contacts, Camera, Microphone in iOS Application

I have been working on a project wherein i made a framework where i automatically test the SDK my company is developing.
I have created my dummy sample application for all the platforms(iOS, Android, OSX, Windows) which makes use of this SDK and i thereby test this SDK, call the SDK API's do my work.
Now my question is for iOS i get permission alerts for Contacts, Camera and Microphone first time whenever i use the API's of my SDK which internally is invoking something in iOS framework. Is there a way i can automatically give this permission to my application ?? i know it's iOS own Security concern and it's correct. But how do i bypass it.
I see there is Apple's XCUITest framework but i don't want to open my application via it.
Right now i handle this alert manually but i need to implement Continuous Integration(using ios-deploy), i have done everything but i can't handle these alerts automatically.
Can someone please help me.. Thanks!!

Accidentally overwrote iPhone device location via Xcode

So I'm working on a location-based iPhone app. I'm mainly testing on the iOS simulator, and as such using the Core Location Simulation. All good - I can pretend to be in New York or San Francisco or wherever.
Then I move to testing my app on my iPhone, with that checkbox still enabled. I go for a walk (in, like, the actual real world), pull out Google Maps, and realise that my actual, not-simulator iPhone is using a simulated location. In this instance my iPhone is stuck thinking that it's in London (where I live), but right central in Picadilly Circus, not where I am.
I get home, open up Xcode, and to make sure I've nailed down the cause (rather than just a weird GPS bug etc), change the 'default location' to Johannesburg. Unplug my phone, open Google Maps (and Foursquare, to be sure), same deal. Stuck in Johannesburg.
So it's definitely this panel here that's borked my phone, but I can't figure out how to reset it.
Things I've tried that don't seem to work:
changing 'default location' to 'none' & rerunning
disabling 'allow location simulation' & rerunning
So it seems once you've given your iPhone an arbitrary location to pretend to be in, just disabling that doesn't fix it.
Any ideas? I'm going travelling in a few days and really need my GPS to work!
While you have your device connected to the debugger there is a little button at the top of the debug panel. Right here:
Click on that and you can select 'don't simulate location', exit the app, and I think you'll be good to go.
I'm a little foggy too on how that relates to the location defined in the scheme and the location set in the simulator. I usually find it easier to set a location in the simulator itself rather than in the scheme (at least when testing in the simulator is possible) to avoid issues like this. In the simulator if you enter a location under 'Debug > Location > Custom Location...' while the simulator is on the springboard the location will persist between launches of the app and the simulator.
This has happened to me before, it was very strange and mysterious!
I don't remember how I fixed it, but: have you tried Reset Location & Privacy in the Settings app? If all else fails, I suspect Reset All Settings would maybe work.
As I try to remember, I think maybe hard rebooting the phone might also work (just turn it off, turn it back on).
just Reset Location & Privacy . turnoff location service . restart your phone .. turn on location service . try using google maps .. it work for me ..
The important step is the hard reset after resetting location settings. Not sure if you need to do anything in Xcode, but it is a good idea to select 'Don't simulate location'
Go back to Xcode (or whatever coding software you are using) and rerun the application, then select don't simulate location.
Goto Settings>Privacy>Location Services. Turn-Off Location Services. Restart the phone. Open Google maps. A popup will come to enable location service, click on the options given that will take you directly to Settings. If popup didn't appear in Google Maps, click on Mylocation button at the bottom. Enable Location services and get back to Google Maps. It re-enabled the real Location for me.
Go to Edit Scheme..., then select Run in left panel. In options, set Default Location under Core Location to None.
As suggested in this comment if you don't have Xcode handy, you can just power cycle the iPhone and this seems to be sufficient. You don't need to reset any settings. This worked this morning for my iPhone anyway, recalling it from a winter sojourn of Berlin.

phonegap iOS app working on simulator but not in device. How to debug

I just finished developing a Cordova / Phonegapp app. When I test it on iOS simulator it all works fine and quick, but, when testing on device it works only part of it.
My app is a game with the kingdom background and has 8 buttons (8 buildings).
When I click on each building it leads me to a screen representing what it's inside the building, but one of them doesn't work and gets my app frozen.
How can I see fail or crash reports that helps me debug my app on device?
If you provide full path to your file i.e. "file:///Users/.../someDir/some.html" it will work only on simulator running on the same machine where your project is.
I suggest just adding the additional path to the file you want to access i.e. if you are in "/someDir" you will need to provide only "some.html" or if you want to access parent directory just use "../".
As far as debugging Cordova app, I suggest downloading this plugin and using console.log instead of alert.
Hope this helped.
Ok, I found a "spartan" way to debug my app via alert and found that an url wasn't set properly (still don't know why it worked on simulator)

BlackBerry - JavaLoader error when using the "screencapture" option [duplicate]

I am looking for a screen shot tool that I can use to capture screens from my BlackBerry Tourch 9850. I have tried using the included JavaLoader utility with my SDK but I receive "Retrieving screen <active> data ... Error: buffer too small" errors. I have also tried using the BBScreenShooter v1.67 (I think this is the latest version) but it fails to capture the screen, then crashes.
I need the tool to create a user manual for some software we're developing for BlackBerrys and, as they say, "a picture is worth a thousand words."
If nothing else, perhaps someone knows how to address the small buffer problem with JavaLoader?
With the help of Mark Sohm (thanks Mark ... your help is very much appreicated) the solution was discovered: You have to use the JavaLoader from the v7.0 SDK on devices that have the higher screen resolutions ... the Tourch 9850 is 800 x 480. Versions 6 and lower do not have an implementation that will support the larger buffer required to grab the addition bytes - makes sense.
Although I have not tested it yet it's certainly possible that the BBScreenShooter would work also knowing this .... BBScreenShooter uses JavaLoader to handle the "heavy lifting" with the handset.
Try this way:
Create an application that runs on device startup and listens for GlobalEvents (via GlobalEventListener implementation)
Run this application in JDE or Eclipse and monitor what global events are fired when you press convenience keys on your blackberry device. Write event guids down and find out a guid that corresponds to a convenience key, when it is pressed.
Modify the application created at step 1 to use Display class and invoke screenshot() method of this class when a convenience key is pressed.
As screenshot has been created save it to the device filesystem via BlackBerry FileConnections API. After that you can copy these pictures to your desktop computer when device is connected via usb-cable.
That's it. This application will allow you to solve your task. And may become an additional product for your company, if you add some settings to setup convenience key(s) and path to save created screenshots on device memory/media card.
I'm not sure how to actually fix your problem but alternatively you could just run the application in the device simulator and get the screenshots from there. Run the simulator and go to "Edit" > "Save LCD Snapshot".

Resources