Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 791213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:48:01+00:00 2026-05-14T21:48:01+00:00

I am developing an iPhone application that will send sms the logged in user

  • 0

I am developing an iPhone application that will send sms the logged in user friends’. I am using FacebookConnect for the same. The problem is I am getting the uid of all friends but what is the way to send SMS to these uids(friends UID).

Thanks,
UPT


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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T21:48:01+00:00Added an answer on May 14, 2026 at 9:48 pm

    First you will need to check whether the user can send SMS-s and if you are allowed to:

    http://developers.facebook.com/docs/reference/rest/sms.canSend

    To ask extended permissions you’ll call something like this (http://developers.facebook.com/docs/reference/fql/permissions)

    FBPermissionDialog* dialog = [[[FBPermissionDialog alloc] init] autorelease];
    dialog.delegate = self;
    dialog.permission = @"sms";
    [dialog show];
    

    If user has enabled SMS for your application you can send an SMS using

    http://developers.facebook.com/docs/reference/rest/sms.send

    NSDictionary* params = [NSDictionary dictionaryWithObjects:@"1234", @"uid", @"hellow world", @"message", nil];
    [[FBRequest requestWithDelegate:self] call:@"facebook.sms.send" params:params];
    

    For examples how to call Facebook API methods through iPhone go here: http://github.com/facebook/facebook-iphone-sdk/#readme

    Editing my post to also answer to additional question poster posted as an answer

    Your mistake is here, you are trying to compare strings using == operator.

    if (@"facebook.friends.get" == request.method) 
    

    this compares the addresses of two strings. To compare if the string contents are equal you should use isEqualToString method:

    if([@"facebook.friends.get" isEqualToString:request.method]) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 453k
  • Answers 453k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need to choose a utf8_* character set for your… May 15, 2026 at 9:31 pm
  • Editorial Team
    Editorial Team added an answer Since you calculate the current age from the birthdate, I… May 15, 2026 at 9:31 pm
  • Editorial Team
    Editorial Team added an answer you dont need to use the master system. But if… May 15, 2026 at 9:31 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.