Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 16, 2012, 12:31 AM   #1
saqibjaan
macrumors member
 
Join Date: Feb 2012
Location: Lahore
Send a message via Skype™ to saqibjaan
Skype Desktop API delegate methods doesn't get called on Mac OSX

I am trying to implement Skype Desktop API delegate methods on Mac OSX. But they didn't get called. My Skype version is 6.0.0.2946.

(void)skypeAttachResponse: & (void)skypeNotificationReceived: doesn't get
called.

Here is my code:



Code:
#import <Foundation/Foundation.h>
#import "SkypeController.h"


int main (int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    SkypeController *con = [[SkypeController alloc] init];
    
    [con applyCurrentState];
    
    sleep(1000);
    
    [con release];
        
    [pool drain];
    
    return 0;
}



@interface SkypeController : NSObject <SkypeAPIDelegate>
{
    NSString *clientApplicationName;
}


@property (nonatomic, retain) NSString *clientApplicationName;


-(void) applyCurrentState;

@end



#import "SkypeController.h"

NSString* const cMyApplicationName = @"Saqib Skype Tester";

@implementation SkypeController

@synthesize clientApplicationName;


-(id) init
{
    NSLog(@"In constructor");
    
    self = [super init];
    
    if (self != nil)
    {
        [SkypeAPI setSkypeDelegate:self];
    }
    
    NSLog(@"Exit from constructor");
    
    return self;
}



// required delegate method

- (NSString*)clientApplicationName
{
    NSLog(@"In clientApplicationName");
    
    return cMyApplicationName;
}



-(void) applyCurrentState
{
    NSLog(@"In applyCurrentState");
    
    if([SkypeAPI isSkypeRunning] && [SkypeAPI isSkypeAvailable])
    {
        NSLog(@"Going to connect");
        
        [SkypeAPI connect];
        
    }
    
    else
    {
        NSLog(@"Skype is not running or not available");
    }
    
}


- (void)skypeNotificationReceived:(NSString*)aNotificationString
{
    NSString *message = @"skypeNotificationReceived: ";
    NSLog(@"%@", [message stringByAppendingString:aNotificationString]);
    
}


- (void)skypeAttachResponse:(unsigned)aAttachResponseCode
{
    switch (aAttachResponseCode)
    {
        case 0:
            NSLog(@"Failed to connect");
            break;
        case 1:
            NSLog(@"Successfully connected to Skype!");
            break;
        default:
            NSLog(@"Unknown response from Skype");
            break;
    }
    
}


- (void)skypeBecameAvailable:(NSNotification*)aNotification
{
    
    NSString *message = @"skypeBecameAvailable: ";
    NSLog(@"%@", [message stringByAppendingString:[aNotification
                                                            name]]);
    
}




- (void)skypeBecameUnavailable:(NSNotification*)aNotification
{
    
    NSString *message = @"skypeBecameUnavailable: ";
    NSLog(@"%@", [message stringByAppendingString:[aNotification
                                                      name]]);
    
}

@end

Last edited by OllyW; Nov 16, 2012 at 01:19 AM.
saqibjaan is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Tags
mac osx 10.6, skypeapi

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:50 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC