I am developing an iOS app and I want to be able to send invitations to my app through facebook, which I managed to do using presentRequestsDialogModallyWithSession
But I also want my app to know to whom the invitations were sent.. Is that possible?
Yes it is absolutely possible. Here is the way to get the list of user's friends to whom the user has sent invitation.
In presentRequestsDialogModallyWithSession there must be a handler some thing like this:
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
you can get the result of response URL in resultURL variable. If you convert it to string by using this method
[resultURL parameterString]
you will get fbconnect URL, which is something like this: fbconnect://success?request=57985658213xxxx&to%5B0%5D=13xxxxxxx9&to%5B1%5D=1000000xxxxxxx3
here, first parameter after request= is "57985658213xxxx&to" which is request id, and remaining parameters separated by "&to%5B0%5D=" and "&to%5B1%5D=" are friends' facebook id. Here I have sent the invitation to two persons, here are they: 13xxxxxxx9, 1000000xxxxxxx3
Instead of all digits, I have placed xxxxxxx in the above ids because I don't want to show my friends' facebook id publicly here in stackoverflow ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With