Please have a look on the following code and I am not able to send the message to friends:
To get friends UID:
NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
// sessionView = session;
[[FBRequest requestWithDelegate:self] call:@"facebook.friends.get" params:params];
in delegate:
-(void)request:(FBRequest*)request didLoad:(id)result
//doing the following code:
if (@"facebook.friends.get" == request.method) {
NSArray* users = result;
myList =[[NSArray alloc] initWithArray: users];
for(NSInteger i=0;i<[users count];i++) {
NSDictionary* user = [users objectAtIndex:i];
NSString* uid = [user objectForKey:@"uid"];
// NSString* fql = [NSString stringWithFormat:
// @"select name from user where uid == %@", uid];
//NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
//[[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];
NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys:uid, @"uid", @"checkSMSCanSend", @"callback", nil];
[[FBRequest requestWithDelegate:self] call:@"facebook.sms.canSend" params:params];
}
and for SMS.canSend:
if (@"facebook.sms.canSend" == request.method) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"SMS" message:@"User can send SMS successfully." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
But this is not getting called.
Please help to SMS friends.