Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit aac45ef

Browse files
committed
fix: android errors after migrating to cap v3
1 parent 8ca7f26 commit aac45ef

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

android/src/main/java/com/getcapacitor/community/twitter/TwitterPlugin.java

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package com.getcapacitor.community.twitter;
22
import android.content.Intent;
33
import android.util.Log;
4-
5-
import com.getcapacitor.Config;
4+
import com.getcapacitor.annotation.CapacitorPlugin;
65
import com.getcapacitor.JSObject;
76
import com.getcapacitor.Plugin;
87
import com.getcapacitor.PluginCall;
9-
import com.getcapacitor.NativePlugin;
108
import com.getcapacitor.PluginMethod;
119
import com.twitter.sdk.android.core.Callback;
1210
import com.twitter.sdk.android.core.DefaultLogger;
@@ -21,19 +19,17 @@
2119
import com.twitter.sdk.android.core.TwitterSession;
2220
import com.twitter.sdk.android.core.identity.TwitterAuthClient;
2321

24-
// @NativePlugin(requestCodes = {TwitterAuthConfig.DEFAULT_AUTH_REQUEST_CODE})
2522
@CapacitorPlugin(
2623
name = "Twitter"
2724
)
2825
public class TwitterPlugin extends Plugin {
29-
public static final String CONFIG_KEY_PREFIX = "plugins.TwitterPlugin.";
3026

3127
private TwitterAuthClient authClient;
3228

3329
@Override()
3430
public void load() {
35-
String consumerKey = this.bridge.getConfig().getString(CONFIG_KEY_PREFIX + "consumerKey", "ADD_IN_CAPACITOR_CONFIG_JSON");
36-
String consumerSecret = this.bridge.getConfig().getString(CONFIG_KEY_PREFIX + "consumerSecret", "ADD_IN_CAPACITOR_CONFIG_JSON");
31+
String consumerKey = this.bridge.getConfig().getPluginConfiguration("Twitter").getString( "consumerKey", "ADD_IN_CAPACITOR_CONFIG_JSON");
32+
String consumerSecret = this.bridge.getConfig().getPluginConfiguration("Twitter").getString("consumerSecret", "ADD_IN_CAPACITOR_CONFIG_JSON");
3733

3834
//
3935
// initialize twitter

0 commit comments

Comments
 (0)