|
@@ -14,13 +14,20 @@ export class TwitterApiProvider {
|
|
|
private async initApi() {
|
|
|
const access_token_key = await this.storage.get("accessTokenKey");
|
|
|
const access_token_secret = await this.storage.get("accessTokenSecret");
|
|
|
- this.client = new Twit({
|
|
|
- consumer_key: "UxZkbKotkr8Uc6seupnaZ1kDE",
|
|
|
- consumer_secret: "fEAas8iugR60FOEXsFG0iajq6oyfIIXRBVMlTgWxBd1stWIKHq",
|
|
|
- access_token: access_token_key,
|
|
|
- access_token_secret: access_token_secret,
|
|
|
- timeout_ms: 60 * 1000 // optional HTTP request timeout to apply to all requests.
|
|
|
- });
|
|
|
+ if (access_token_key && access_token_secret) {
|
|
|
+ this.client = new Twit({
|
|
|
+ consumer_key: "UxZkbKotkr8Uc6seupnaZ1kDE",
|
|
|
+ consumer_secret: "fEAas8iugR60FOEXsFG0iajq6oyfIIXRBVMlTgWxBd1stWIKHq",
|
|
|
+ access_token: access_token_key,
|
|
|
+ access_token_secret: access_token_secret,
|
|
|
+ timeout_ms: 60 * 1000 // optional HTTP request timeout to apply to all requests.
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ console.error(
|
|
|
+ "Access Token Key and Secret not set. Creating Twit-client not possible."
|
|
|
+ );
|
|
|
+ console.info("This error can be ignored if no user is logged in.");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public async fetchHomeFeed(maxId?) {
|