rizwankh / idoubs

Automatically exported from code.google.com/p/idoubs
0 stars 0 forks source link

Urgent: idoubs Presence issue on iOS 7.x #175

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, 

We have connected sip on App Delegate didFinishLaunchingWithOptions method
Sip has connected without any problem.
Audio/Video calls,Chat,Presence publish things are working fine.
Get the Presence is also working fine on iOS 6.x.
But get the Presence is not working on iOS 7.x
Call back method OnSubscriptionEvent is not calling properly on iOS 7.x.
Need help for resolve this issue.
We have to deliver our project as soon as possible.
Everything is ready Except this presence issue.
Please help us If anyone have this problem and overcome with this issue.

Really appreciate if someone can help me quickly.

I have used below code for get the Presence

I have added the below code on viewWillAppear method of ViewController
[[NSNotificationCenter defaultCenter]
     addObserver:self selector:@selector(OnSubscriptionEvent:) name:kNgnSubscriptionEventArgs_Name object:nil];

I have added subscribe call on viewWillAppear method of ViewController
[[NgnSubscriptionSession createOutgoingSessionWithStack:[NgnEngine 
sharedInstance].sipService.stack
                                                                                                    andToUri:strToUri
                                                                                                  andPackage:EventPackage_PresenceList]] subscribe];
I have added Call Back Method OnSubscriptionEvent on View Controller
-(void) OnSubscriptionEvent:(NSNotification*)notification
{
    @try {
        NgnSubscriptionEventArgs* eargs = [notification object];
        NSLog(@"************>OnSubscriptionEvent() on appDelegate");

        // only process the event if it's ours

        switch (eargs.eventType)
        {
            case INCOMING_NOTIFY:
            {
                NSLog(@"************>INCOMING_NOTIFY on appDelegate:%@",eargs.content);
                NSString *string = [[NSString alloc] initWithData:eargs.content encoding:NSUTF8StringEncoding];
                NSLog(@"************>string on appDelegate:%@",string);
                if(string.length == 0)
                {

                }else{
                    xmlParser = [[NSXMLParser alloc]initWithData:eargs.content];
                    xmlParser.delegate = self;
                    [xmlParser parse];
                }
                break;
            }

            case SUBSCRIPTION_OK:
            {
                NSLog(@"************>SUBSCRIPTION_OK on appDelegate");

                break;
            }
            case SUBSCRIPTION_NOK:
            {
                NSLog(@"************>SUBSCRIPTION_NOK on appDelegate");

                break;
            }

            case SUBSCRIPTION_INPROGRESS:
            {
                NSLog(@"************>SUBSCRIPTION_INPROGRESS on appDelegate");
                break;
            }
            default:
            case UNSUBSCRIPTION_OK:
            case UNSUBSCRIPTION_NOK:
            case UNSUBSCRIPTION_INPROGRESS:
            {
                NSLog(@"************>UNSUBSCRIPTION_OK on appDelegate");

                break;
            }
        }

    }
    @catch (NSException *exception) {
        [Controller displayAlert:[NSString stringWithFormat:@"Error:%@",exception]];
    }

}

Original issue reported on code.google.com by jo.koth...@gmail.com on 29 Apr 2014 at 6:25