# updateTerms

open fun updateTerms(@NonNull activity: Activity, @NonNull configuration: GamebaseUpdateTermsConfiguration, @Nullable callback: GamebaseCallback)

Send the agreement to the terms and conditions to the Gamebase server. This can also be used to change the content of the optional terms and conditions.

Example Usage:

    Gamebase.Terms.queryTerms(activity, new GamebaseDataCallback<GamebaseQueryTermsResult>() {
        @Override
        public void onCallback(GamebaseQueryTermsResult result, GamebaseException queryTermsException) {
            if (Gamebase.isSuccess(queryTermsException)) {
                // Succeeded to query terms.
                final int termsSeq = result.getTermsSeq();
                final String termsVersion = result.getTermsVersion();
                final List<GamebaseTermsContent> contents = new ArrayList<>();
                for (GamebaseTermsContentDetail detail : result.getContents()) {
                    GamebaseTermsContent content = GamebaseTermsContent.from(detail);
                    // Change agree value what you want!
                    content.setAgreed(agreeOrNot);
                    contents.add(content);
                }

                final GamebaseUpdateTermsConfiguration configuration =
                        GamebaseUpdateTermsConfiguration.newBuilder(termsSeq, termsVersion, contents)
                                .build();
                Gamebase.Terms.updateTerms(activity, configuration, new GamebaseCallback() {
                    @Override
                    public void onCallback(GamebaseException updateTermsException) {
                        if (Gamebase.isSuccess(updateTermsException)) {
                            // Succeeded to update terms.
                        } else {
                            // Failed to update terms.
                        }
                    }
                });
            } else {
                // Failed to query terms.
            }
        }
    });

Content copied to clipboard

#### Since

Added 2.20.0

#### Parameters

activity

Current activity.

configuration

GamebaseUpdateTermsConfiguration for queryTerms

callback

#### See also

GamebaseUpdateTermsConfiguration
GamebaseTermsContent
GamebaseCallback