Integrating Glassfy using WatcherMode

This guide shows you how to integrate subscriptions and in-app purchases in your app with a pre-existing monetization solution (typically StoreKit, Google Play Billing SDK): It does not require any changes to purchase code and its integration is achievable with minimal effort get access to the following set of features.

FeatureWatcherModeFull Integration
Analytics👍👍
Connectors👍👍
Webhooks & Triggers👍👍
Glassfy Functions👍👍
Receipt Validation👍👍
Universal Codes👍
Offering👍
Permissions👍
Paywalls👍

1. Store Configuration

Configure the stores you use by following our guides:

2. Configure SKUs

The SKU is the Glassfy unique identifier to link a product to an App Store.

  1. Create and configure your in-app purchases and subscriptions in App Store Connect, Play Store or Paddle Store
  2. Once your products are created create SKUs in Glassfy

3. Install SDK

4. Initialize the SDK

Copy your APIKEY from Glassfy Dashboard Setting -> General and use it to initialize the SDK.

Be sure to enable watcherMode as in the following code:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

  Glassfy.initialize(apiKey: "YOUR_API_KEY", watcherMode: true)

}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  [Glassfy initializeWithAPIKey:@"YOU_API_KEY" watcherMode:YES];
}
class App : Application() {
  override fun onCreate() {
    super.onCreate()
    
    Glassfy.initialize(this, "YOUR_API_KEY", true, null)
  }
}
public class App extends Application {
  @Override
  public void onCreate() {
    super.onCreate();
    Glassfy.initialize(this, "YOUR_API_KEY", true, null);
  }
}
try {

  await Glassfy.initialize('YOU_API_KEY',watcherMode: true);

} catch (e) {
  // error
  [...]
}
try {

  await Glassfy.initialize('YOU_API_KEY', true);

} catch (e) {
  // initialization error
}
try {

  await Glassfy.initialize('YOU_API_KEY', true);

} catch (e) {
  // initialization error
}

Integration complete

You have completed the integration of Glassfy in your app and you can start testing your application in sandbox mode.

To release the app on the App Store or Play Store upload it to the app on AppStoreConnect or Google Play.

🚧

App Store

To test the purchases in sandbox mode and to release the app you must be sure to have accepted all the contracts on AppStoreConnect.