Test users and unpublished Page - facebook

Just a quick question - I seem unable to access my unpublished Page using a test user that I've created for an app I'm developing. This app is tied to the unpublished Page as a tab, and every time I try to navigate to the Page with a test user I'm redirected back to the test user's wall.
As a test I published the Page and this time I was able to get to the app using the test user.
Surely we can test our Page and Apps together using test user accounts, whilst keeping the Page and Apps in a sandboxed state?
Cheers
Lee

Related

How to test facebook chatbot with test user and test page

I have a chatbot that I want to test with test users on Facebook.
I have created a test app from the main app, per Facebook's recommendations. And in that I have created test users. Those account work and I can log into them.
To test a chatbot, you need to have a page that it's enabled on. So I have created a page in the test user account.
I can even see that chatbot app, correctly named, in the "Business Integrations" menu option.
I can also message the page from the test user account. However, those messages are never sent to the chatbot. There is zero traffic.
Using my real account, I can create a test page and link it to the very same test app for the chatbot and it works just fine. I can message that test page and the chatbot receives the message and processes it.
The difference is that on the app page, the "real world" test page shows up because I own it, so I can add it to the chatbot app. However as the test user is a separate user, the test user page doesn't show up in the options to add a page, only the pages that I own.
There is a menu option to log in as another user, but doing that as the test user gives the error that a test user cannot access the developer.facebook.com service. So no luck there.
So in short, it LOOKs like the test page is linked to the test chatbot app because it appears in "business integrations", but no traffic is routing.
Things changed in 2018 at Facebook. The old way of using Graph API to link your test page to your chatbot app no longer works. Facebook's own documentation is massively out of date and their recommendations not only don't work, the permissions tags no longer exist.
Has anyone solved this puzzle?
You have to use the test user to create a test page and then issue commands directly through the graph API (using curl, for example) to allow the page to use the app. The details for doing that are available on a FB bug report linked in this answer Can you use Facebook "Test Users" to test a Messenger Bot?
The test user cannot see your own pages nor see you but you can see the test page created by the test user and interact with it. Sadly, because the test user cannot see you, the bot cannot get the information about the user interacting with the page either (which might cause exceptions in your bot code). The best way is to interact using a separate test user.

Add REAL test users to Facebook Messenger

I made a test FB page and connected chatbot to it and everything works fine (for me).
It is a simple chatbot that just repeats what you said (work in progress).
Now I'd like to share it with my friends but I can't because app is not published.
Tried to publish it explicitly saying in my app submission that this is only for testing purposes but FB turned it down.
This is just for couple of my friends and this app will change over time as I add better features / bot becomes smarter.
So my question is: is there a way to add real test users like you have on TestFlight for iOS?
Testing should by done before publishing application so that's the most probable reason you gout turned down. To test bot you have to add your friends to bot application (not page) as testers, developers or admins.
To add testers visit Roles section on your bot application and click "Add Testers". On following popup enter their Facebook usernames (found on end of their profile URL). For example if your friend is Mark Zuckerberg with following profile link:
https://www.facebook.com/zuck
you would add him by typing "zuck" in popup. You could also add testers by entering Facebook ID instead of username.
People do not have to be your Facebook friends for you to add them as testers but they will have to accept request and connect to developers hub.
Go the Roles section of your facebook app. You can add testers there, you must be facebook friends I believe.

Facebook Adding friend as test user

I am currently developing an app on Facebook. I understand that you can add friends as test users under 'Roles' where the app is managed. However, when I add someone as a test user, they don't get any kind of notification and cannot find the app from their Facebook page.
This is my first Facebook app and it needs to involve users pictures, and the amount of likes a picture has etc. Therefore, it would be easier for me to test with a real user rather than setting up a load of fake test users and making them like each others pictures.
Any insight or information as to why this invite isn't working or how the user would access my app would be greatly appreciated.
(The app is in development mode - not sure if that is relevant)

Getting Facebook publish_actions Permissions

If this is the wrong place to ask this - I super apologize in advance, I'm at a loss here.
I'm trying to develop a simple Facebook PHP app and I'm having trouble getting publish_actions. Here's how the app will work:
You enter your email address
Periodically, you receive emails like this ("Hey nice person, here's a video we think you might be interested in, click here to share it on your wall")
You click the button, it takes you to the app site, which asks for your publish permissions
You enter a message and share the video to your wall.
My problem: all of that requires publish_actions permissions, but FB won't grant them to me until I can show a working app (I applied for permissions and was denied because "Canvas
Your app isn't loading properly and errors appeared while testing your app").
My question: How do I get access to publish_actions without being able to show a working app (which requires publish_actions)? Can I use PHP to post to my own wall in development mode somehow to test it out?
Again - I apologize for the dumbness of this question, I am a PHP dev who is very new to FB, and I've looked everywhere for answers on this.
Try using the Facebook Graph API Explorer
You will be able to simulate some of the app permissions as if it was production.
Just go and select your app, then select Get User Access Token, finally select all the permissions you want to test.
Use the given token to develop and test things out and when you have a semi finished version, submit it through the app review section, following the Facebook App Review Guidelines
I submitted screenshots, a video of my app working, and step by step description on how to reproduce the publish action.
Hope it helps.

Facebook logout when not authorized

I'm building a public installation using an iPad, built as an iOS web app (using the "Add to Home Screen" functionality) which is going to allow users to share content on Facebook.
I'm currently logging the user in to Facebook and getting them to authorize my Facebook app when they click my custom share button. On a successful login, I open Facebook's Feed dialog and allow them to share. Once they have shared (or clicked cancel) I automatically log them out, making sure that the next user that uses the public installation won't be able to share to the previous user's Facebook account.
This all works well, but things get tricky if someone was to hit my custom share button, log in to Facebook and then not allow my app. This would mean that they have logged in, but as they haven't authorized the app, I don't have an access token, and so can't log them out (FB.logout() requires an access token).
Is there a way around this?
Or is there another way that I can log a user out?
Or is there a safe way to allow a user of a public installation (built in HTML) to share on Facebook and be automatically logged out afterwards? Would building a native obj-c app, and using Facebook's iOS SDK help?
The best I can think of is that if the user logs in but doesn't allow the application, they are told that they need to log out, and redirected to Facebook to be able to do this. However this offers them the chance to browse Facebook and (through shared links in their feed) the whole Internet - this isn't acceptable for our installation.
I solved this problem by creating a native iOS app, where the Facebook share link opened in it's own UIWebView. And once the sharing was complete, I deleted all session & cookie information, effectively logging the user out.