From 9bd770dc89f72b930f3b0d8c22fc10b0380c285a Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Tue, 8 Jul 2014 10:27:57 -0300 Subject: [PATCH] Update TODO.md --- TODO.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/TODO.md b/TODO.md index bb62c9d4f..209b292e1 100644 --- a/TODO.md +++ b/TODO.md @@ -56,3 +56,34 @@ To install the APK in your device run: ``` adb install -r Copay_VERSION_arm.apk ``` + + +# Development + +## Native Shell + +To add features that enhance the native experience of Copay, first follow the +directions above under "Running in the Native Shell". It's important to ensure +that functionality within this context should either hook into existing features +or supplement the experience of those features. Copay should continue to operate +full-featured from within a modern web browser. + +Shell functionality works by sending and receiving messages between the Copay +application and the shell wrapper. Native functionality should be handled mostly +from within `shell/lib/message-handler.js`, which receives messages conditionally +from the front-end Angular controllers. + +Look at `js/shell.js` to see how we determine if Copay is running from within the +native shell context. If we are running within the shell, Copay has access to the +global variable `window.cshell`, which provides access to the messenger. For +instance, to Copay might want to use a native dialog alert in favor of a regular +one if running in this context. You would do this like so: + +```js +if (window.cshell) { + window.cshell.send('alert', 'info', 'Please select a wallet.'); +} +else { + window.alert('Please select a wallet.'); +} +```