iOS, CLLocationManager: Displaying the "reenable Location Services" Popup - iphone

if location services are turned off (after the user once did allow the service) and you then start location updates, a system popup should appear. (the documentation says so in the description of [CLLocationmanager locationServicesEnabled])
But if I setup a test project, which just initialises a CLLocationManager and then calls startLocationUpdates, the popup does NOT appear on every app start. But it should if I understand the documentation right?
I am not talking about the first popup, which asks the user to allow or deny location use for that app. I am talking about the popup, which asks the user to reenable the location services in the settings. That popup has a direct button to the settings application. You can see it, if you disable location services and than open up the maps app. Everytime you press the locate-me button now, the popup appears. Screenshot:
I want it to show up reliably on every app start in case the services are disabled. (other apps do it the same way, e.g. aroundme)
Thanks, Markus

The Popup will only appear once (in some cases twice) for the lifetime of an app!
That is the result of my tests. If anyone has additional information, feel free to write / contact me!
Thanks.

Related

Photo Library/Camera settings programmatically

I want to enable Camera/Photo library settings for my application. Can i show the alert to enable these programmatically
like when application starts. I have attached picture to show i want to see similar settings for my application
for my application, I am not seeing this settings.
My problem is this application runs in Guided access mode and once user put the application in guided access modes,
application is not getting an iOS alerts , so the default alerts will not come and user will not be able to enable access to photo library.
i have keys description in plist file.
Is there any way i can enable these settings in beginning of application.
No. You can request access programmatically but the request pops up the alert and waits for the user to accept or deny access. There is no way to enable the access without the alert.
If this could be done then it would completely negate the whole point of the user having control over what an app can access or not.
Based on your comments below, you need to know how to programmatically request authorization so the alerts can be responded to.
Use AVCaptureDevice requestAccess(forMediaType:completionHandler:) request access to the camera.
Use PHPhotoLibrary requestAuthorization(_:) to request access to the photo library.
For a better UX, don't make the 2nd request until the 1st one is complete.

Allowe location services again programmatically

I have disabled location services on Safari (iphone) when I load my web clicking on "Not allow". How can I allow it again for the same web page (programmatically)
Best regards
You can not change user preferences programmatically. You can simply check if location services are on and your application has access to services if not prompt user to allow location services to use this feature in your app.
You can't, you will have to go in to the settings app and enable it there.
(if you want your app on Appstore) Programmatically you can not call that dialog which asks you for location services permission.
manually go to Settings -> General, scroll to the bottom and go to Reset-> Reset Location & Privacy.

Location services alertview

When we use libraries of location services in our app it automatically show the alert box when we launch the app with don't allow and Ok buttons.
Is it possible to disable the don't allow button? And is there any variable set when we press don't allow or OK button?
Do you mean when the alert asks the user if they want to allow your application to use location services ? If so then no, you cannot override this. This is so that the user is not only aware that their location is benign tracked but also that this data is going to be used by the application. Would you want an application tracking you and potentially uploaded your location without your knowledge ?
As for the variables, pressing yes will tell iOS that it is allowed to track you data, saying no will do the opposite so any maps or locations based services will not be able to retrieve user location.

Can an application be rejected if on 1st launch user is asked to Activate app via Safari?

possibly a simple question, but I couldn't find definitive answer (see below for excerpt from HIG) myself that would state below scenario as 'unacceptable' and will result in app being rejected:
On 1st application launch after installation user will see an alert
asking to activate the app.
Tapping "Activate" will open Safari and display a web page with
"Activate" button.
Tapping it will launch my app via URL-scheme, pass some server
generated data and allow user to enter main UI.
The application will be locked until user activates.
If you need more context on why and how, please see this answer.
Mobile HIG (as of 2011-10-12):
"If possible, avoid requiring users to indicate their agreement to your EULA when they first start your application. Without an agreement displayed, users can enjoy your application without delay. However, even though this is the preferred user experience, it might not be feasible in all cases. If you must display a license agreement within your application, do so in a way that harmonizes with your user interface and causes the least inconvenience to users."
Well there's similar cases where an app is almost useless until the user registers to some service, take Instagram as an example.
I'd suggest however that you solve this by not forcing the user to leave your app. Instead, present the user with a web view within your app where you politely describe why it is necessary for the user to go through the activation process.
We've done something similar before (EULA presented modally within a web view on first launch, which could only be dismissed by accepting it) and it was approved right away.

How can i hide my facebook application activities?

I do not want my app users to know who else uses the application. Can i hide it so that it doesn't show in the search and can only be accessed with invitation.
There is an option in the application settings that is called "Social Discovery". Set it to "Off". The application also won't show up in the search if you haven't opted to adding it to the search. However if you the app installed, it will show up in the search for you.