How to open epub file in iBooks using ANE(iOS) ?
hello,
I tried to open epub file in iBooks using Native Extensions.
But, AIR app has crashed when calling ANE method (following: OpenEpub).
Have problems with how to access the epub file?
Or another problem?
MacOS:10.6.8
Xcode:4.2
FlashBulder:4.6
FlexSDK:4.6.0(default bundle version)
TestDevice:1st iPad (OS 5.0.1)
iOSNativeCode(this code works on native iOS app):
#import <UIKit/UIKit.h>
FREObject OpenEpub(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]){
id delegate = [[UIApplication sharedApplication] delegate];
UIWindow* window = [delegate window];
UIButton* uiBtn = [[[UIButton alloc] init] retain];
[window addSubview:uiBtn];
NSString *fileToOpen = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"epub"];
NSURL *url = [NSURL fileURLWithPath:fileToOpen];
UIDocumentInteractionController *docController = [UIDocumentInteractionController interactionControllerWithURL:url];
[docController presentOpenInMenuFromRect:CGRectZero inView:uiBtn animated:true];
[docController retain];
const char *str = "Success";
FREObject retStr;
FRENewObjectFromUTF8(strlen(str)+1, (const uint8_t *)str, &retStr);
return retStr;
}
ANE packaging directory:
ane/
extension.xml
key.p12
platform/
iOS/
iOSNativeCode.a
library.swf
test.epub
extension.xml
<extension xmlns="http://ns.adobe.com/air/extension/3.1">
~~~~
Thanks!
