For 5.0, i use the clgeocoder and clplacemark, but i get "1 stockton street" everytime. I believe 1 stockton st is the address of an apple store in s.f. The Mk classes work for the same program for younger version simulators.
Why is the 5.0 simulator defaulting to the store's location?
Check out the Location Simulation section in the release notes for Xcode 4.2
You can also simulate movement using a GPX file, check this out Simulate Location including movement in Xcode 4.2 / iOS5
Earlier versions of iOS simulator have no location while iOS 5 Simulator have the ability to simulate location (note the location arrow at the bottom of xCode screen). I don't know how you simulate location changes in your code, but it may happen, that simulator activity interrupts your location changes chain.
Related
I have a problem with firing geofence events on Xamarin.ios . I remember I used to have it working using the same methods in the past. Right now it doesn't work somehow.
I'm using the following code to start monitoring:
CLLocationManager locMan = new CLLocationManager();
locMan.RequestWhenInUseAuthorization();
locMan.RequestAlwaysAuthorization();
locMan.RegionEntered += (sender,
e) => { Console.WriteLine("You've entered the region"); };
locMan.RegionLeft += (sender, e) => { Console.WriteLine("You've left
the region"); };
CLCircularRegion aRegion2 = new CLCircularRegion(new
CLLocationCoordinate2D(30.432, 97.7360), 100, "apple test");
locMan.StartMonitoring(aRegion2);
And that's one demo project that I'm trying to test the geofence events on but not working :
https://github.com/aproram/Xamarin_ios_geofence_issue_demo
I'm testing the location change from the simulator menu (Debug->locaiton->custom location). Sometimes I get this message in the console output while changing the location:
[Client] #Spi, Interrupted
Development environment:
Visual Studio v8.1
Xamarin.iOS Version: 12.10.0.153
xCode 10.1
Simulator iphone 6s (ios 12.1)
One thing to mention, I tried testing geofencing with an xCode SWIFT project and the events were fired. So I'm not sure if the problem is with my C# code or VS..
stack overflow post
I don't know if this is the issue you are running into, but you need to make sure you have all three of the description keys in your info.plist for anything > iOS 11. That may be why it used to work, but doesn't work now.
The keys are as follows:
NSLocationAlwaysAndWhenInUseUsageDescription
NSLocationAlwaysUsageDescription
NSLocationWhenInUseUsageDescription
There is a WWDC video talking about the changes in CoreLocation coming in iOS 13 so this may change yet again (I don't remember the details of that offhand).
iOS 13 CoreLocation Video
I am testing a Xamarin Forms app on Android and iOS using Xamarin.UITest. Since the application depends on the GPS location, I need to set a fake location. I do this using
App.Device.SetLocation(latitude, longitude)
...where latitude and longitude are variables of type double which contain the desired coordinates.
This works fine on Android but fails on the iPhone Simulator with the following exception:
SetUp : Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Unable to set location
ExitCode: 4
-d,--device-id <device-identifier> iOS Simulator GUID or 40-digit physical device ID
set-location <latitude,longitude>
Expected lat,lng: Got 48,135831,11,573423
I did some research and found a thread on the Xamarin Forums which says that it might help to round the fake coordinates to only 4 digits after the decimal point but it didn't help. Apart from that, I tried to hardcode the coordinates and to use floats instead of doubles but neither of the attempts worked.
What's going on there and how can it be fixed?
Here's my setup:
Xamarin.UITest version 2.2.4
iOS Simulator running iOS 9.3 on an iPhone 6
Host computer: Mac mini running MacOS High Sierra 10.13.6
The same issue occurred several months ago with the following setup:
Xamarin.UITest version 2.2.1
iOS Simulator running iOS 11.2 on an iPhone X
Host computer: Mac Mini running MacOS High Sierra (10.13.3)
At the time, I just left it alone, but now is the time where I need a fix.
Expected lat,lng: Got 48,135831,11,573423
It appears to be a bug in that Xamarin is using your local locale to convert those doubles to strings when they send them to simctl (and simctl is expecting decimal point-based strings or quoted decimals and thus it is parsing those are 4 separate numbers).
In your test code before setting the location, change the culture to en-US and set it back later to your actual culture if needed.
Something like this should work:
var currentCulture = CultureInfo.DefaultThreadCurrentCulture;
CultureInfo.DefaultThreadCurrentCulture = new System.Globalization.CultureInfo("en-US");"
// do some location setting / testing
CultureInfo.DefaultThreadCurrentCulture = currentCulture;
Need to check whether device is jailbroken using cordova. I tried the cordova-plugin-jailbreak-detection plugin, but still can open the same in JAILBROKEN Device. then i got .m files from https://github.com/Shmoopi/AntiPiracy. it was working fine till XCode 8. In XCode 9, getting "System keyword is unavailable" error
Any latest plugin/class files to check Jailbroken compatible for latest XCode ?
system call is not available for ios, remove + (int)systemCheck and it should work for you. Also in + (void)killApplication method comment system call
The isJailbroken method performs various check and if the score is >= 3 then it marks it as Jail broken. Now as the system call is not available then we can live without the score of + (int)systemCheck and proceed without it.
My App tracks your location.
With iOS8 I had to change how it was starting location services.
I got this working with
[self.locationManager requestAlwaysAuthorization];
and adding NSLocationAlwaysUsageDescription to the plist file.
The app now gets your location when run on a device, but not in the simulator.
Any clues on how to get this to work in the simulator? It used to!!!
In the iOS Simulator, select Debug > Location, then choose your location.
I decided to post this in case anyone else had the same issue. I got the simulator to respond to location changes again by adding NSLocationWhenInUseUsageDescription back into the plist file. I had removed it since my app needs the Always permission instead of WhenInUse. By adding this back to the plist the simulator is now happy. I did not have this issue on the physical device, just the simulator.
I am using Xcode version 4.5.1 and OS X version 10.8.2.
I downloaded the CurrentAddress sample project (ver 1.2) and when I run it the first time it prompts "'CurAddress' Would you like to use your current location", to which I say OK. I cannot figure out from where the code is getting the location that it ends up using, which is in or near San Francisco, lat 37.7858, long -122.406. I have looked all over the project and cannot see where these values are coming from. Thanks for any help.
this comes from CLLocationManager, which either will get that data from the GPS sensor in your iphone device, or from the GPS simulation built in in iPhone Simulator.
San Francisco is the default GPS simulation track, near Apples Headquarter.
If you are running in simulator, go to simulator debug menu -> Location -> you can set any location here. If I am correct, your CLLocationManager should pick the current location in simulator from here. In device, it should pick the current location, if the same is enabled.