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

  • SEARCH
  • Home
  • 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 8089187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:19:43+00:00 2026-06-05T19:19:43+00:00

Im developing an app for iPhone, in wich one of the functionalities is an

  • 0

Im developing an app for iPhone, in wich one of the functionalities is an instant message system, using XMPPFramework. By now, im testing it with Google Talk. The delegate is the same class that manages the User Interface. So, I got this code:

In viewDidLoad:

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setupStream];
}

The setupStream method:

- (void) setupStream
{
    NSLog(@"Inside setupStream");
    xmppStream = [[XMPPStream alloc] init];
    [xmppStream addDelegate:self delegateQueue:dispatch_get_main_queue()];
    [self connect];
}

The connect method:

- (BOOL) connect
{
    NSLog(@"Inside connect method");


    General *general = [General sharedManager];//this is a singleton to manage settings for every user
    NSString *chatid;
    NSString *chatpass;

    //chatid=[general user];
    chatid=@"somegmailaccount@gmail.com";
    xmppStream.myJID=[XMPPJID jidWithString:chatid];

    if (![xmppStream isDisconnected]) {
        return YES;
    }

    NSError *error = nil;
    if (![xmppStream connect:&error])
    {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error"
            message:[NSString stringWithFormat:@"Can't connect to server %@", [error localizedDescription]]
            delegate:nil
            cancelButtonTitle:@"Ok"
            otherButtonTitles:nil];
        [alertView show];

        return NO;
    }

    return YES;
}

In xmppStreamDidConnect method:

- (void) xmppStreamDidConnect:(XMPPStream *)sender
{
    [xmppStream authenticateWithPassword:@"password" error:NULL];
    [self goOnline];
}

And goOnline method:

- (void) goOnline
{
    XMPPPresence *presence = [XMPPPresence presence];
    [[self xmppStream] sendElement:presence];
    NSLog(@"Presence sent");
}

With this, the presence is not sent. I have another google account that I try for testing (say, testing@gmail.com) and in this account the presence of somegmailaccount.gmail.com is not seen. Both accounts are connected and know each other, since I used this same accounts to develop the Android app.

Any idea about what i´m doing wrong? Any help is appreciated.

Thank you very much.

  • 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-06-05T19:19:44+00:00Added an answer on June 5, 2026 at 7:19 pm

    I found it! The presence is not sent this way:

    XMPPPresence *presence = [XMPPPresence presence];
    [[self xmppStream] sendElement:presence];
    

    Insted, i have done it this way:

    NSXMLElement *presence = [NSXMLElement elementWithName:@"presence"];
    [xmppStream sendElement:presence];
    

    This way, the presence is sent without any problem 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an iPhone app than uses the Google apps API. I'm fetching all
I am developing an iphone app and using facebook graph API. I need to
I'm developing an iPhone app with latest SDK and XCode 4.2 I'm using this
I am developing an app for iPhone/iPad using Objective C. In my app I
Im developing an iPhone app that has an groupchat. Im using the XMPP framework.
I am developing an app in iPhone I am using an NSRange object in
I am developing an app for iPhone using iOS5 and xcode 4.2. The scenario
I'm now developing an app on iPhone OS with core data, but when I
Current developing an iPhone app using jQuery mobile, everything is looking great however when
I am developing an iPhone app which requires charts. Hence I am using API

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.