diff --git a/Classes/BITTelemetryObject.h b/Classes/BITTelemetryObject.h index e63df7ba4d..09b1dda154 100644 --- a/Classes/BITTelemetryObject.h +++ b/Classes/BITTelemetryObject.h @@ -4,6 +4,5 @@ @interface BITTelemetryObject : NSObject - (NSDictionary *)serializeToDictionary; -- (NSString *)serializeToString; @end diff --git a/Classes/BITTelemetryObject.m b/Classes/BITTelemetryObject.m index 46c90e3435..ef5429bb0c 100644 --- a/Classes/BITTelemetryObject.m +++ b/Classes/BITTelemetryObject.m @@ -7,17 +7,6 @@ return [NSDictionary dictionary]; } -- (NSString *)serializeToString { - NSDictionary *dict = [self serializeToDictionary]; - NSMutableString *jsonString; - NSError *error = nil; - NSData *json; - json = [NSJSONSerialization dataWithJSONObject:dict options:0 error:&error]; - jsonString = [[NSMutableString alloc] initWithData:json encoding:NSUTF8StringEncoding]; - NSString *returnString = [[jsonString stringByReplacingOccurrencesOfString:@"\"true\"" withString:@"true"] stringByReplacingOccurrencesOfString:@"\"false\"" withString:@"false"]; - return returnString; -} - - (void)encodeWithCoder:(NSCoder *)coder { } diff --git a/Support/HockeySDKTests/BITSenderTests.m b/Support/HockeySDKTests/BITSenderTests.m index f55d104b04..5d63d70ec0 100644 --- a/Support/HockeySDKTests/BITSenderTests.m +++ b/Support/HockeySDKTests/BITSenderTests.m @@ -48,7 +48,9 @@ - (void)testRequestContainsDataItem { BITEnvelope *testItem = [BITEnvelope new]; - NSData *expectedBodyData = [[testItem serializeToString] dataUsingEncoding:NSUTF8StringEncoding]; + NSData *expectedBodyData = [NSJSONSerialization dataWithJSONObject:[testItem serializeToDictionary] + options:0 + error:nil]; NSURLRequest *testRequest = [_sut requestForData:expectedBodyData]; XCTAssertNotNil(testRequest);