Skip to content

Commit 5673c65

Browse files
committed
fix: unreliable android API
* Fixes #5
1 parent f48d87e commit 5673c65

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Assets/Sentry/Scripts/Sentry.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,6 @@ public Context()
322322
device.device_type = SystemInfo.deviceType.ToString();
323323
device.cpu_description = SystemInfo.processorType;
324324

325-
#if UNITY_ANDROID
326-
using (var system = new AndroidJavaClass("java.lang.System"))
327-
{
328-
device.arch = system.CallStatic<string>("getProperty", "os.arch");
329-
}
330-
#endif
331-
332325
#if UNITY_EDITOR
333326
device.simulator = true;
334327
#else
@@ -375,6 +368,13 @@ public class Tags
375368
public class Extra
376369
{
377370
public string unityVersion;
371+
public string screenOrientation;
372+
}
373+
374+
[Serializable]
375+
public class User
376+
{
377+
public string email = "[email protected]";
378378
}
379379

380380
[Serializable]
@@ -389,7 +389,7 @@ public class SentryEvent
389389
public Context contexts;
390390
public SdkVersion sdk = new SdkVersion();
391391
public List<Breadcrumb> breadcrumbs = null;
392-
392+
public User user = new User();
393393
public Tags tags;
394394
public Extra extra;
395395

Assets/Sentry/Scripts/SentrySdk.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ private void PrepareEvent(SentryEvent evt)
304304

305305
evt.tags.deviceUniqueIdentifier = SystemInfo.deviceUniqueIdentifier;
306306
evt.extra.unityVersion = Application.unityVersion;
307+
evt.extra.screenOrientation = Screen.orientation.ToString();
307308
}
308309

309310
private IEnumerator

0 commit comments

Comments
 (0)