This repository was archived by the owner on Jun 2, 2023. It is now read-only.
File tree 1 file changed +3
-7
lines changed
android/src/main/java/com/getcapacitor/community/twitter
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 1
1
package com .getcapacitor .community .twitter ;
2
2
import android .content .Intent ;
3
3
import android .util .Log ;
4
-
5
- import com .getcapacitor .Config ;
4
+ import com .getcapacitor .annotation .CapacitorPlugin ;
6
5
import com .getcapacitor .JSObject ;
7
6
import com .getcapacitor .Plugin ;
8
7
import com .getcapacitor .PluginCall ;
9
- import com .getcapacitor .NativePlugin ;
10
8
import com .getcapacitor .PluginMethod ;
11
9
import com .twitter .sdk .android .core .Callback ;
12
10
import com .twitter .sdk .android .core .DefaultLogger ;
21
19
import com .twitter .sdk .android .core .TwitterSession ;
22
20
import com .twitter .sdk .android .core .identity .TwitterAuthClient ;
23
21
24
- // @NativePlugin(requestCodes = {TwitterAuthConfig.DEFAULT_AUTH_REQUEST_CODE})
25
22
@ CapacitorPlugin (
26
23
name = "Twitter"
27
24
)
28
25
public class TwitterPlugin extends Plugin {
29
- public static final String CONFIG_KEY_PREFIX = "plugins.TwitterPlugin." ;
30
26
31
27
private TwitterAuthClient authClient ;
32
28
33
29
@ Override ()
34
30
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" );
37
33
38
34
//
39
35
// initialize twitter
You can’t perform that action at this time.
0 commit comments