Skip to content

Commit ca9a5c2

Browse files
committed
Formatting and increase package version number
1 parent d8f5f17 commit ca9a5c2

15 files changed

Lines changed: 428 additions & 373 deletions

File tree

android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
@RunWith(AndroidJUnit4.class)
1717
public class ExampleInstrumentedTest {
1818

19-
@Test
20-
public void useAppContext() throws Exception {
21-
// Context of the app under test.
22-
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
19+
@Test
20+
public void useAppContext() throws Exception {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry
23+
.getInstrumentation()
24+
.getTargetContext();
2325

24-
assertEquals("com.getcapacitor.android", appContext.getPackageName());
25-
}
26+
assertEquals("com.getcapacitor.android", appContext.getPackageName());
27+
}
2628
}

android/src/main/java/com/bugfender/sdk/capacitor/BugfenderPlugin.java

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import com.getcapacitor.PluginMethod;
1212
import com.getcapacitor.annotation.ActivityCallback;
1313
import com.getcapacitor.annotation.CapacitorPlugin;
14-
1514
import java.net.URL;
1615

1716
@CapacitorPlugin(name = "Bugfender")
@@ -36,7 +35,8 @@ public void init(PluginCall call) {
3635
}
3736
// endregion before init
3837

39-
boolean debug = call.getBoolean("debug",
38+
boolean debug = call.getBoolean(
39+
"debug",
4040
call.getBoolean("printToConsole", false)
4141
);
4242
Bugfender.init(getContext(), call.getString("appKey"), debug);
@@ -55,7 +55,10 @@ public void init(PluginCall call) {
5555
Bugfender.enableUIEventLogging(getActivity().getApplication());
5656
}
5757

58-
boolean registerErrorHandler = call.getBoolean("registerErrorHandler", false);
58+
boolean registerErrorHandler = call.getBoolean(
59+
"registerErrorHandler",
60+
false
61+
);
5962
if (registerErrorHandler) {
6063
Bugfender.enableCrashReporting();
6164
}
@@ -78,7 +81,9 @@ public void getDeviceURL(PluginCall call) {
7881
response.put("url", url.toString());
7982
call.resolve(response);
8083
} else {
81-
call.reject("Bugfender SDK is not initialized. You should call first to the method Bugfender.init()");
84+
call.reject(
85+
"Bugfender SDK is not initialized. You should call first to the method Bugfender.init()"
86+
);
8287
}
8388
}
8489

@@ -90,7 +95,9 @@ public void getSessionURL(PluginCall call) {
9095
response.put("url", url.toString());
9196
call.resolve(response);
9297
} else {
93-
call.reject("Bugfender SDK is not initialized. You should call first to the method Bugfender.init()");
98+
call.reject(
99+
"Bugfender SDK is not initialized. You should call first to the method Bugfender.init()"
100+
);
94101
}
95102
}
96103

@@ -103,8 +110,16 @@ public void getUserFeedback(PluginCall call) {
103110
String sendButtonText = call.getString("submitLabel");
104111
startActivityForResult(
105112
call,
106-
Bugfender.getUserFeedbackActivityIntent(getActivity().getApplication(), title, hint, subjectHint, messageHint, sendButtonText),
107-
"getUserFeedbackResult");
113+
Bugfender.getUserFeedbackActivityIntent(
114+
getActivity().getApplication(),
115+
title,
116+
hint,
117+
subjectHint,
118+
messageHint,
119+
sendButtonText
120+
),
121+
"getUserFeedbackResult"
122+
);
108123
}
109124

