My iOS is using Bugsnag and I am trying to upgrade it from version 4.1.0 to version 5.
The new SDK breaks a function that was available in version 4.x:
[[[Bugsnag configuration] metaData] mergeWith:parameters];
Where parameters is of type NSDictionary
.
I couldn't find any substitute in the SDK, besides:
- (void)addAttribute:(NSString*)attributeName withValue:(id)value toTabWithName:(NSString*)tabName
But it does not provide the same functionality where value
could be a NSDictionary
itself. Moreover, it will also invoke [self.delegate metaDataChanged:self]
on every addition (highly inefficient).
After looking in the Github repository and seeing the difference in
BugsnagMetaData
between the versions, I found a way to restore this functionality. I wrote a category that extends the class:This function is able to accept NSDictionary that contains NSDictionary like before, and calls
[self.delegate metaDataChanged:self]
efficiently only when needed.