• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [SOLVED] Open my Application via safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SOLVED] Open my Application via safari


  • Subject: Re: [SOLVED] Open my Application via safari
  • From: Yorh <email@hidden>
  • Date: Thu, 2 Nov 2006 19:23:08 +0100

Ok guys,

I solved with the following tip ...
I have a last question... now my app is launched but if I open my com.Apple.LauncheServices.plist I cannot find my app custom URL....
Why??


Thank you all!
Yorh

On Nov 2, 2006, at 6:57 PM, Shawn Erickson wrote:

On 11/2/06, Yorh <email@hidden> wrote:
Hi to all,

Does anyone is able to send me a very basic example (an empty
project), with this function?
I will try on my mac ...

The following works for me... all I need to do after building the application is run it once by double clicking it (developer only issue since user copying it onto their systems should trigger automatic registration). Then I can type Foo://blah/blah/blah and my application gets launched and can display the URL.

(working on an example project that I can provide to the public...)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>English</string>
	<key>CFBundleDocumentTypes</key>
	<array/>
	<key>CFBundleExecutable</key>
	<string>Foo</string>
	<key>CFBundleIconFile</key>
	<string>AppIcon</string>
	<key>CFBundleIdentifier</key>
	<string>com.bar.foo</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1</string>
	<key>NSMainNibFile</key>
	<string>MainMenu</string>
	<key>NSPrincipalClass</key>
	<string>NSApplication</string>
	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleURLIconFile</key>
			<string>URLIcon</string>
			<key>CFBundleURLName</key>
			<string>Foo URL</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>Foo</string>
			</array>
		</dict>
	</array>
</dict>
</plist>

Then in my app delgate...

- (void)applicationWillFinishLaunching:(NSNotification *)aNotification
{
	NSAppleEventManager *appleEventManager = [NSAppleEventManager
sharedAppleEventManager];

	// Get URL Apple Event ('GURL') is part of the internet AE suite not
the standard AE suite and
	// it isn't currently supported directly via a application delegate
method so we have to register
	// an AE event handler for it.
	[appleEventManager setEventHandler:self
						   andSelector:@selector(handleGetURLEvent:withReplyEvent:)
						 forEventClass:'GURL'
							andEventID:'GURL'];
}

- (void)handleGetURLEvent:(NSAppleEventDescriptor *)event
withReplyEvent:(NSAppleEventDescriptor *)replyEvent
{
NSLog(@"GURL = %@", event);

NSAppleEventDescriptor* urlDescriptor = [event
descriptorForKeyword:keyDirectObject];
[self doSomethingWithURL:[NSURL URLWithString:[urlDescriptor stringValue]]];
}


-Shawn

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Re: [SOLVED] Open my Application via safari
      • From: "Shawn Erickson" <email@hidden>
References: 
 >Re: Open my Application via safari (From: Yorh <email@hidden>)
 >Re: Open my Application via safari (From: Mike Abdullah <email@hidden>)
 >Re: Open my Application via safari (From: Yorh <email@hidden>)
 >Re: Open my Application via safari (From: Yorh <email@hidden>)
 >Re: Open my Application via safari (From: Shawn Erickson <email@hidden>)
 >Re: Open my Application via safari (From: Yorh <email@hidden>)
 >Re: Open my Application via safari (From: Sherm Pendley <email@hidden>)
 >Re: Open my Application via safari (From: Yorh <email@hidden>)
 >Re: Open my Application via safari (From: Yorh <email@hidden>)
 >Re: Re: Open my Application via safari (From: "Shawn Erickson" <email@hidden>)

  • Prev by Date: Re: Re: Re: Open my Application via safari
  • Next by Date: Re: Re: Open my Application via safari
  • Previous by thread: Re: Re: Open my Application via safari
  • Next by thread: Re: Re: [SOLVED] Open my Application via safari
  • Index(es):
    • Date
    • Thread