Skip to content

Commit a5c3fd8

Browse files
committed
fix(ios): environment tags fix
1 parent 99a807d commit a5c3fd8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/integrations/eventorigin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export class EventOrigin implements Integration {
1919
addGlobalEventProcessor((event) => {
2020
event.tags = event.tags ?? {};
2121

22-
event.tags['event.origin'] = 'javascript';
23-
event.tags['event.environment'] = 'javascript';
22+
event.tags['event.origin'] = __ANDROID__?'android' : __IOS__ ? 'ios' : 'javascript';
23+
event.tags['event.environment'] = 'nativescript';
2424

2525
return event;
2626
});

src/wrapper.ios.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export namespace NATIVE {
344344

345345
nSentryOptions = SentryOptions.alloc().initWithDictDidFailWithError(mutDict as any);
346346

347-
// before send right now is never called when we send the envelope
347+
// before send right now is never called when we send the envelope. Only on native crash
348348
nSentryOptions.beforeSend = (event: SentryEvent) => {
349349
const exception = event.exceptions?.objectAtIndex(0);
350350
const exceptionvalue = exception?.value;
@@ -364,6 +364,7 @@ export namespace NATIVE {
364364
beforeSend(event as any, null);
365365
}
366366
setEventOriginTag(event);
367+
367368
return event;
368369
};
369370
nSentryOptions.beforeBreadcrumb = (breadcrumb) => {
@@ -413,7 +414,7 @@ export namespace NATIVE {
413414
}
414415

415416
function dictToJSON(dict) {
416-
return JSON.parse(NSString.alloc().initWithDataEncoding(NSJSONSerialization.dataWithJSONObjectOptionsError(dict, 0), NSUTF8StringEncoding) as any);
417+
return JSON.parse(NSString.alloc().initWithDataEncoding(NSJSONSerialization.dataWithJSONObjectOptionsError(dict, 0 as any), NSUTF8StringEncoding) as any);
417418
}
418419
export async function fetchNativeDeviceContexts() {
419420
if (!enableNative) {

0 commit comments

Comments
 (0)