How to get "geolocation" permission inside sandbox of chrome app - google-chrome-app

I have a chrome app with permissions set one of which is geolocation.
It have a sandbox index.html
I want to get user location from that index.html. Is there any way I can get geolocation from that page.
function success(position){
}
function error(){
console.log('unable to track user location now')
}
var id = navigator.geolocation.watchPosition(success, error, options);
gives error user denied location.
I did not see pop up this page is requestiong geolocation permisison

The sandbox does not get the privileges that the app is granted (that's exactly the point of a sandbox), and the Chrome App UI does not allow permission prompts.
Therefore, a sandboxed page can never get that permission. You will need to perform geolocation from a non-sandboxed page and communicate with the sandbox.

Related

How to request pages_show_list permission with Facebook Graph API?

I tried 2 way, one in the Facebook Developer site find permission request with this name, I couldn't find it.
add as a 4th parameter to the Facebook Login Button, it did not help
<FacebookLogin
appId={fbAppId}
autoLoad={true}
fields="name,email,picture,pages_show_list"
onClick={this.componentClicked}
callback={this.responseFacebook}
/>
Do you have any other idea?
The Facebook API works like this,
Development Mode: For development mode you can try to access pages which were associated with the account in which app created. So, that pages associated with that user can be accessible. You can retrieve the pages using following link,
https://developers.facebook.com/docs/graph-api/reference/user/accounts/
Live mode: In case of live mode you need to create a video of snapshot using your development mode functionality and get "pages_show_list" permission approved. Then you can access the pages details associated with authenticated users.
For login button you can try like this,
fb:login-button size="large" scope="public_profile,email,pages_show_list,read_insights,manage_pages" onlogin="checkLoginState();"
which gives you token and use that token to get pages associated with user account.
If you are using the js SDK of Facebook then there is an option to ask permission through SDK functions.
FB.login(function(response) {
// handle the response
}, {scope: 'public_profile,email,..other persmissionlist'});
Note:-
Use this concept only when your app is in the testing phase and
wants to create a request for permission in App Review or there are
some permissions enabled but you want only a few.
Use this approach with Test users only.
Reference link:-
https://developers.facebook.com/docs/facebook-login/web#re-asking-declined-permissions

Facebook UI and API show different permissions granted, can't re-request

I have an app that lets you schedule posts to Facebook for your Facebook Pages, among other things.
For some reason late last week, the API started showing users of my app having different permissions than the Facebook UI (Settings->Apps->(my app)). The app was working fine for months, and suddenly stopped because of this permission change.
The users did not make any changes to the App's permissions, or their global security settings. Facebook still shows the correct permissions for the App for the logged in user in their App settings [1]. When logged into my site, however, the API request shows none of the extended_permissions [2]. The users have not changed their FB password. I have confirmed the app is requesting the correct user via the API.
Things I've tried:
When I force a re-request of the extended_permissions (manage_pages, publish_stream, read_insights), it is simply ignored.
When I add a new permission (manage_ads), ONLY that permission is requested in the UI.
When the user removes the app in Facebook and re-installs, only the new permission (manage_ads) is requested.
If I remove manage_ads from the request and the user removes and
re-installs, no extended_permissions are asked for.
If I make the
user a developer/admin of my App in the Developer/App settings on FB,
everything works as expected and the user is prompted for the correct permissions again. (and everything has been working for me, the admin of the app, this entire time)
I'm not sure what to do or how to proceed! Thank you in advance!
See screenshots here of the user's Facebook settings page and print_r of /me/permissions:
[1] http://i.stack.imgur.com/eS7Kw.png (Facebook UI in App Settings)
[2] http://i.stack.imgur.com/pZYYJ.png (Facebook API /me/permissions)

issue updating facebook user status from my app

what permissions do i need for my facebook app to update status on user behalf.
I already have publish_actions and publish_streams permissions but still my app gives me an error:
error 200: the user did not grant this app the required permissions.
The permissions set in the App Settings are not applied to the app. They are used for logins triggered from the App Center by the Play Game/Go to App buttons – since that is a mechanism where you as the app developer don’t trigger/implement the login yourself, you can not set a scope parameter there; and therefore you make those settings in your app dashboard, so that Facebook knows what permissions to ask for when the user enters your app this way. - Info by CBroe.
For the permissions be applied in your app, you should set the permissions through your code. The permissions are set while implementing the login functionality. For eg: In Javascript, it is done like this: FB.Login

Facebook not asking for permissions

I'm developing a Facebook canvas app and I'm testing how the whole permissions thing work.
One thing is calling my attention and I think it's kind of weird: The first time, a user enters the app, Facebook sends the signed_request without the user_id and access token (as expected). Then my app redirects to the Login Dialog, so the user can authorize the app and give the asked permissions.
At this point something strange happens: Facebook is automatically redirecting the user to my app with the given permissions (and user_id and access token), but without prompting the user to give the permissions.
I have verified this behavior with test users and testers.
Is this normal? Is it possible to "force" (for testing purposes) the "ask for permissions" screen?
It is normal on a second or later use of the Facebook app.
Remove the app's permission from the Facebook account before starting the app to get back the ask for permission screen.

How to hide the facebook authorization dialog on iPhone?

I'm implementing facebook connect for my iPhone app. The current facebook SDK would keep you logged in unless you log out explicitly, which is fine with me as stay logged in is actually the requirement. However, I don't want the users to go press the log in button if they never logged out. In this case, I won't be able to grab the facebook object, which I'll need in other parts of my app. So I was planning to simulate the log in event anyways, but that led me to another problem: even though permissions are granted to my facebook app before, it will still pop up the authorization dialog to my users saying they have granted permissions to my app. My question is, how do I hide this? Or, is there a way that I can grab the valid facebook object without calling authorize on my facebook object when my app is restarted and the user stayed logged in?
Any suggestion would be appreciated.
You could redirect the user to https://www.facebook.com/login.php?api_key=<YOUR_APP_ID>. (This is the URL that the PHP Facebook SDK returns when you call getLoginUrl()).This will avoid the dialog and still allow users to authorize your app.