Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change apikey #8

Closed
wants to merge 8 commits into from
Closed
13 changes: 13 additions & 0 deletions sdk/src/main/java/com/talkable/sdk/Talkable.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,19 @@ public static void setSiteSlug(String newSiteSlug) {
siteSlug = newSiteSlug;
}

public static void updateCredentials(String newApiKey, String newSiteSlug) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static void updateCredentials(String newApiKey, String newSiteSlug) {
public static void setCredentials(String newApiKey, String newSiteSlug) {

if (!getDebug()) {
throw new IllegalStateException("You should specify Api Key and Site Slug inside AndroidManifest file");
}

if (newApiKey == null || newSiteSlug == null || newApiKey.isEmpty() || newSiteSlug.isEmpty()) {
throw new IllegalArgumentException("Api key or Site slug should not be blank");
}

credentialsMap.put(newSiteSlug, newApiKey);
siteSlug = newSiteSlug;
}

public static boolean getDebug() {
return debug;
}
Expand Down