Code Generator is a time based code generation app for not just facebook. It creates a unique login code every 30 seconds, even when you aren't connected to the internet, so you always have a code when you need one. If you have login approvals turned on, you can use Code Generator instead of waiting for a text message with your login code.
How to use for facebook:
Open your facebook account on your personal computer and go to settings->security setup code generator.
Or you may go to this link http://on.fb.me/1dTEf8n or http://is.gd/codegen and setup code generator.
Use the secret key from facebook to Add Secret in the Code Generator app.
Please note that, for successful code generation your device clock need to be in correct time and date and also set to correct time zone.