Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes.trackError #5

Open
drauggres opened this issue Feb 29, 2020 · 2 comments
Open

Crashes.trackError #5

drauggres opened this issue Feb 29, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@drauggres
Copy link
Collaborator

drauggres commented Feb 29, 2020

Export trackError to JS: https://docs.microsoft.com/en-us/appcenter/sdk/crashes/android#handled-errors

#3 (comment)

@justintoth
Copy link

Here is what worked for me on Android:

@Kroll.method
	public void trackError(String exception, KrollDict[] properties)
	{
		try {
			Map<String, String> propertiesHash = new HashMap<String, String>();
			if (properties != null) {
				for (KrollDict prop : properties) {
					String key = TiConvert.toString(prop, "key");
					String value = TiConvert.toString(prop, "value");
					propertiesHash.put(key, value);
				}
			}

			Crashes.trackError(new Exception(exception), propertiesHash, null);
		} catch (Exception e) {
			TiAppCenterUtils.logError("Failed to track error: " + exception);
			TiAppCenterUtils.logError(android.util.Log.getStackTraceString(e));
		}
	}

I haven't gotten a chance to look at iOS yet. I'll fork your repo and submit a PR if you don't get to it first.

@justintoth
Copy link

The App Center iOS SDK doesn't support the trackError method yet, so I ended up taking your suggestion and using their Web API instead on iOS, which works great. https://docs.microsoft.com/en-us/appcenter/diagnostics/upload-crashes#upload-a-crash-report

@drauggres drauggres added the enhancement New feature or request label Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants