Custom view to allow location services - objective-c

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.

Related

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.

Properties of iOS messenger

I need to build an app such as "Messages" in iPhone, but easier (don't need to send messages to server, only in datebase). I was faced with some questions.
http://www.ibm.com/developerworks/library/x-ioschat/index.html
In this tutorial messages look like TableView, how can I do them such as in iPhone standard messanger (comics speach). And how can I implement bar with camera button, text box and send button (what class is responsible for this)?
You are in luck good sir, there is already a class that can fix you up with this and avoid all the work, it's called AcaniChat (screenshot provided). Or you can even see at Sam Soffle's SSMessagesViewController, he is a well known iOS developer who built this class.
It will definitely help you, if you want to mimic that behavior.

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.

CLLocationManager "turn on location services..." alertview customization ios

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.

Disable iphone home button in app, is it possible?

I want to develop a screensaver-like app where the only way of getting back to the springboard is entering a code. Therefore I would need the Home Button action to be ignored, that is that when the user presses the button nothing happens..or something custom...instead of going back to the springboard and terminating the app.
Is this possible? does anybody know if apple will approve/reject this kind of app?
The answer to your question is, yes.
The answer to the question you meant to ask--can I ship an app through the iPhone store that has the home button disabled--is no.
If you are only publishing your app to jailbroken phones you can do it, but it will piss everyone off.
Edit 7 years later:
This is actually extremely possible now--there is a standard feature in the iPhone called "Guided Access". It's hidden under that "Accessibility" Link (With some other fairly cool stuff like flashing the LED whenever you get a call and allowing a Bluetooth keyboard to tab between controls)
It's called "Guided Access". You set a passcode, launch the app then triple-click the home button to start guided access.
It disables exit and allows you to designate regions of the screen you can't touch. You can also set a time limit (For kids playing which seems to be the reason a lot of people look up this question).
Tempted to edit the "Accepted answer" and throw this info in there, but that seems rude so I'll just hope people find this answer.
Annoyingly you also seem to be unable to shut off the phone--I suppose this is perfect for people who want their kids to play a game, but might not hit the original asker's problem of restricting access to a single app (I mean it WILL do that but it'll also prevent it from doing ANYTHING else).
Not with public APIS (and hopefully, not with private ones). Even if you manage it somehow, Apple will reject it for breaking UI guidelines. Moreover, even if they didn't, people could always use the iPhone's "Force Quit" equivalent to hard terminate your app.
Apple is not going to approve this type of app, they state pretty explicitly that you're app needs to respond appropriately to springboard telling the app to terminate both when things like phone calls come in and when memory warnings come in.
This is not possible with the current SDK, nor do I suspect it will ever be.
You might be able to get this behaviour via jailbreaking, but you won't be able to sell your app through iTunes, nor will Apple ever approve such an application.
You can do it like this
Install the following mobileconfig file
This will disable the home button once you launch the app
Download
Found the link Here
Apple won't allow it.
What if something emergency happens and you wan to dial an emergency phone number. You are putting the user at risk. The trade-off isn't worth it.