开发者

In-house iPhone Purchase/View App iAd (without using iAd framework)?

I love the way that Apple has the application purchase iAds. They look great and they are great for the user to navigate with. I have a really hard task. I want to clone this interface and apply it to my own application without using the iAd framework, so this 'ad' can be accessed offline. This means that it wouldn't use the iAd framework and it would need to store the data from this page in the application. This would also mean that they 0.99 buy button would not buy and download the application but instead it would open a dialog box that asked the user if they would like to open the iTunes App Store. (I would be putting this ad in my free v开发者_Go百科ersion for my pro version, and I would rather have something cool then just a link to the App Store)

I downloaded the iAd Producer and I was able to create the iAd for my application export it into Safari and then save it as a webarchive. However I do not know how to save the webarchive to my application and I do not know how to modify the purchase button to have it link to the iTunes App Store.

I was hoping that it wouldn't be in webformat but instead in a .h and .m file so I just could add it to my project. Is there a ViewController template out there for what I am looking for? Should I create my own template or should I attempt to salvage Apple's?

Am I too crazy and this is just impossible? Thanks for your help!


1: Yes, you probably are too crazy. What makes you think Apple will approve your app with the hacked iAd?

2: In my app I used the following code to display an HTML file. You should be able to use something similar to display your web archive:

NSString *path = [[NSBundle mainBundle] pathForResource: @"Welcome Screen" ofType: @"html"];
NSFileHandle *readHandle = [NSFileHandle fileHandleForReadingAtPath: path];

NSString *htmlString = [[NSString alloc] initWithData: [readHandle readDataToEndOfFile] 
                                             encoding: NSMacOSRomanStringEncoding];

textDisplay.scalesPageToFit = YES;
textDisplay.contentMode = UIViewContentModeRedraw;
[self.textDisplay loadHTMLString: htmlString 
                         baseURL: [NSURL fileURLWithPath: [path stringByDeletingLastPathComponent]]];
[htmlString release];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