Alessandro
Alessandro

Reputation: 4100

Facebook send message through iOS

I am using this code to send a message:

//send message
     NSString *friendList = @"1372394537";
     NSMutableDictionary* params =
     [NSMutableDictionary dictionaryWithObjectsAndKeys:
      @"Check this out.",  @"message",
      friendList, @"suggestions",
      nil];

     [self.facebook dialog:@"apprequests"
                 andParams:params
               andDelegate:self];
     //send message

My app logs in with facebook, shows a friend list, and then adds the Friend's ID's in the friendList, but they receive no message!! Why??

Upvotes: 0

Views: 993

Answers (1)

Lix
Lix

Reputation: 47956

What you are sending is a request and not a message. There is a big difference.

The message you are talking about is simply a parameter that you can pass along with the request.

The most frequent problem that I see people dealing with when requests do not arrive is that the application is set to sandbox mode. If the application is in sandbox mode, only users listed in the "roles" section within your application will be able to receive the requests (admins, developers, testers...).

One other thing that could be at work here is that the canvas URL is not set for your application. When users act on requests they are sent to the application's canvas URL. When you don't set that value there is no place for the request to send the user so the request is nullified and doesn't reach the user.

So two things for you to try -

  1. Remove your application from sandbox mode.
  2. Make sure that you have set the canvas URL property for your application.

Upvotes: 1

Related Questions