内部iPhone购买/查看App iAd(不使用iAd框架)?

时间:2023-01-12 17:51:03

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 version for my pro version, and I would rather have something cool then just a link to the App Store)

我喜欢Apple购买iAds应用程序的方式。它们看起来很棒,它们非常适合用户导航。我有一项非常艰巨的任务。我想克隆此界面并将其应用到我自己的应用程序而不使用iAd框架,因此可以离线访问此“广告”。这意味着它不会使用iAd框架,而是需要将此页面中的数据存储在应用程序中。这也意味着他们0.99购买按钮不会购买和下载应用程序,而是会打开一个对话框,询问用户是否要打开iTunes App Store。 (我会将这个广告放在我的专业版免费版中,我宁愿有一些很酷的东西,只需要一个指向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.

我下载了iAd Producer,我能够为我的应用程序创建iAd,将其导出到Safari中,然后将其保存为webarchive。但是我不知道如何将webarchive保存到我的应用程序中,我不知道如何修改购买按钮以将其链接到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?

我希望它不会在web格式中,而是在.h和.m文件中,所以我可以将它添加到我的项目中。是否有我正在寻找的ViewController模板?我应该创建自己的模板还是应该尝试抢救Apple?

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

我太疯狂了,这是不可能的?谢谢你的帮助!

1 个解决方案

#1


0  

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

1:是的,你可能太疯狂了。是什么让你认为Apple会通过黑客入侵的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:

2:在我的应用程序中,我使用以下代码显示HTML文件。您应该能够使用类似的东西来显示您的Web存档:

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];

#1


0  

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

1:是的,你可能太疯狂了。是什么让你认为Apple会通过黑客入侵的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:

2:在我的应用程序中,我使用以下代码显示HTML文件。您应该能够使用类似的东西来显示您的Web存档:

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];