public static void initialize(final Context context, final String clientId, String clientSecret) {
        try {
            WonderPush.logDebug("initialize(" + context.getClass().getSimpleName() + ", " + clientId + ", <redacted clientSecret>)");
            if (!sIsInitialized || (
                    clientId != null && clientSecret != null && (!clientId.equals(sClientId) || !clientSecret.equals(sClientSecret))
            )) {

                sIsInitialized = false;
                setNetworkAvailable(false);

                sApplicationContext = context.getApplicationContext();
                sClientId = clientId;
                sClientSecret = clientSecret;
                sBaseURL = PRODUCTION_API_URL;
                if (sSenderId == null) {
                    sSenderId = WonderPushFirebaseMessagingService.getDefaultSenderId();
                    if (WonderPushFirebaseMessagingService.WONDERPUSH_DEFAULT_SENDER_ID.equals(sSenderId)) {
                        Log.w(TAG, "Using WonderPush own Firebase FCM Sender ID " + sSenderId + ". Your push tokens will not be portable. Please refer to the documentation.");
                    } else {
                        logDebug("Using senderId from Firebase: " + sSenderId);
                    }
                }

                WonderPush.logDebug("Initializing FirebaseApp…");
                try {
                    sFirebaseApp = FirebaseApp.initializeApp(
                            sApplicationContext,
                            new FirebaseOptions.Builder()
                                    .setApplicationId("NONE")
                                    .setApiKey("NONE")
                                    .setGcmSenderId(sSenderId)
                                    .build(),
                            FIREBASE_APP_NAME
                    );
                    WonderPush.logDebug("Initialized FirebaseApp");
                } catch (IllegalStateException alreadyInitialized) {
                    WonderPush.logError("FirebaseApp already initialized", alreadyInitialized);
                    sFirebaseApp = FirebaseApp.getInstance(FIREBASE_APP_NAME);
                }

                WonderPushConfiguration.initialize(getApplicationContext());
                WonderPushUserPreferences.initialize();
                applyOverrideLogging(WonderPushConfiguration.getOverrideSetLogging());
                JSONSyncInstallationCustom.initialize();
                WonderPushRequestVault.initialize();

                initForNewUser(sBeforeInitializationUserIdSet
                        ? sBeforeInitializationUserId
                        : WonderPushConfiguration.getUserId());

                sIsInitialized = true;
                hasUserConsentChanged(hasUserConsent()); // make sure to set sIsInitialized=true before

                // Permission checks
                if (context.getPackageManager().checkPermission(android.Manifest.permission.INTERNET, context.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
                    Log.w(TAG, "Missing INTERNET permission. Add <uses-permission android:name=\"android.permission.INTERNET\" /> under <manifest> in your AndroidManifest.xml");
                }
                if (context.getPackageManager().checkPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION, context.getPackageName()) != PackageManager.PERMISSION_GRANTED
                        && context.getPackageManager().checkPermission(android.Manifest.permission.ACCESS_FINE_LOCATION, context.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                        Log.w(TAG, "Permissions ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION have not been declared or granted yet. Make sure you declare <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /> under <manifest> in your AndroidManifest.xml (you can add either or both), and call ActivityCompat.requestPermissions() to request the permission at runtime");
                    } else {
                        Log.w(TAG, "Missing ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permission. Add <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /> under <manifest> in your AndroidManifest.xml (you can add either or both)");
                    }
                } else if (context.getPackageManager().checkPermission(android.Manifest.permission.ACCESS_FINE_LOCATION, context.getPackageName()) != PackageManager.PERMISSION_GRANTED) {
                    Log.d(TAG, "Only ACCESS_COARSE_LOCATION permission is granted. For more precision, you should strongly consider adding <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /> under <manifest> in your AndroidManifest.xml");
                }
            }

            initializeForApplication(context);
            initializeForActivity(context);
        } catch (Exception e) {
            Log.e(TAG, "Unexpected error while initializing the SDK", e);
        }
    }
