io.trialy.library

Class Trialy

  • public class Trialy
    extends java.lang.Object
    Client library for trial license verification.

    The library is configured via the host app using an app key (can be found on your developer dashboard). The library determines whether a user should have access to the locked content. A hard-coded policy defines a threshold for allowable number of server or client failures before the library reports the user as not having access.

    • Constructor Summary

      Constructor and Description
      Trialy(android.content.Context context, java.lang.String appKey) 
    • Method Summary

      Modifier and Type Method and Description
      void checkTrial(java.lang.String sku, TrialyCallback callback)
      Checks if the user should have access to the specified trial SKU
      void clearLocalCache()
      Clears the local cache (useful when testing your app)
      static java.lang.String getStatusMessage(int status)
      Provides a human-readable log message for each API status
      void recordConversion(java.lang.String sku, TrialyCallback callback)
      Records a "purchased IAP" conversion event.
      void startTrial(java.lang.String sku, TrialyCallback callback)
      Starts a trial for the specified trial SKU
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Trialy

        public Trialy(android.content.Context context, java.lang.String appKey)
        Parameters:
        context - Your activity's Context
        appKey - Your app key; can be found on your Trialy developer dashboard
    • Method Detail

      • checkTrial

        public void checkTrial(java.lang.String sku, TrialyCallback callback)
        Checks if the user should have access to the specified trial SKU
        Parameters:
        sku - The trial SKU as defined in your developer dashboard (should match the IAP SKU)
        callback - A callback implemented by your activity to deal with the trial status response (e.g. trial running, trial expired, etc.)
      • startTrial

        public void startTrial(java.lang.String sku, TrialyCallback callback)
        Starts a trial for the specified trial SKU
        Parameters:
        sku - The trial SKU as defined in your developer dashboard (should match the IAP SKU)
        callback - A callback implemented by your activity to deal with the API response (e.g. trial started, trial already running, etc.)
      • recordConversion

        public void recordConversion(java.lang.String sku, TrialyCallback callback)
        Records a "purchased IAP" conversion event. Call this function if the user purchases an IAP. Only necessary if you want to use the analytics features provided by Trialy.
        Parameters:
        sku - The trial SKU as defined in your developer dashboard (should match the IAP SKU)
        callback - A callback implemented by your activity to deal with the API response (e.g. conversion recorded)
      • clearLocalCache

        public void clearLocalCache()
        Clears the local cache (useful when testing your app)
      • getStatusMessage

        public static java.lang.String getStatusMessage(int status)
        Provides a human-readable log message for each API status
        Parameters:
        status - The status int returned by the API