handleOpenURL not called using a custom url schema in iPhone OS

Posted by favo on Stack Overflow See other posts from Stack Overflow or by favo
Published on 2010-06-02T20:13:29Z Indexed on 2010/06/02 20:44 UTC
Read the original article Hit count: 465

Filed under:
|
|
|

Hi,

I have successfuly added my own url schemes to my App. The App correctly launches using the schemes.

Now I want to handle the incoming data but the delegate is not called. It is an universal app and I have added the following function to both AppDelegates:

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    if (!url) {  return NO; }

    NSString *URLString = [url absoluteString];
    UIAlertView *alert = [[UIAlertView alloc] 
                          initWithTitle:NSLocalizedString(@"test message", nil) 
                          message:URLString
                          delegate:self 
                          cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
    [alert show];     
    [alert release];
    return YES;
}

I am testing with a schema like: myapp://appalarm.com …and would expect to be appalarm.com in the URLString

What is wrong with it?

Thanks for your responses!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c