Closed KeyideasGlobal closed 10 years ago
Thank u,
but Im + is similar like Chat secure and its live in background , can you give me any idea how this happened.
@KeyideasGlobal IM+ relies on their own server which stores your account data and send your private messages to Apple Push service. Do you want to rename ChatSecure to ChatInsecure? :)
Thank you can you tell me process of push notification in jabber/xmpp . i know about simple push notification service
Thanks mahendra
how we stop its disconnect process when app go to background . can u tell me what is the exact function within which class who is responsible for disconnection and again connection if u.
Thanks in Adv mahendra
Hi i want to get all registered user i got a function like
(void)getAllRegisteredUsers {
NSError error = [[NSError alloc] init];
NSXMLElement query = [[NSXMLElement alloc] initWithXMLString:@"
(BOOL)xmppStream:(XMPPStream )sender didReceiveIQ:(XMPPIQ )iq { NSXMLElement *queryElement = [iq elementForName: @"query" xmlns: @"http://jabber.org/protocol/disco#items"];
if (queryElement) { NSArray itemElements = [queryElement elementsForName: @"item"]; NSMutableArray mArray = [[NSMutableArray alloc] init]; for (int i=0; i<[itemElements count]; i++) {
NSString *jid=[[[itemElements objectAtIndex:i] attributeForName:@"jid"] stringValue];
[mArray addObject:jid];
}
} }
but i don't know which xml class have this function . in my xmpp framework library haven't this function how can i got all register user list within a perticular domain. plz help me
Thanks Mahendra
In file OTRAppDelegate.m go to function: - (void) timerUpdate:(NSTimer)timer
comment this fragment:
// if ([application backgroundTimeRemaining] < 10)
// {
// // Clean up here
// [self.backgroundTimer invalidate];
// self.backgroundTimer = nil;
//
// OTRProtocolManager protocolManager = [OTRProtocolManager sharedInstance];
// for(id key in protocolManager.protocolManagers)
// {
// id
//
// [application endBackgroundTask:self.backgroundTask];
// self.backgroundTask = UIBackgroundTaskInvalid;
// }
Thanks for reply i think its helpful for me and above query to get all registered user i use xmpp 0055 framework its running get. i will try your code.
Thanks a lot Mahendra
Hi, could you tell me which xmpp api give us buddy list and all friends(buddy in formation like picture/display name/ etc) in iOS app.
Thanks Mahendra Pratap Singh.
this is an example of buddy list in some view controllers, you can use it to fetch all contacts. (this is example in OTRBuddyListViewController) , you can use this code in the other viewController when you want to get contact list. -(NSFetchedResultsController *)buddyFetchedResultsController{ if (_buddyFetchedResultsController) { return _buddyFetchedResultsController; }
NSPredicate * buddyFilter = [NSPredicate predicateWithFormat:@"accountName != nil OR displayName != nil"];
_buddyFetchedResultsController = [OTRManagedBuddy MR_fetchAllGroupedBy:nil withPredicate:buddyFilter sortedBy:@"currentStatus,displayName" ascending:YES delegate:self];
return _buddyFetchedResultsController;
}
Hi , thanks for reply, i have another problem could you tell me how filter in online friend section which have unread message top then alphabetical sorting in section.
-(NSFetchedResultsController ) onlineBuddiesFetchedResultsController { if(_onlineBuddiesFetchedResultsController) { return _onlineBuddiesFetchedResultsController; } //roxie//comented_for_showing_online_user_too NSPredicate * onlineBuddyFilter = [NSPredicate predicateWithFormat:@"%K == %d",OTRManagedBuddyAttributes.currentStatus,OTRBuddyStatusAvailable]; //end// NSPredicate * selfBuddyFilter = [NSPredicate predicateWithFormat:@"accountName != account.username"]; NSPredicate * compoundPredicate = [NSCompoundPredicate andPredicateWithSubpredicates:@[onlineBuddyFilter, selfBuddyFilter]]; NSString \ sortByString = [NSString stringWithFormat:@"%@",OTRManagedBuddyAttributes.accountName]; _onlineBuddiesFetchedResultsController = [OTRManagedBuddy MR_fetchAllGroupedBy:nil withPredicate:compoundPredicate sortedBy:sortByString ascending:YES delegate:self];
// NSMutableArray arr=[[NSMutableArray alloc]initWithArray:[_onlineBuddiesFetchedResultsController fetchedObjects]];
//
// NSLog(@"fetchedObjects] %@",[_onlineBuddiesFetchedResultsController fetchedObjects]);
// for (int i=0; i<[arr count]; i++) {
// OTRManagedBuddy buddy =[arr objectAtIndex:i];
// if ([buddy numberOfUnreadMessages]>1) {
// [arr removeObjectAtIndex:i];
// [arr insertObject:buddy atIndex:0];
// }
// }
//
// _onlineBuddiesFetchedResultsController=nil;
// _onlineBuddiesFetchedResultsController=(NSFetchedResultsController *)arr;
// for (int i=0; i<[[_onlineBuddiesFetchedResultsController fetchedObjects] count]; i++) {
//
// OTRManagedBuddy *buddy =[[_onlineBuddiesFetchedResultsController fetchedObjects] objectAtIndex:i];
// if ([buddy numberOfUnreadMessages]>1) {
// NSLog(@"BUDDY....%@",buddy.accountName);
// // [[_onlineBuddiesFetchedResultsController fetchedObjects] delete:buddy];
// // [[_onlineBuddiesFetchedResultsController fetchedObjects] d//insertObject:buddy atIndex:0];
// }
// }
return _onlineBuddiesFetchedResultsController;
}
Plz help me shorting this out.
Thanks Mahendra
Please keep discussion of each topic in a separate issue
When app go to background after some time its disconnect how we prevent this.
thanks in Adv mahendra