This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
web-integration:client-side [2019/08/05 12:41] tjotov [UI methods] |
web-integration:client-side [2020/02/29 10:53] (current) mpospisek [Web Integration API - Example] |
||
|---|---|---|---|
| Line 52: | Line 52: | ||
| ===== Web Integration API - Example ===== | ===== Web Integration API - Example ===== | ||
| - | <code html> | + | <sxh html> |
| <html xmlns=" | <html xmlns=" | ||
| Line 122: | Line 122: | ||
| </ | </ | ||
| - | </code> | + | </sxh> |
| Line 161: | Line 161: | ||
| </ | </ | ||
| - | === Redirect URL for iOS typically provided | + | === Redirect URL set by GUI === |
| + | This is usuallly set by server side but can be also managed from client side. Server side has higher priority. | ||
| <sxh java> | <sxh java> | ||
| aducid.setRedirectUrl = function(param) { | aducid.setRedirectUrl = function(param) { | ||
| Line 168: | Line 169: | ||
| </ | </ | ||
| + | === Error redirect URL set by GUI === | ||
| + | This is usuallly set by server side but can be also managed from client side. Server side has higher priority. | ||
| + | <sxh java> | ||
| + | aducid.setErrorPage = function(param) { | ||
| + | errorPage = param; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | === Final action === | ||
| + | What API should do when operation finishes (not processed on iOS as we use returnUrl directly there) | ||
| + | <sxh java> | ||
| + | aducid.processResult = function(result) { | ||
| + | alert(result); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | === Use push === | ||
| + | Tell Web API if it should use push (QR code was used previously). | ||
| + | <sxh java> | ||
| + | this.setPush = function(param) { | ||
| + | push = param == true; | ||
| + | } | ||
| + | </ | ||
| ==== UI methods ==== | ==== UI methods ==== | ||
| === Tell server to generate QR / or not to reduce payload === | === Tell server to generate QR / or not to reduce payload === | ||
| Line 226: | Line 250: | ||
| } | } | ||
| </ | </ | ||
| + | === Auxiliary method to animate operation in progress === | ||
| + | <sxh java> | ||
| + | aducid.startAnimation = function() { | ||
| + | if (qrCode != null) { | ||
| + | qrCode.show(); | ||
| + | qrCode.attr(" | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | === Stop animation === | ||
| + | <sxh java> | ||
| + | aducid.stopRunningAnimation = function() { | ||
| + | if (qrCode == null) return; | ||
| + | qrCode.hide(); | ||
| + | } | ||
| + | </ | ||
| ==== Advanced methods ==== | ==== Advanced methods ==== | ||
| === Init Params === | === Init Params === | ||
| Line 267: | Line 307: | ||
| aducid.getSessionBinding = function() { | aducid.getSessionBinding = function() { | ||
| return localStorage[' | return localStorage[' | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | === The most important method === | ||
| - | What API should do when operation finishes (not processed on iOS as we use returnUrl directly there) | ||
| - | <sxh java> | ||
| - | aducid.processResult = function(result) { | ||
| - | alert(result); | ||
| } | } | ||
| </ | </ | ||
| Line 284: | Line 314: | ||
| aducid.showPeigError = function() { | aducid.showPeigError = function() { | ||
| alert(" | alert(" | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | === Auxiliary method to animate operation in progress === | ||
| - | <sxh java> | ||
| - | aducid.startAnimation = function() { | ||
| - | if (qrCode != null) { | ||
| - | qrCode.show(); | ||
| - | qrCode.attr(" | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | | ||
| - | === Stop animation === | ||
| - | <sxh java> | ||
| - | aducid.stopRunningAnimation = function() { | ||
| - | if (qrCode == null) return; | ||
| - | qrCode.hide(); | ||
| } | } | ||
| </ | </ | ||