How to Send App request to facebook friends through facebook iOS sdk?
Asked Answered
M

1

5

I am using facebook sdk for my my iOS facebook application. I want to send app request to multiple users. I am using following method for that purpose.

NSArray* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
                                                  @"Get Started",@"name",@"http://www.facebook.com/apps/application.php?id=135775646522275/",@"link", nil], nil];
NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"Check out this awesome app I am using.",@"message",
                               @"Check this out", @"notification_text",
                               @"http://www.facebook.com/apps/application.php?id=135775646522275/",@"link",
                               appImage,@"picture", 
                               actionLinksStr, @"actions",

                               nil];
[facebook dialog:@"apprequests"
       andParams:params
     andDelegate:self];

The problem is, I after calling this method, app request web view appears and app request is submitted successfully. But only app_request count on friends wall increases, Neither he gets any notification for app request, nor he can see the app request. What can be the problem, is there any other alternative way to send app request from iOS facebook app ?

Madson answered 16/11, 2011 at 7:45 Comment(0)
W
17

Here is the fix:

  1. Go to http://developers.facebook.com.
  2. Edit your app settings.
  3. Check 'App on Facebook' and 'Native iOS App'.
  4. Enter web-site URL of your app (if you have) as the Canvas URL (Secure Canvas URL can be the same).
  5. Enter iOS Bundle ID and iPhone/iPad App Store ID (You can find this info on your App page at iTunes connect).

Canvas URL is used to redirect your friend if he reviews the request from Web-site iOS Bundle ID and iPhone/iPad App Store ID are used to redirect your friend to App Store if he reviews the request from Native iOS App.

Whelp answered 16/12, 2011 at 10:26 Comment(2)
I think the better option is rather than setting 'App on Facebook', selecting 'Website with Facebook Login'. This way you can supply any url, such as your app website. When I supplied my app website using Canvas URL, facebook was giving errors. Possibly something to do with my website but none the less I think this way is less hassle and cleaner. Notifications do work this way too.Gulledge
@SebKade I can't seem to get that to work with only Website with Facebook Login. The request will show up in the app center but not in the user actual notifications. This might be due to Facebook changing the way it works. Please correct me if I'm wrong.Rexanne

© 2022 - 2024 — McMap. All rights reserved.