public static void initialize ( final Context context , final String clientId , String clientSecret ) { try { WonderPush . logDebug ( "initialize(" + context . getClass ( ) . getSimpleName ( ) + ", " + clientId + ", <redacted clientSecret>)" ) ; if ( ! sIsInitialized || ( clientId != null && clientSecret != null && ( ! clientId . equals ( sClientId ) || ! clientSecret . equals ( sClientSecret ) ) ) ) { sIsInitialized = false ; setNetworkAvailable ( false ) ; sApplicationContext = context . getApplicationContext ( ) ; sClientId = clientId ; sClientSecret = clientSecret ; sBaseURL = PRODUCTION_API_URL ; if ( sSenderId == null ) { sSenderId = WonderPushFirebaseMessagingService . getDefaultSenderId ( ) ; if ( WonderPushFirebaseMessagingService . WONDERPUSH_DEFAULT_SENDER_ID . equals ( sSenderId ) ) { Log . w ( TAG , "Using WonderPush own Firebase FCM Sender ID " + sSenderId + ". Your push tokens will not be portable. Please refer to the documentation." ) ; } else { logDebug ( "Using senderId from Firebase: " + sSenderId ) ; } } WonderPush . logDebug ( "Initializing FirebaseApp…" ) ; try { sFirebaseApp = FirebaseApp . initializeApp ( sApplicationContext , new FirebaseOptions . Builder ( ) . setApplicationId ( "NONE" ) . setApiKey ( "NONE" ) . setGcmSenderId ( sSenderId ) . build ( ) , FIREBASE_APP_NAME ) ; WonderPush . logDebug ( "Initialized FirebaseApp" ) ; } catch ( IllegalStateException alreadyInitialized ) { WonderPush . logError ( "FirebaseApp already initialized" , alreadyInitialized ) ; sFirebaseApp = FirebaseApp . getInstance ( FIREBASE_APP_NAME ) ; } WonderPushConfiguration . initialize ( getApplicationContext ( ) ) ; WonderPushUserPreferences . initialize ( ) ; applyOverrideLogging ( WonderPushConfiguration . getOverrideSetLogging ( ) ) ; JSONSyncInstallationCustom . initialize ( ) ; WonderPushRequestVault . initialize ( ) ; initForNewUser ( sBeforeInitializationUserIdSet ? sBeforeInitializationUserId : WonderPushConfiguration . getUserId ( ) ) ; sIsInitialized = true ; hasUserConsentChanged ( hasUserConsent ( ) ) ; if ( context . getPackageManager ( ) . checkPermission ( android . Manifest . permission . INTERNET , context . getPackageName ( ) ) != PackageManager . PERMISSION_GRANTED ) { Log . w ( TAG , "Missing INTERNET permission. Add <uses-permission android:name=\"android.permission.INTERNET\" /> under <manifest> in your AndroidManifest.xml" ) ; } if ( context . getPackageManager ( ) . checkPermission ( android . Manifest . permission . ACCESS_COARSE_LOCATION , context . getPackageName ( ) ) != PackageManager . PERMISSION_GRANTED && context . getPackageManager ( ) . checkPermission ( android . Manifest . permission . ACCESS_FINE_LOCATION , context . getPackageName ( ) ) != PackageManager . PERMISSION_GRANTED ) { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . M ) { Log . w ( TAG , "Permissions ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION have not been declared or granted yet. Make sure you declare <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /> under <manifest> in your AndroidManifest.xml (you can add either or both), and call ActivityCompat.requestPermissions() to request the permission at runtime" ) ; } else { Log . w ( TAG , "Missing ACCESS_COARSE_LOCATION and ACCESS_FINE_LOCATION permission. Add <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /> under <manifest> in your AndroidManifest.xml (you can add either or both)" ) ; } } else if ( context . getPackageManager ( ) . checkPermission ( android . Manifest . permission . ACCESS_FINE_LOCATION , context . getPackageName ( ) ) != PackageManager . PERMISSION_GRANTED ) { Log . d ( TAG , "Only ACCESS_COARSE_LOCATION permission is granted. For more precision, you should strongly consider adding <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\" /> under <manifest> in your AndroidManifest.xml" ) ; } } initializeForApplication ( context ) ; initializeForActivity ( context ) ; } catch ( Exception e ) { Log . e ( TAG , "Unexpected error while initializing the SDK" , e ) ; } }
Initialize WonderPush from your {@link WonderPushInitializer} implementation.

<p>
Using automatic initialization, you do not need to take care of this yourself.
</p>

<p>
Prefer calling the simpler {@link WonderPush#initialize(Context)} function directly, as it will
instantiate your {@link WonderPushInitializer} implementation which will in turn call this function.
This way you concentrate the retrieval of your credentials from secure storage in a single location.
</p>

@param context
The main {@link Activity} of your application, or failing that, the {@link Application} context.
@param clientId
The clientId of your application.
@param clientSecret
The clientSecret of your application.