Send invites from the app itself - facebook

How can we send Facebook invites to users of our application?
Usually we receive invites only from friends but not directly from the app itself.
I received an invite from The Sims Social a few months ago and I want to develop the same thing, here is a screenshot:

This kind of request is known as an App to User Request. Only apps that are on Facebook.com or mobile apps can use and send these kinds of requests. Sending them is pretty simple, just make an HTTP POST request to /USER_ID/apprequests with your app access token. You will also want to handle deleting them once they are accepted by the user and reading a list of current requests. They're all documented in the User object docs.

You need to obtain application access token then you can send to the users who are the using this app.
FYI: Authenticating as an App

Related

Facebook sending one time notification

One of the core functions of an App i have been writing, is the ability to send someone a notification. Not from a user, but from the App.
I have successfully managed to send notifications to registered users of my app, that all works like a charm.
I also have the facebook API invitations working so users can invite their friends to use the app.
However, as opposed to most games, where two people use an app together (like songpop, etc), my App should not send notifications from a user that has been using the App. The user should not be known to the person that receives the notification. The initiative for sending a notification lies with the user though.
Documentation on this subject is quite scattered, and on one website it is explained that this functionality is available, while other sites say the opposite.
Is it possible, in any way, that my app can send a one time notification of ANY kind to a facebook user that has not yet authorized my app?
Edit:
Basically, the functionality i am looking for is that user A initiates a notification/message to user B (who is in his friends list), but User A stays anonymous to user B.
You cannot send notifications to users who have not authorized your app. The documenation is quite clear on this:
Apps can send notifications to any existing user that has authorized the app.

Customize Request Dialog

Desired behaviour of my app would be: user that has my app installed can invite other users to install it with a customized request "One of your friends invites to install MyApp". And the requester would be my app (like with notifications API), so kind of anonymously.
Is it possible to customize Request Dialog to do this, or use any other technology?
App generated requests can only be sent to users that have authenticated your application. This is a security measure. If any application could send requests to any user the possibilities of spam would be astronomical.
Furthermore, a user would want to know who invited him to use the application no? What you are suggesting would be extremely problematic.
So to answer your question, no. This is not possible. Application requests to non-authorized users must be sent by authorized users.

How do you post a link to user's inbox in Facebook?

I am a iPhone application developer. I don't know how to send an "link" to a selected user's inbox in Facebook from my Facebook account.
You can't send messages using a Facebook API from the backend, but you can do through JS SDK or redirecting user to facebook url as per this link
FYI: Send Message
I don't exactly know if I understood your question, but: If you want to provide a link that a user follows in order to go to her/his Facebook inbox, you can use the URL scheme fb://mailbox (provided that she/he has the Facebook app installed)
As #Venu wrote, the api does not allow apps to send messages on the behalf of the user, only with the Send Dialog which you should be able to open using the iOS sdk Dialog.
Another approach you can use is the Chat API with which you can send messages on the behalf of the user, it requires the xmpp_login permission and you to implement an xmpp client.

Can we send private messages to friends of a user with offline_access permission?

Is it possible to send private messages to the friends of a user after getting the offline_access permission from him?
While sending app requests, I know its possible to send app_requests to any user(using app_access_token) who is already a part of the application. Like wise is it possible to send using offline_access permission without using send dialog or any other operation which needs the user consent?
No, this is not possible, the only Facebook communication channels you can use are stream Posts and App requests, and if the user is offline, you cannot publish posts as it is against Facebook Platform Policy IV.3.
If this is user-to-user communication, you may be able to send an email to the users username#facebook.com email address, which will create a message for them. However Policy IV.5 explains the limitations of this.

How to get all facebook app request for a user of my apps without storing them

We are building a apps and we want to clear all the apps request for our user when he log into our apps.
I know we could store the request when we send them and clear them when the user log to the apps.
But is there anyway to get all the apps request from FB (through fb api or fql) instead of storing them in our apps.