# initialize

open fun initialize(activity: Activity, configuration: GamebaseConfiguration, @Nullable callback: GamebaseDataCallback<LaunchingInfo>)

This function initializes the Gamebase SDK. If this function is not called, the Gamebase SDK function will not work.

Example Usage:

    public class SampleActivity extends Activity {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_sample);

            Gamebase.setDebugMode(true);

            GamebaseConfiguration initSettings = GamebaseConfiguration.newBuilder(
                            "diIofWef", "1.0.0", PurchaseProvider.StoreCode.GOOGLE)
                            .build();

            Gamebase.initialize(activity, initSettings, new GamebaseDataCallback<LaunchingInfo>() {
                @Override
                public void onCallback(LaunchingInfo data, GamebaseException exception) {
                    if (Gamebase.isSuccess(exception)) {
                        // Success
                    } else {
                        // Failed
                    }
                }
            });
        }
    }

Content copied to clipboard

#### Since

Added 1.4.0.

#### Parameters

activity

The activity which is initializing modules.

configuration

The configurations required to run the Gamebase SDK.

callback

Initialization result callback, returns the launching information as a result of initialization.

#### See also

GamebaseConfiguration
LaunchingInfo
GamebaseDataCallback