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

Commit 71221fe

Browse files
committed
feat(): add twitter plugin
0 parents  commit 71221fe

File tree

397 files changed

+23384
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

397 files changed

+23384
-0
lines changed

.gitignore

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Specifies intentionally untracked files to ignore when using Git
2+
# http://git-scm.com/docs/gitignore
3+
4+
*~
5+
*.sw[mnpcod]
6+
*.log
7+
*.tmp
8+
*.tmp.*
9+
log.txt
10+
*.sublime-project
11+
*.sublime-workspace
12+
.vscode/
13+
npm-debug.log*
14+
15+
.DS_Store
16+
Thumbs.db
17+
UserInterfaceState.xcuserstate
18+
node_modules
19+
dist

CapacitorTwitter.podspec

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
Pod::Spec.new do |s|
3+
s.name = 'CapacitorTwitter'
4+
s.version = '0.0.1'
5+
s.summary = 'access native twitter features like sign in and share'
6+
s.license = 'MIT'
7+
s.homepage = 'https://github.com/stewwan/capacitor-twitter'
8+
s.author = 'Stewan Silva'
9+
s.source = { :git => 'https://github.com/stewwan/capacitor-twitter', :tag => s.version.to_s }
10+
s.source_files = 'ios/Plugin/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
11+
s.ios.deployment_target = '11.0'
12+
s.dependency 'Capacitor'
13+
s.dependency 'TwitterKit'
14+
end

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# capacitor-twitter
2+
3+
Capacitor plugin to enable some native twitter features
4+
5+
## Notice
6+
7+
This plugin is currently under active development and has not yet been published.
8+
9+
## iOS
10+
11+
- [x] login
12+
- [x] logout
13+
- [ ] share (wip)
14+
15+
## Android
16+
17+
- [ ] login
18+
- [ ] logout
19+
- [ ] share
20+
21+
Check out the [ionic sample app](https://github.com/stewwan/capacitor-twitter-example) using this plugin.
22+
23+
## License
24+
25+
MIT

android/.idea/gradle.xml

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android/.idea/misc.xml

+25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android/.idea/modules.xml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android/.idea/runConfigurations.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android/.npmignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.externalNativeBuild

android/capacitor-twitter/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
buildscript {
2+
repositories {
3+
jcenter()
4+
google()
5+
}
6+
dependencies {
7+
classpath 'com.android.tools.build:gradle:3.1.1'
8+
}
9+
}
10+
11+
apply plugin: 'com.android.library'
12+
13+
android {
14+
compileSdkVersion 27
15+
defaultConfig {
16+
minSdkVersion 21
17+
targetSdkVersion 27
18+
versionCode 1
19+
versionName "1.0"
20+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
21+
}
22+
buildTypes {
23+
release {
24+
minifyEnabled false
25+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
26+
}
27+
}
28+
lintOptions {
29+
abortOnError false
30+
}
31+
}
32+
33+
repositories {
34+
google()
35+
jcenter()
36+
mavenCentral()
37+
maven {
38+
url "https://dl.bintray.com/ionic-team/capacitor"
39+
}
40+
}
41+
42+
43+
dependencies {
44+
implementation fileTree(dir: 'libs', include: ['*.jar'])
45+
implementation 'ionic-team:capacitor-android:1+'
46+
testImplementation 'junit:junit:4.12'
47+
androidTestImplementation 'com.android.support.test:runner:1.0.1'
48+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
49+
}
50+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.getcapacitor.android;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.*;
11+
12+
/**
13+
* Instrumented test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() throws Exception {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.getcapacitor.android", appContext.getPackageName());
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="cap.twitter.plugin.capacitortwitter">
4+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package cap.twitter.plugin;
2+
3+
import com.getcapacitor.JSObject;
4+
import com.getcapacitor.NativePlugin;
5+
import com.getcapacitor.Plugin;
6+
import com.getcapacitor.PluginCall;
7+
import com.getcapacitor.PluginMethod;
8+
9+
@NativePlugin()
10+
public class TwitterPlugin extends Plugin {
11+
12+
@PluginMethod()
13+
public void echo(PluginCall call) {
14+
String value = call.getString("value");
15+
16+
JSObject ret = new JSObject();
17+
ret.put("value", value);
18+
call.success(ret);
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
tools:context="com.getcapacitor.BridgeActivity"
8+
>
9+
10+
<WebView
11+
android:id="@+id/webview"
12+
android:layout_width="fill_parent"
13+
android:layout_height="fill_parent" />
14+
15+
</android.support.design.widget.CoordinatorLayout>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
<string name="my_string">Just a simple string</string>
3+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
3+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.getcapacitor;
2+
3+
import org.junit.Test;
4+
5+
import static org.junit.Assert.*;
6+
7+
/**
8+
* Example local unit test, which will execute on the development machine (host).
9+
*
10+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
11+
*/
12+
public class ExampleUnitTest {
13+
@Test
14+
public void addition_isCorrect() throws Exception {
15+
assertEquals(4, 2 + 2);
16+
}
17+
}

android/gradle.properties

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
org.gradle.jvmargs=-Xmx1536m
13+
14+
# When configured, Gradle will run in incubating parallel mode.
15+
# This option should only be used with decoupled projects. More details, visit
16+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17+
# org.gradle.parallel=true
52.4 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Fri Dec 01 12:41:00 CST 2017
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

0 commit comments

Comments
 (0)