CLLocationManager "turn on location services..." alertview customization ios - cocoa-touch

I know that I can't change the title or the buttons for this alertview, but i've seen numerous apps that changed the message of the alert view
Something like this
Also, I have the Bump API in my app so everytime the popup shows, it says "Bump uses your location to help determine whom you are bumping." and I don't want that displayed when they first use my app.
Does anybody know how I can change the message or change bump's message?
Thanks

To change the message of the alert, use the "purpose" property of CLLocationManager. Check the docs: http://developer.apple.com/library/IOs/#documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html

I'm not sure how the Bump API works, but if you are just importing all the classes you need, you should be able to edit the location services message. Otherwise, one option would be to request location access before calling the Bump API's to get permission for your app. Once Bump checks, it will already have permission and skip presenting its own.

Related

Custom view to allow location services

I want to be able to create my own view to allow location services from my iOS app. I've read here that it's possible to customise the description of the default iOS location services alert, but what I want is making my own view.
Is this possible?
Thanks!
No, it is not possible. All you can/should do is popping it at the right time. You should make sure that user is informed that permission is really needed, according to several researches (yes, citation needed :) ).
EDIT: it pops up when you first call start monitoring/updating location method from your CLLocationManager instance.
Since iOS8, you should call requestWhenInUseAuthorization or requestAlwaysAuthorization for it to pop up.
Here you can find some very good ideas about it.
Since you can not change the Apple Services Authorisations;
I would recommend you to create your custom view with "allow" & "dont allow" buttons. And than on "allow" pressed request apple permission witch will prompt the iOS or mac OS alert.
Though it seems not user-friendly. Apple users are used to this. Nobody will mind, and you will still show your own design. A lot of famous apps do that.

Google Play game sign in failed

I'm making a tutorial to connect to "google play game service" and a pop up still appear mentioning that "failed to sign in. plesae check your network connection and try again"
Everything is setup correctly, SHA1, package name, app_id, and any other related to configuration.
Two strange message appear in the log:
The fist is "You have not specified a View to use as content view for popups. Falling back to the Activity content view which may not work properly in future versions of the API. Use setViewForPopups() to set your content view."
The second is "disconnect() called when client was already disconnected"
is there any possible solution?
Thanks in advance for any help.

UIWebView disable location prompt

Is it possible to disable the location prompt (or auto decline/accept it) that pops up when you visit certain websites that ask for locations? I am not using a MKMapView because my app will be not be just viewing maps (it just may visit websites that might have maps on it).
I'm guessing since the prompt is not being controlled by my app, but by the iOS system, I probably will not be able to auto decline/accept the dialog.
As far as disabling the prompt from within an IOS app while loading a UIWebView, it is possible.
You will need to intercept the html before it gets loaded into the UIWebView then find which part of it triggers the GPS/Location Prompt. Once you found it, you simply remove it from the html then feed the html into the UIWebView thus 'disabling' the prompt. However, as a result, the webpage will be missing that element.
No, it's not possible to do that. Not with UIWebView, not with any iOS browser.
I know no way to prevent the prompt, I hope it will be implemented as a property of the UIWebView.
The dialog is not there for the safety of the user, when it comes to UIWebViews. The app containing the view has already asked for locations access, and it can be enabled and disabled on settings. To ask for location access both from the app and from the web view, I would regard as a bug.

Getting results of location permission dialog

I am doing this tutorial that would return the GPS coordinates. When I run the application on the iPhone, I am first presented with the UIAlertView asking permission to access my GPS coordinates.
I need to know from where this UIAlertView is thrown? Is it from the OS?
Can we capture this method? When the user clicks on "Allow" or "Don't allow", can I print his choice to the console?
How can I do this programatically? Is there an event for this?
This alert is shown by the OS. The usage of location-based API must be permitted by the user. You can ask the CLLocationManager for the current authorizationStatus and be notified when the status changes (delegate method will be called). Note that the user also can disable location services later in the settings app.
I assume you are using CLLocationManager. Your delegate will get locationManager:didChangeAuthorizationStatus when the applications ability to use the API changes.
Edit:
The first time your application attempts to use the service, the user will be prompted. If the user answers No, your application will not be able to use the service unless they go to Settings->General->Location Services and change the setting for your application.
If you query the API for status and are disallowed, you could put up your own pop-up and instruct the user on how to change the setting for your application.

Confirm user's selection of "Don't Allow" location services

I am using location services in my app. Initially the app asks the user to allow finding the current location. If the user says "Don't Allow", can I show one more alert to confirm that choice? Then, if the user says "Allow" in that second dialogue, can the app get the current location?
No you can't, it is managed by the the system.
You can/should check if the user allowing you app to get the current location.
Because you can change this in the settings app
Check can be done like this:
if (![CLLocationManager locationServicesEnabled]) {
// location can not be retrieved.
}
i think..................
its a not possible beacuse its a default setting of iPhone ....
if u get answer please reply ....in this page......
but u change the setting of iphone, go to setting icon , go to general icon , go to current location and on this button...
sry for poor english
The question is who is showing the second message.
If it's CoreLocation that is showing the message than the last answer is the one that counts - so if it was "allow" then you can.
However - if after the "Disallow" you show your own custom message - the answer there has no affect.
It must come from CoreLocation