Linking to Your App
Users normally get your app by installing it from the gallery or because Yahoo! has preinstalled it for them. After that, if it's not a strictly contextual app (like the delicious sample), they launch it from the application list. If you'd like to direct users to your app from a website or within email, we provide a URL.
The URL is an app-specific entrypoint into Yahoo! Mail. If the user who clicks on the URL already has your app installed, Yahoo! Mail will launch your app. Otherwise, Yahoo! Mail will launch the gallery with your app highlighted so that the user can easily install it.
A Simple Link
The simplest link to your application will be of the
form: mrd.mail.yahoo.com/gallery?appId=<appid>, where
<appid> is replaced by your public appid. You can look up your
public appid with ymdt apps. This will launch the app
view that you have configured to
launch on the <click> event.
Linking to a Custom View
You can have your link launch a view other than that launched by your <click> event-handler by explictly defining a <url> event in your config.xml:
<?xml version="1.0"?> <openmail_app_config version="2"> <events> <url> <action> <launch> <view>landing.html</view> <target_zone>tab</target_zone> </launch> </action> </url> </events> </openmail_app_config>
<?xml version="1.0"?> <openmail_app_config version="2"> <events> <url> <action> <launch> <view>landing.html</view> <target_zone>tab</target_zone> </launch> </action> </url> </events> </openmail_app_config>
Passing Launch Parameters
You may add GET parameters to your URL. When your app is launched via a URL,
you can retrieve these parameters using
the
getParameters API. The parameter names and types must be declared in
your config.xml
For example, this URL would launch your app with name, id, and notes parameter:
mrd.mail.yahoo.com/gallery?appId=<appid>&name=Joe&id=999¬es=none
That URL and parameters would be available in your landing.hmtl view
if you have a config.xml like this:
<?xml version="1.0"?> <openmail_app_config version="2"> <events> <url> <action> <launch> <view>landing.html</view> <target_zone>tab</target_zone> <params> <param><name>name</name><type>text</type></param> <param><name>id</name><type>number</type></param> <param><name>notes</name><type>html</type></param> <params> </launch> </action> </url> </events> </openmail_app_config>
<?xml version="1.0"?> <openmail_app_config version="2"> <events> <url> <action> <launch> <view>landing.html</view> <target_zone>tab</target_zone> <params> <param><name>name</name><type>text</type></param> <param><name>id</name><type>number</type></param> <param><name>notes</name><type>html</type></param> <params> </launch> </action> </url> </events> </openmail_app_config>