Allowe location services again programmatically - iphone

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.

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.

The developers of this app have not set up this app properly for Facebook Login?

I'm trying to make a login with Facebook available in my script. I've done everything, but when I attempt to login with a Facebook account I get this error from Facebook:
Error
App Not Setup: The developers of this app have not set up this app properly for Facebook Login.
Here's error screenshot:
Any ideas?
the problem was you have to set
Do you want to make this app and all its live features available to the general public?
set status and review to ON and problem solved
enjoy coding
With respect to the all the other answers, here's the screenshot to help someone.
Go to https://developers.facebook.com/
Click on the Apps menu on the top bar.
Select the respective app from the drop down.
The circle next to your app name is not fully green. When you hover mouse on it, you'll see a popup saying, "Not available to all users because your app is not live."
So next, you've to make it publicly available.
Click on setting at left panel. [see the screenshot below]
In Basic tab add your "Contact Email" (a valid email address - I've added the one which I'm using with developers.facebook.com) and make "Save changes".
Next click "App Review" at left panel. [see the screenshot below]
Look for this, Do you want to make this app and all its live features available to the general public? and Turn ON the switch next to this.
That's it! - App is now publicly available. See the fully green circle next to the app name.
Since the UI of the facebook has changed recently, here's the latest update for setting the sandbox mode ON/OFF :
Go to https://developers.facebook.com/
Click on the Apps menu on the top bar.
Select the respective app from the drop down.
Go to 'Status & Review' from the table in the left side of the page.
Do you want to make this app and all its live features available to the general public? - Select switch to set YES/NO value.
Update:
The YES/NO button will be disabled until and unless you provide your contact email.
Go to "Settings" in the left menu.
Update your Contact Email.
Hit the "Save" button at the bottom of the page.
Update:
'Status & Review' is replaced by 'App Review' now
If the app is still in private mode (Status and Review set to NO), then only Facebook users with role in the app can login.
That unless you set it to public (Status and Review set to YES).
To add more users to be able to login to a private app:
Go to https://developer.facebook.com
Go to Apps -> "Your app" -> Roles
Choose Add Administrator,Developer or Tester.
Many reasons including:
Sandbox mode is ON
Domain name is different
Site URL is different.
This error also occurs when you try to log in in your test version of the Facebook app and you have not added the user you are trying to test the log in with in the Roles -> Testers section.
To fix it, just add the email address of the Facebook account you are trying to log in with in the section above.
Finally, make sure the user you added accepts the request sent before you try to test otherwise the log in process will fail in the second screen just after the user accept the conditions.
Make Sure in left panel App review tab selected (Your app is currently live and available to the public.) tab is ON and App status is GREEN
Happy Programming
And addition to all these beautifull comments dont forget to Start A Submission
There are a bunch of possible things which could trigger this error:
In your case, you just need to add your facebook account into either tester, developer or admin of your facebook app as you want to use that account to test.
But if you see the error upon clicking connect to facebook(before you have chance to enter facebook credentials), then it means your current facebook account detected from cookie is not a valid tester/developer/admin account for your app.
Your could either add your account in or just hit facebook.com and sign out(to remove the undesired cookie).
I had the same problem but now here is how I solved it
Go to https://developers.facebook.com/
• Click on the Apps menu on the top bar.
• Select the respective app from the drop down.
• Click Settings from the table in the left side of the page
• Then under the Contact Email type in your email you would like to use
• Then click save settings button
• Go to 'Status & Review' from the table in the left side of the page.
• Do you want to make this app and all its live features available to the general public? - Select switch to set YES/NO value.
For other users that run into this issue, the app I was testing against was a test version of our production app and didn't have the option to turn status and review to ON as others have mentioned here.
The fix was to create a new app which is not a test app, and configure it like the production version. The non-test version allows the option to turn status and review to ON.
My specific use was testing a user registered with a phone number instead of an email address. I tried adding that user into different roles of our test app (Developer and Tester), but to no avail. My guess is it has something to do with the user not having an email associated with it.
Here's more info on test apps: https://developers.facebook.com/docs/apps/test-apps
Hemang's answer was right, BUT, there's one extra step you'll need, which is to add a Facebook App ID. (I discovered I was missing this part):
Once you've done that in addition to Hemang's answer, you'll be good to go!
Okay - sandbox is off, domain has to be correct because 99% of the users can reach the app, and "all its live features available to the general public" is set to yes.
Now, You need to add a "Privacy Policy URL" in the App Details tab (developers.facebook.com).
This is a new Policy of Facebook.
This resolved my issue if you do not want to make the app available to the public (keeping Status & Review on NO)
I had to sign out of the previous account on the Facebook App and also remove the Facebook account in Settings. Removing just from the Settings will not remove the error because the App itself still has the previous account logged in.
If you have set your Roles as Administrator/Developer/Tester, you can put in that account login info in and it should work then.
do setup by following bellow link and domain name you need to mention as like wht you have mentioned in facebook app domain name.
Go to https://developers.facebook.com/
Click on the Apps menu on the top bar.
This is because you didn't make your Facebook app live. For this go to:
Facebook developer page->Select your app->you will see top of the right your live option is disable and click to enable it->It will refer to you in "basic setting section"->You have to add "privacy policy url" and "Terms and services url" also you may select app category->then save the setting.
Note: You can use any blogspot or website to make your privacy policy also terms and condition page.Both I gave same url which worked.
after a lot of tries, I've read in other topics which someone said "delete all your apps and create it again". I did that but, as you can imagine, a new App will create a new Application ID on Facebook's page.
So, even after all the "set public things" it didn't work because the application ID was wrong in my code due to the creation of a new App on Facebook developer page.
So, as AndrewSmiley said above, you should remeber to update that in your app #strings
Set LoginBehavior if you have installed facebook app in your phone
loginButton.setLoginBehavior(LoginBehavior.WEB_ONLY);

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

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.

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.

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.