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

PLAT-6370 unity support #1088

Merged
merged 1 commit into from
May 6, 2021
Merged

PLAT-6370 unity support #1088

merged 1 commit into from
May 6, 2021

Conversation

kstenerud
Copy link
Contributor

Goal

Expose BSGBreadcrumbTypeValue and BSGBreadcrumbTypeFromString via BugsnagBreadcrumb+Private.h

This is needed to support bugsnag/bugsnag-unity#234

Testing

Re-run unit and e2e tests

@kstenerud kstenerud requested a review from nickdowell May 5, 2021 13:28
@kstenerud kstenerud changed the base branch from master to next May 5, 2021 13:28
@github-actions
Copy link

github-actions bot commented May 5, 2021

Infer: No issues found 🎉

OCLint: No issues found 🎉

Bugsnag.framework binary size did not change - 1,125,144 bytes

Generated by 🚫 Danger

@nickdowell
Copy link
Contributor

This has introduced a lint warning, and I'm not sure that the introduction of an "unknown" string is desirable.

Maybe the Unity layer could deal with the NSDictionary representation which can be accessed via -[BugsnagBreadcrumb objectValue] ?

@kstenerud
Copy link
Contributor Author

I'd rather avoid using dictionary lookups to get internal values and instead make use of the type checker and type bindings. Otherwise we have to manually keep everything in sync across multiple projects, and that's asking for trouble.

Comment on lines 23 to 25
#ifdef __cplusplus
extern "C" {
#endif

NSString *BSGBreadcrumbTypeValue(BSGBreadcrumbType type);
BSGBreadcrumbType BSGBreadcrumbTypeFromString( NSString * _Nullable value);

#ifdef __cplusplus
}
#endif

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use the FOUNDATION_EXPORT macro to take care of the extern "C" dance thereby tidying up the code a bit:

Suggested change
#ifdef __cplusplus
extern "C" {
#endif
NSString *BSGBreadcrumbTypeValue(BSGBreadcrumbType type);
BSGBreadcrumbType BSGBreadcrumbTypeFromString( NSString * _Nullable value);
#ifdef __cplusplus
}
#endif
FOUNDATION_EXPORT NSString *BSGBreadcrumbTypeValue(BSGBreadcrumbType type);
FOUNDATION_EXPORT BSGBreadcrumbType BSGBreadcrumbTypeFromString(NSString * _Nullable value);

@kstenerud kstenerud merged commit 1461cf0 into next May 6, 2021
@kstenerud kstenerud deleted the 6370-unity-support branch May 6, 2021 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants