iChat Theatre

  • Hi Folks,

    I've been trying to get a simple demo app running that uses iChat
    Theatre (InstantMessage.framework) as described in this web page
    without any success:

      http://developer.apple.com/leopard/overview/imframework.html

    Here's the code:

    //
    //  MyController.m
    //  iChatDemo
    //
    //  Created by Mark Alldritt on 27/02/08.
    //  Copyright 2008 __MyCompanyName__. All rights reserved.
    //

    #import "MyController.h"
    #import <InstantMessage/IMAVManager.h>
    #import <InstantMessage/IMService.h>

    @implementation MyController

    - (void) _handleStateChanged:(NSNotification*) notification
    {
    NSLog(@"_handleStateChanged: %@", notification);

    IMAVManager *manager = [IMAVManager sharedAVManager];

    switch ([manager state])
    {
    case IMAVRequested:
      [manager start];
      break;
    }
    }

    - (void) _handleURLToShareChanged:(NSNotification*) notification
    {
    NSLog(@"_handleURLToShareChanged: %@ (%@)", notification,
    [[IMAVManager sharedAVManager] URLToShare]);
    }

    - (void) awakeFromNib
    {
    IMAVManager *manager = [IMAVManager sharedAVManager];
    [manager setVideoDataSource:miChatView];

    // Register for iChat Theater notifications
    [[IMService notificationCenter] addObserver:self
          selector:@selector(_handleStateChanged:)
        name:IMAVManagerStateChangedNotification
        object:nil];
    [[IMService notificationCenter] addObserver:self
        selector:@selector(_handleURLToShareChanged:)
        name:IMAVManagerURLToShareChangedNotification
        object:nil];
    }

    @end

    miChatView is an NSImageView displaying a picture that I want to show
    through iChat Theatre.  I never receive
    IMAVManagerStateChangedNotification notifications when I try and share
    my application file through the iChat app.  My demo project is based
    on the Cocoa Application template, so there is no notion of a document.

    Can anyone tell me what I might be doing wrong?

    Thanks
    -Mark
  • On Feb 27, 2008, at 7:47 PM, Mark Alldritt wrote:

    > I never receive IMAVManagerStateChangedNotification notifications
    > when I try and share my application file through the iChat app.  My
    > demo project is based on the Cocoa Application template, so there is
    > no notion of a document.
    >
    > Can anyone tell me what I might be doing wrong?

    Hello Mark,

    Perhaps this is your problem:

    <http://www.cocoabuilder.com/archive/message/cocoa/2008/2/8/198326>

    You wouldn't be the first one to bump into that...

    Cheers,

    j o a r
  • Hi Mark,

    On Feb 27, 2008, at 12:47 PM, Mark Alldritt wrote:

    > Can anyone tell me what I might be doing wrong?

    It took me awhile to make this work in my app, so perhaps I can save
    you some blood. Sweat and tears I can't help you with.

    While your app is running, if you drag it onto an active video chat,
    does it give you an option to share it?

    That option should look like this...

    http://www.conjurebunny.com/Welcome_files/droppedImage_11.jpg

    And when you drag it there, what happens next?

    -Chilton
  • Hi,

    On 27-Feb-08, at 11:32 AM, infinite labs wrote:

    > On Wed, Feb 27, 2008 at 7:47 PM, Mark Alldritt <alldritt...>
    >> wrote:
    >> Hi Folks,
    >>
    >> I've been trying to get a simple demo app running that uses iChat
    >> Theatre (InstantMessage.framework) as described in this web page
    >> without any success:
    >>
    >> http://developer.apple.com/leopard/overview/imframework.html
    >>
    >
    > You have set up Info.plist, have you? This is uber-important and only
    > noted in <http://developer.apple.com/documentation/AppleApplications/Conceptual/Insta
    ntMessageProgGuide/Articles/UsingLaunchServices.html#//apple_ref/doc/uid/TP
    40006595
    > >,
    > where it already has been missed by more than a developer.

    Thanks for this pointer.  This was in fact the problem.  For those
    that care, you need to add a LSCanProvideIMVideoDataSource key to the
    app's Property List with a value of <true/> in order for iChat to
    properly recognize the application.

    Thanks for the help!

    Cheers
    -Mark

    ------------------------------------------------------------------
    Mark Alldritt                            Late Night Software Ltd.
    Phone: 250-380-1725                      333 Moss Street
    Fax:  250-383-3204                      Victoria, B.C.
    Web:  http://www.latenightsw.com/        CANADA  V8V-4M9