You are here: Appendix D: The App Service Event

The App Service Event

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.

Characteristics of an App Service Event

An App Service event is characterized by the following:

Create an App Service Event

To create an App Service event, do the following:

  1. In Kony Visualizer, open the project for which you want to set action sequences for the app's lifecycle.
  2. From the Project tab of the Project Explorer, click either Mobile, Tablet, Desktop, or Watch. The Visualizer Canvas displays text indicating that you can define app life cycle events from the Properties Editor.
  3. On the App Events tab of the Properties Editor, click the Edit button that corresponds with the App Service event.
  4. Using the Action Editor, create the action sequences you want. For more information, see Add Actions.

App Service Event Example

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.