简体   繁体   中英

PhoneGap screenshot plugin return base64 encoded string (iPhone)

I'm using PhoneGap & Sencha Touch to develop an app. I'm trying to get the app to take a screenshot of the current view and save that image to the photo album but also to return a base64 encoded string, which we'll use to share & email the image. I can't get the code to return the base64 encoded string. Can anyone see anything wrong in the code?

http://app.kodery.com/profile/360 ScreenShot.m the jsCallBack doesn't seem to receive anything.

Any pointers would be really helpful.

Thanks

Prad

It's much easier to help you if you put your code in the question rather than on another site. I don't think this line is correct:

 jsCallBack = [ NSString stringWithFormat:@"%@("%@");", successCallback, encodedString ];

The quotes around stringWithFormat are not correct, not sure if this is a problem with the tool you're pasting your code into, or the code itself. Also what is the size of imageData and what happens if you do an NSLog() for encodedString: NSString *encodedString = [imageData base64EncodedString]; Is there actually data there and it's not making it back to your JS? Or is their no data in the native code?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM