Using the App Service lifecycle event, you can launch and deep-link Kony native applications from any third-party native application and browser application. This feature allows better integration of Kony applications (all native and hybrid applications) with other native and browser-based applications. The App Service event is available on all platforms.
An App Service event is characterized by the following:
launchParams
, then the snippet must be defined as:return launchParams(params);
Note: If both Post Appinit and App Service events return the form handle, the platforms give more priority to the form returned by the App Service event. If both App Service and Postappinit return a null value, the showstartupform event is called.
form.show
within the App Service event.To create an App Service event, do the following:
The following is an example of an App Service event.
function launchParams(params) { //The line below displays how an application is launched: Normal, Push, URL kony.print("*************** params is: "+params); for (var key in params) { kony.print("**********"+params[key]); } kony.print("*************** launch mode is: " + params.launchmode); if(params.launchmode == 1) { labelText = "You have launched this native app from the device."; segData = null; frmMain.segParam.removeAll (); return frmIntro; }else if(params.launchmode == 3){ labelText = "You have launched this kony native app from a third party app."; //Displays the launchparams. The Launchparams table is a table with key value pairs specific to the applications needs; kony.print("*************** launch params are: " + params. launchparams); if(params.launchparams != null){ segData = [ ]; for ( k in params.launchparams ){ var v = params.launchparams[ kony.decrement( k ) ]; kony.print("key:" + k + "value:" + v); kony.table.insert(segData, { lblkey : "" + k + " :", lblval : "" + v } ); } labelText = labelText + "The Parameters are:"; }else{ kony.print("*************** launchparams is nil"); } return frmMain; } return frmIntro; }
The application path in the URL for iPhone and Android is defined by the URL scheme. For more information, see Set App Lifecycle Events and Native Application Properties.
For Windows 7.5, you can launch and deep-link Kony native applications from any third-party native application and browser application using Cards. Unlike other applications, deep-linking in Windows 7.5 opens an application from a Bing Browser. For more information about setting cards, see Windows Manifest File. You can also deep-link applications using secondary tiles.
For Windows 8 deep-linking occurs solely through secondary tiles using a code like the snippet below.
function onPostappInitDl(params) { kony.print("post app init"); kony.print(params); if(params.launchMode == 2) { var x = params.launchParams; if(x.tileId == "myTile1") { return form2; } } };
For more information on setting secondary tiles, see the Kony Visualizer API Developer's Guide.
Copyright © 2013 Kony, Inc. All rights reserved. |