110125
@ActivityCallback
@@ -114,7 +129,10 @@ private void getUserFeedbackResult(PluginCall call, ActivityResult result) {
114129
}
115130
if (result.getResultCode() == Activity.RESULT_OK) {
116131
JSObject response = new JSObject();
117-
response.put("url", result.getData().getStringExtra(FeedbackActivity.RESULT_FEEDBACK_URL));
132+
response.put(
133+
"url",
134+
result.getData().getStringExtra(FeedbackActivity.RESULT_FEEDBACK_URL)
135+
);
118136
call.resolve(response);
119137
} else {
120138
call.reject("Feedback not sent");
@@ -165,25 +183,35 @@ public void removeDeviceKey(PluginCall call) {
165183

166184
@PluginMethod
167185
public void sendCrash(PluginCall call) {
168-
URL url = Bugfender.sendCrash(call.getString("title"), call.getString("text"));
186+
URL url = Bugfender.sendCrash(
187+
call.getString("title"),
188+
call.getString("text")
189+
);
169190
if (url != null) {
170191
JSObject response = new JSObject();
171192
response.put("url", url.toString());
172193
call.resolve(response);
173194
} else {
174-
call.reject("Bugfender SDK is not initialized. You should call first to the method Bugfender.init()");
195+
call.reject(
196+
"Bugfender SDK is not initialized. You should call first to the method Bugfender.init()"
197+
);
175198
}
176199
}
177200

178201
@PluginMethod
179202
public void sendIssue(PluginCall call) {
180-
URL url = Bugfender.sendIssue(call.getString("title"), call.getString("text"));
203+
URL url = Bugfender.sendIssue(
204+
call.getString("title"),
205+
call.getString("text")
206+
);
181207
if (url != null) {
182208
JSObject response = new JSObject();
183209
response.put("url", url.toString());
184210
call.resolve(response);
185211
} else {
186-
call.reject("Bugfender SDK is not initialized. You should call first to the method Bugfender.init()");
212+
call.reject(
213+
"Bugfender SDK is not initialized. You should call first to the method Bugfender.init()"
214+
);
187215
}
188216
}
189217

@@ -219,13 +247,18 @@ private static LogLevel parseLogLevel(int logLevel) {
219247

220248
@PluginMethod
221249
public void sendUserFeedback(PluginCall call) {
222-
URL url = Bugfender.sendUserFeedback(call.getString("title"), call.getString("text"));
250+
URL url = Bugfender.sendUserFeedback(
251+
call.getString("title"),
252+
call.getString("text")
253+
);
223254
if (url != null) {
224255
JSObject response = new JSObject();
225256
response.put("url", url.toString());
226257
call.resolve(response);
227258
} else {
228-
call.reject("Bugfender SDK is not initialized. You should call first to the method Bugfender.init()");
259+
call.reject(
260+
"Bugfender SDK is not initialized. You should call first to the method Bugfender.init()"
261+
);
229262
}
230263
}
231264

@@ -270,5 +303,4 @@ public void setForceEnabled(PluginCall call) {
270303
Bugfender.setForceEnabled(call.getBoolean("state"));
271304
call.resolve();
272305
}
273-
274306
}

android/src/test/java/com/getcapacitor/ExampleUnitTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
*/
1212
public class ExampleUnitTest {
1313

14-
@Test
15-
public void addition_isCorrect() throws Exception {
16-
assertEquals(4, 2 + 2);
17-
}
14+
@Test
15+
public void addition_isCorrect() throws Exception {
16+
assertEquals(4, 2 + 2);
17+
}
1818
}

example/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
@RunWith(AndroidJUnit4.class)
1717
public class ExampleInstrumentedTest {
1818

19-
@Test
20-
public void useAppContext() throws Exception {
21-
// Context of the app under test.
22-
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
19+
@Test
20+
public void useAppContext() throws Exception {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry
23+
.getInstrumentation()
24+
.getTargetContext();
2325

24-
assertEquals("com.getcapacitor.app", appContext.getPackageName());
25-
}
26+
assertEquals("com.getcapacitor.app", appContext.getPackageName());
27+
}
2628
}

example/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
*/
1212
public class ExampleUnitTest {
1313

14-
@Test
15-
public void addition_isCorrect() throws Exception {
16-
assertEquals(4, 2 + 2);
17-
}
14+
@Test
15+
public void addition_isCorrect() throws Exception {
16+
assertEquals(4, 2 + 2);
17+
}
1818
}

example/capacitor.config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/// <reference types="@bugfender/capacitor" />
2-
import { CapacitorConfig } from '@capacitor/cli';
2+
import type { CapacitorConfig } from "@capacitor/cli";
33

44
const config: CapacitorConfig = {
5-
appId: 'com.bugfender.sdk.capacitor.example',
6-
appName: 'Bugfender Capacitor Example',
7-
webDir: 'www',
5+
appId: "com.bugfender.sdk.capacitor.example",
6+
appName: "Bugfender Capacitor Example",
7+
webDir: "www",
88
plugins: {
99
Bugfender: {},
1010
SplashScreen: {
11-
launchShowDuration: 0
12-
}
13-
}
11+
launchShowDuration: 0,
12+
},
13+
},
1414
};
1515

1616
export default config;

example/src/index.html

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>Bugfender Capacitor Example</title>
8-
</head>
9-
<body style="margin:48px 16px 48px 16px;">
10-
<script type="module" src="main.ts"></script>
11-
<p>
12-
<button id="send_logs_btn">Send logs</button>
13-
</p>
14-
<p>
15-
<button id="generate_js_crash_btn">Generate JS crash</button>
16-
</p>
17-
<p>
18-
<button id="native_feedback_btn">Show Native User Feedback</button>
19-
</p>
20-
<p>
21-
<button id="console_compat_logtext_btn"><code>console.*</code> compatible log entry</button>
22-
</p>
23-
<p>
24-
<a href="" id="device_url_link">Open Device URL</a>
25-
</p>
26-
<p>
27-
<a href="" id="session_url_link">Open Session URL</a>
28-
</p>
29-
</body>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Bugfender Capacitor Example</title>
8+
</head>
9+
<body style="margin: 48px 16px 48px 16px">
10+
<script type="module" src="main.ts"></script>
11+
<p>
12+
<button id="send_logs_btn">Send logs</button>
13+
</p>
14+
<p>
15+
<button id="generate_js_crash_btn">Generate JS crash</button>
16+
</p>
17+
<p>
18+
<button id="native_feedback_btn">Show Native User Feedback</button>
19+
</p>
20+
<p>
21+
<button id="console_compat_logtext_btn">
22+
<code>console.*</code> compatible log entry
23+
</button>
24+
</p>
25+
<p>
26+
<a href="" id="device_url_link">Open Device URL</a>
27+
</p>
28+
<p>
29+
<a href="" id="session_url_link">Open Session URL</a>
30+
</p>
31+
</body>
3032
</html>

0 commit comments

Comments
 (0)