2

In the app delegate, there is this method

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

I am wondering what the "annotation" is? Also, how would I use it/view it to see what it contains?

Thanks

evenodd
  • 2,026
  • 4
  • 26
  • 38

2 Answers2

1

annotation: A property-list object supplied by the source application to communicate information to the receiving application.

It is what the application that triggered the url opening wants to share with you.

UIApplicationDelegate apple documentation

mrosales
  • 1,543
  • 11
  • 18
  • 1
    Right, I saw that, but I don't understand what sort of things would be in the property-list. And how would I view the data within a type (id)? – evenodd Jun 24 '13 at 17:40
  • http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/PropertyLists/AboutPropertyLists/AboutPropertyLists.html – mrosales Jun 24 '13 at 19:44
  • 1
    You really don't have much of an idea of what will be in it because it depends on who is sending it. I imagine that most will be empty, but it will probably have a value when a developer is trying to launch their app with a specific target action. – mrosales Jun 24 '13 at 19:45
  • For example, you could have a property list that specifies a sequence of views or messages to load inside your app or make it so the url could perform a specific action when you open it. Say you have a file browsing app and clicking on a link could make you launch the app and go directly to an "add file source" page or something like that. – mrosales Jun 24 '13 at 19:47
1

It is a dictionary. I have only found it useful for determining the referrer when opening deeplinks from mobile Safari:

enter image description here

parag
  • 937
  • 13
  • 11