[TIMOB-14] iPhone define custom url handlers
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-04-15T02:22:29.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.2.0 |
Components | iOS |
Labels | custom, feature, ios, iphone, url |
Reporter | Thomas Aylott |
Assignee | Reggie Seagraves |
Created | 2011-04-15T02:22:27.000+0000 |
Updated | 2017-03-02T18:21:57.000+0000 |
Description
Please make some way to define custom url handlers for the iphone.
thanks.
It's certainly possible. By Url handlers, I assume you mean, "Launch my app when someone tries to go to foo://bar...". One half would be adding an entry to tiapp.xml, an array of schemes that the app can handle.
The other half would be some way to relay to the Javascript the custom url that launched the app. There's a number of ways it could be done, but probably the most sensible way would to be to expose it as if the app was launched with the url as a command line argument.
bq. as if the app was launched with the url as a command line argument
I love it.
Currently it is possible to define a Custom URL editing the info.plist file and adding the proper fields.
But one thing even more interesting related to Custom URLs would be to be able to retrieve data that you pass to the app with Query Strings. LIke this:
open Safari and fire my App Custom URL: myapp://?foo="bar"
Current, there is no way to retrieve this variable foo from the browser in the App.
you can already do this. take a look at the Info.plist for Kitchen Sink project.
You can also retrieve the values from the Titanium.App.getArguments() method call. Returns a dictionary of the values the app was launched with.
hi Jhaynie,
Thanks, just found the app_data.js and understood how it works. Thanks.
Closing as invalid.