Skip to content

Commit da647ad

Browse files
committed
Merge branch 'master' of github.com:farfromrefug/nativescript-akylas-sentry
# Conflicts: # .gitignore # demo-vue/app/main.ts # demo-vue/app/views/Home.ts # demo-vue/package.json # demo-vue/pnpm-lock.yaml # demo-vue/webpack.config.js # src/client.ts # src/integrations/debugsymbolicator.ts # src/sdk.ts # src/wrapper.android.ts
2 parents 70557c2 + 4ee1f17 commit da647ad

File tree

13 files changed

+303
-6203
lines changed

13 files changed

+303
-6203
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,7 @@ Pods
2121
*.xcuserdatad
2222
/plugin/README.md
2323
pnpm-lock.yaml
24+
yarn.lock
2425
/plugin/platforms/android/sentry.aar
26+
.sentryclirc
27+
.yarn
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.nativescript.sentry;
2+
3+
public class ClassExample {
4+
public static String helloWorld(String message) throws CustomException {
5+
throw new CustomException(message);
6+
// return "helloWorld";
7+
}
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.nativescript.sentry;
2+
3+
public class CustomException extends Exception
4+
{
5+
public CustomException (String str)
6+
{
7+
super(str);
8+
}
9+
}

demo-vue/app/main.ts

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -38,44 +38,6 @@ if (!__ANDROID__ || Application.android.context) {
3838

3939
}
4040

41-
// let typedArray;
42-
// const textDecoder = new TextDecoder();
43-
// const textEncoder = new TextEncoder();
44-
// const strTest = '';
45-
// if (__IOS__){
46-
// let startTime = Date.now();
47-
// const testNSData = NSString.stringWithString(strTest).dataUsingEncoding(NSUTF8StringEncoding);
48-
// typedArray = new Uint8Array(interop.bufferFromData(testNSData));
49-
// console.log('typedArray encoded', Date.now() - startTime, 'ms');
50-
// startTime = Date.now();
51-
// let decoded = NSString.alloc().initWithDataEncoding(typedArray.buffer, NSUTF8StringEncoding) + '';
52-
// console.log('typedArray decoded', decoded === strTest, Date.now() - startTime, 'ms');
53-
54-
// startTime = Date.now();
55-
// typedArray = textEncoder.encode(strTest);
56-
// console.log('textDecoder encoded', Date.now() - startTime, 'ms');
57-
// startTime = Date.now();
58-
// decoded= textDecoder.decode(typedArray);
59-
// console.log('textDecoder decoded', decoded === strTest, Date.now() - startTime, 'ms');
60-
// }
61-
// if (__ANDROID__){
62-
// const charset = java.nio.charset.Charset.forName('UTF-8');
63-
// const nencoder = charset.newEncoder();
64-
// const ndecoder = charset.newDecoder();
65-
// let startTime = Date.now();
66-
// // @ts-ignore
67-
// const testByteArray = new Uint8Array(ArrayBuffer.from(nencoder.encode(java.nio.CharBuffer.wrap(strTest))));
68-
// console.log('typedArray encoded', Date.now() - startTime, 'ms');
69-
// let decoded = ndecoder.decode(testByteArray.buffer as any).toString();
70-
// console.log('typedArray decoded', decoded === strTest, Date.now() - startTime, 'ms');
71-
72-
// startTime = Date.now();
73-
// typedArray = textEncoder.encode(strTest);
74-
// console.log('textDecoder encoded', Date.now() - startTime, 'ms');
75-
// startTime = Date.now();
76-
// decoded= textDecoder.decode(typedArray);
77-
// console.log('textDecoder decoded', decoded === strTest, Date.now() - startTime, 'ms');
78-
// }
7941
new Vue({
8042
render: h => h('frame', [h(Home)])
8143
}).$start();

demo-vue/app/views/Home.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export default {
2020
<Button text="throwError" @tap="throwError"/>
2121
<Button text="crashTest" @tap="crashTest"/>
2222
<Button text="nativeCrashTest" @tap="nativeCrashTest"/>
23+
<Button text="androidNativeCrashTest" @tap="androidNativeCrashTest"/>
24+
<Button text="androidNativeCrashCatchedTest" @tap="androidNativeCrashCatchedTest"/>
2325
<Button text="flush" @tap="flush"/>
2426
</StackLayout>
2527
</Page>
@@ -83,6 +85,7 @@ export default {
8385
});
8486
},
8587
throwError() {
88+
8689
Sentry.captureException(new Error('test_notify_error' + Date.now()));
8790
},
8891
leaveBreadcrumb() {
@@ -94,6 +97,24 @@ export default {
9497
nativeCrashTest() {
9598
TestClass.someMethod();
9699
},
100+
androidNativeCrashCatchedTest() {
101+
try {
102+
console.log('androidNativeCrashTest', (com as any).nativescript.sentry.ClassExample.helloWorld('test3'));
103+
104+
} catch (error) {
105+
// console.error('error', error);
106+
// console.error('keys', Object.keys(error));
107+
// console.error('nativeExceptio', error.nativeException);
108+
console.error('stackTrace', error.stackTrace);
109+
console.error('stack', error.stack);
110+
// console.error('stack', error.stack);
111+
// console.error('stacktrace', error.stacktrace);
112+
Sentry.captureException(error);
113+
}
114+
},
115+
androidNativeCrashTest() {
116+
console.log('androidNativeCrashTest', (com as any).nativescript.sentry.ClassExample.helloWorld('test3'));
117+
},
97118
flush() {
98119
Sentry.flush();
99120
}

demo-vue/package.json

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,27 @@
44
"readme": "README.md",
55
"repository": "http://www.github.com/nativescript-community/sentry.git",
66
"dependencies": {
7-
"@nativescript-community/sentry": "link:../plugin",
8-
"@nativescript/core": "8.3.5",
7+
"@nativescript-community/sentry": "4.6.2",
8+
"@nativescript/core": "8.4.1",
99
"nativescript-vue": "2.9.3"
1010
},
1111
"devDependencies": {
12-
"@babel/core": "~7.19.3",
13-
"@babel/preset-env": "~7.19.4",
14-
"@nativescript/android": "8.4.0-alpha.4",
15-
"@nativescript/ios": "8.3.3",
16-
"@nativescript/webpack": "~5.0.9",
17-
"@sentry/browser": "7.15.0",
18-
"@sentry/cli": "2.7.0",
19-
"@sentry/core": "7.15.0",
20-
"@sentry/hub": "7.15.0",
21-
"@sentry/integrations": "7.15.0",
22-
"@sentry/tracing": "7.15.0",
23-
"@sentry/types": "7.15.0",
24-
"@sentry/utils": "7.15.0",
25-
"@sentry/webpack-plugin": "1.19.1",
26-
"babel-loader": "~8.2.5",
12+
"@babel/core": "~7.20.5",
13+
"@babel/preset-env": "~7.20.2",
14+
"@nativescript/android": "8.4.0",
15+
"@nativescript/ios": "8.4.0",
16+
"@nativescript/webpack": "~5.0.12",
17+
"@sentry/cli": "2.10.0",
18+
"@sentry/webpack-plugin": "1.20.0",
19+
"babel-loader": "~9.1.0",
2720
"cross-var": "^1.1.0",
2821
"nativescript-vue-template-compiler": "~2.9.3",
29-
"node-sass": "^7.0.3",
22+
"node-sass": "^8.0.0",
3023
"vue": "~2.6.14",
3124
"vue-loader": "~15.9.8"
3225
},
33-
"scripts": {},
34-
"main": "app/main"
35-
}
26+
"main": "app/main",
27+
"resolutions": {
28+
"@nativescript-community/sentry": "portal:../plugin"
29+
}
30+
}

0 commit comments

Comments
 (0)