show current user location? - iphone

I know this has been asked by many others. I just wanted to know that by now the simulator is still unable to detect the current location (it always detects it as Cupertino). Is this true? Has apple actually done some update on this issue?

No, and they won't. The simulator is a joke. It should only be used when fiddling around before you get approved for the iOS Dev program. All actual debugging should be done on a device. Period.

In the simulator you cant see the current location,if u write code for to display current location, in simulator it shows default sanfrancisco location.Run That application in device then it shows curtrent location

Related

WKExtension.sharedExtension().openSystemURL() prompting when it shouldn't

I am developing an extension of an iPhone App for Apple Watch (written in Swift running WatchOS2.2, Xcode 7.3, testing on a physical device)
I am running into an issue where I expect no prompt/confirmation on the Apple Watch when calling the tel schema for the following function:
WKExtension.sharedExtension().openSystemURL(NSURL(string:"tel:1231231234"))
I am not calling the telprompt function as my understanding is that this is not supported directly by Apple however it seems to be behaving as if it is telprompt. Interestingly enough, telprompt doesn't work.
I am expecting this to directly call the phone number without the prompt on the Apple Watch, however it is first prompting the user displaying a Cancel button on the top left, the number in the middle of the screen, and a Call button at the bottom. This also doesn't appear to be picking up the localization on the system (french for example) so it is always displaying Cancel and Call in English.
Image of Cancel, Number, and Call being prompted when French in the system language
Has anyone else encountered this issue? I haven't found much talk about it on the web. Or is this a known issues? Again, I don't see any bugs reported for it.
Fix Found for the Localization - See Below
Interestingly enough I was able to get the localization working.
The fix for it was that my Target for my Watch and WatchExtension needed to be checked off for my Launch Images (or splash screen images, or commonly left as "default.png"). Previously my Launch Images were for the app Target only.
I have no idea why the localization seemed to be require my launch images be added to the Watch and WatchExtension targets.
This did not resolve the prompting as it still took place - however since it was at least presenting the correct language this was good for us.

Application doesn't launch with location key after a significant location change

My application uses the core location also after the application terminates with the method startMonitoringSignificantLocationChanges in CLLocationManager class.
My application launches with a location key in iOS 5 and 6 in the method:
- (BOOL) application:application didFinishLaunchingWithOptions:launchOptions;
in AppDelegate class and everything works well.
But in iOS-7 betas the application doesn't launch with a location key after a significant location change.
Has anybody encountered this problem?
I tried it on a simulator and in the device.
Thanks for the help.
I have the same problem in my app, when the app was terminated by user from app switcher.
But it does launch with location key if it was terminated by OS for low memory or other reason.
It is the expected result from iOS7 unfortunately. An official apple response I got from one of their evangelists:
If a user swipes up in the app switcher then the OS will not launch
the app unless explicitly told to do so by the user. So no, SLC will
not be launching the app, nor will silent notifications. The only
thing that will launch the app at that point is the user tapping the
icon. The intention here is that the user has expressed their choice
of not having that app running any more for any reason, so we honor
that. In this situation, there's really nothing that you can do. The
next time the user launches the app you can let them know that some of
the data may be missing, although you really cannot tell whether
there's missing data or not (i.e. you might have been killed by the OS
in the background and the user may not have moved thereby not
triggering any SLC notifications). My suggestion would be to gather
the data you can within the policies of the OS and if the user has
manually killed the app then respect that wish and don't do anything.
By all means, feel free to file a bug report if this change in
behavior winds up causing problems for you or (especially) confusion
for your users.
Attach link to Apple DEV forums:
https://devforums.apple.com/message/882691#882691

is NSLog() stored on the device (iPhone etc)? If so, where?

Should all NSLog() calls be deleted in the final app for iTunes?
In my iOS app, I've got lots of NSLog() for debug.
Should I conditionally code them out before uploading to iTunes?
This is for an app for: iPhone, iPod, iPad
Thanks.
I'll answer the OP's question in the title about where the logs are stored on the device. NSLog() uses the ASL (Apple System Logger). Programmatically, you can only read the last 256 entries (which is what Xcode shows in the Organizer, for example).
However, if you want to access the full files, they are stored in:
/private/var/log/DiagnosticMessages
When you look into that directory (note: device must be Jailbroken), you'll find a long list of *.asl files.
I found a tool to parse those files, but I haven't tried it yet, so YMMV:
Parsing Apple System Log (ASL) files on iOS and OSX for Fun and Evidence (and a Python script to do it for you)
You don't have to remove all of them; in fact, they can be useful if your app crashes on a user's phone and you want them to send you a crash log. When a user syncs his/her phone, the crash log is located in the folder
~/Library/Logs/CrashReporter/MobileDevice/<DEVICE_NAME>
If you have NSLog()s you may gain useful information just as you would when debugging. As the others pointed out, don't overdo it, but it they could end up being useful.
Yes, We should remove all the NSLog() calls before uploading to iTunes. That is done mainly for better performance.
Even if u dont remove them, no problem. It will be approved. But if u have lot NSLog() s, the that will def. affect the performance.
Try using this for your NSLogs:
#define DEBUG
#ifdef DEBUG
NSLog(#"Your tests outputs");
#endif
Not all. You should keep the error logs. That will make it easy to locate if there is any error or crash.
Its possible to see NSLog messages using Organizer too.
You dont need to remove NSLogs if they added against DEBUG mode. So even if your app crashes and if it contains user personal data, it will be removed by ios. So do not worry about user data and NSLog. Refer https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AnalyzingCrashReports/AnalyzingCrashReports.html
Still if you want you can use this PJiOSAppConsole in your application. It will keep logs in your application only. You can use it at runtime by adding snippet in #ifdef then remove whenever you want to go to live. Easy to integrate and use.

Problem with geolocation on iPhone

I have developed a simple program for current user location following this tutorial :
http://www.youtube.com/watch?v=qNMNRAbIDoU
However when I build and run, the map is shown but the cuppertino location (apple headquarters) is not located on the map.
I heard that the problem may be that apple didn't recognize my wifi or something like that, is this possible, and if so, should I keep my code and suppose it to be true and so wait to test it on device later? Thanks in advance
Make sure you watch to the end of the tutorial as he makes a mistake on the method name, which he corrects, to be honest it doesn't look like a very good tutorial, I'd find another.
In Simulator, the blue dot will always pinpoint the Mothership.
However, mapView.userLocation.coordinate will in fact return your current location coordinate (based on Wifi, so be sure it's on).
Note, though, in pre-4.0, mapView.userLocation.coordinate is returns the coordinates for the Mothership.
Once you start testing on your device the blue dot will appear correctly in your MKMapView. Be sure to test your app on a device when using CLLocation and MKMapView, especially if you rely on the users location for anything. Well, always be sure to test your app on a device :)

iPhone app is region locked

First I need to mention that I'm not a developper, but I can probably work my way around enough in xcode to fix this little issue.
I submitted an application to the app store (that was developped by someone else who's not available right now), but it was rejected because it's "geolocked", meaning the application can only be accessed if you set your international "Region format" setting to Canada.
I need to know what modification I need to make in order for this app to work on all region formats. Is it a string I need to change or is it hidden in a plist file ? I have the feeling the fix is quite easy to apply.
I’ve never heard of an iPhone app using region formats to prohibit launches. I suspect your developer put this code in either out of naïveté or malice; either way, you’ll need to look for a section of code that inspects the region settings.
I'm not aware of something like "geolocking" of iOS application. The only thing you can do, which is quite close to your question, is to set in which countries is this application available. This can be set in iTunes Connect.