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

Similar Threads
thread Thread Starter Forum Replies Last Post
New Apple Mac Trojan Called OSX/CoinThief Discovered BDM STUDIOS NL OS X Mavericks (10.9) 3 Feb 10, 2014 10:53 AM
Table View methods not called Spencie iPhone/iPad Programming 8 Mar 31, 2013 11:11 PM
UIScrollView delegate methods not called. zaxonus iPhone/iPad Programming 1 Jan 4, 2013 12:38 AM
Delegate Not Called On iPad When Using Popover ahan.tm iPhone/iPad Programming 16 Sep 22, 2012 02:48 PM

Forum Jump

All times are GMT -5. The time now is 06:49 PM.

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

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