Call "MyCustomFunction" from App Code

  • To add this to the Json code so the Loyalty App can use the function, open the Loyalty solution:

    Loyalty\Android\LSRetail.Mobile.Loyalty.Android.sln

App code blocks

  • Loyalty App code uses same Core as Commerce Service.
  • Commons Data Objects are located in the Domain folder.
  • The Infrastructure folder includes code to talk to the Commerce Service Json interface and the Local App Database.
  • Presentation.Android has the main App code.

Note: This article does not describe in detail how to do the App coding, only where you would add the new function that you created in Commerce Service and how to call it.

The new functions go into the Services library, which has Interface and Service code that the app uses to call the new function.

First, add the function to the Interface:

Service code has two versions of the function, one for direct call and the other to call in Async mode, which the App should usually use when calling the function:

Infrastructure then does the actual call to Commerce Service Json Interface:

In the Presentation code, you would call the new function like this: