Here is my code.
UIImage *img = [UIImage imageNamed:@\"white.jpeg\"];
NSData *imageData = UIImagePNGRepresentation(img);
NSString *imageString = [imageData
replace + to %2B ios replace all + to " " space that make image invalid
also backend must handle it too
- (NSString *)base64String:(UIImage*)image {return [[UIImageJPEGRepresentation(image,1) base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed] stringByReplacingOccurrencesOfString:@"+" withString:@"%2B"];}