Google Adsense within native cocoa-touch iphone app - iphone

My planned iphone application will work a remote https web service quite hard so until a user decides to upgrade from the free to pro version of my app I need to generate a trickle of click revenue per free user.
I would like to embed a single line adsense widget within a native cocoa-touch iPhone application. The UI control I have in mind might not exist but would work something like this. The control would occupy a fixed portion of my application's default view and would be initialized by my code and provided with key words determined by my application. The control would then periodically ping Google's adsense system and display a single clickable advert link.
If the user was interested in a link a click would result in an exit of my application followed by the opening of the advertiser's link in Safari.
Has anything like this been done before?

You have to use a UIWebView with a Adsense unit inside it. I think when you are setting up a ad unit you can enter keywords.
This is most probably a violation of their terms, though. It may be a better idea to try using something else like http://www.admob.com/.

Since AdSense requires the content of the page it's on to serve up relevant ads, you're likely to get nothing but PSA ads, since Google can't crawl your app.
And like Isaac says, I'm sure it's against the AdSense terms.

Google's Mobile Adsense is on the run:
TechCrunch article

Related

Iphone application using webview

I've created a web application using asp.net. I customized it form mobile(jQuery Mobile) .
I created an iphone application that has a web view that shows the website.
Is this will be applied by Apple to publish this application???
Regards,
Moayyad
If the only purpose of the app is showing the webview with the website, and it does absolutely nothing else, then it will most likely be rejected. However, if showing the website is just a small part of its functionality, and it does some other useful things as well, then using a webview for displaying your own website is OK, as far as I know.
Note, however, that I/we can only make assumptions and guesses. Nobody except Apple knows what exactly will happen to your app - there are numerous cases when an app was rejected for a feature which another approved app had, so there are inconsistencies in the AppStore approval policy of Apple. Don't expect anything.
I don't think so. They prefer use of HTML5 in webapp. Try to review the Apple guidelines for building web app.

Is it possible to create a full screen web app on iphone/ipad without adding it to the home screen first?

I know I can use the apple-mobile-web-app-status-bar-style meta tag and after adding the web page to the home screen, it will run the app in full screen mode.
My question is if there is any tag, css or javascript I can use to tell mobile safari to do it directly, without having the user adding to the home screen first?
You could consider something like PhoneGap that deploys a webapp as a native iphone application. It would also allow you access to things like the accelerometer via javascript calls.
Currently, and sadly, this can't be done :(
There is a way of automatically installing 'webclips' on your idevice.
You do this by deploying a profile payload to your device (.mobileconfig file).
Payloads can be signed or unsigned, for testing purpose unsigned profiles will come up as Insecure.
https://developer.apple.com/library/ios/featuredarticles/iPhoneConfigurationProfileRef/Introduction/Introduction.html
The advantage using a profile like this is that you can set it so the user cannot remove the 'webclip' in the standard way, having to remove the profile to remove the app. You can also protect this with a PIN.
One reason I didn't use this method for registering my apps was that I couldn't get it working offline with appcache manifests (iOS6.x), however this may have improved since iOS7.x

Android, Iphone app with JS and HTML

I have read some post about apps programming for Iphone and Android, but I have one question. Is it posible when there is a mobile website optimized for mobile phones, that I can create apps for Iphone, Android, Win 7 and Blackberry, that only statrts the browser as instance and display the mobile website? What do you think, is this ok? Do you have any ideas or examples for that kind of apps? I mean this is not an app, that should be has access to the hardware of the phone, only web app.
Thanks
Nik
This would work.
You could create an app that consists merely of a webview into which you load your content. The content could be loaded over the mobile network or be stored locally.
However most users (including yours truly) strongly dislike apps that merely present a single website to the user, because of the long delays if the content is loaded over the mobile network every time and because the UI is, in many cases, very different to what the he or she is used to from native apps.
Most users fail to see the need for a specialized app just to visit a website which they could as well keep as a favorite in their mobile browser. On the iPhone, you may even add favorite websites as icons on your homescreen, so there is no need for apps presenting a single website at all.
It's not only possible, such things are already done. One example I know of is cookd, a restaurant guide for Vienna. But there are some constraints; for example, cookd requires GPS data for the "Nearby" option; on my Android phone (HTC Legend), this is possible when I open the web page directly in the browser (the browser asks if I want to allow cookd.com to get this info); but the same webpage, running in an application that does nothing more than display the browser component, cannot do that. To fix that, they would have to build GPS reception into the app and forward this info to the browser component.
O'reilly has a fantastic article about this:
http://building-iphone-apps.labs.oreilly.com/
This is a little bit directed to iPhone only, but will give you a good overview about the topic and possibilities.

Can UIWebView replace a Safari?

Can we build an Application using UIWebView that will entirely mimic the Safari Browser?
Are there any cases where UIWebview can not do what that can be done in Safari?
For one thing, you have a separate cookie storage per app. So if a user has some preferences at site X within Safari, it won't have those preferences at site X within your browser, and vice versa. Apart from that a UIWebView is very much like the real thing.
You cannot easily build an application that mimics the Safari browser using the public API exposed by UIWebView component. For one thing, please look at the UIWebView delegate methods. When you have frames inside the page you want to load, you may have a hard time telling if a user has clicked inside an iframe/frame or clicked on a link in the main document.
Dealing with authentication to site with invalid certificates is also hard with the UIWebView component, especially when the site with invalid certificate is reached by clicking a link inside an iframe.
Rendering content in UIWebView will be much slower than it is in Safari.
Safari's Javascript engine uses a "just in time" compiler. It takes the incoming Javascript code and transforms it on the fly into machine code that can run directly on the iOS device's ARM CPU. This allows Javascript code to run at a speed similar to a native app's code.
The problem is that Apple doesn't trust third-party developers with this power. If a third-party app had the power to convert Javascript into machine code and run it, that app would also have the power to download and run other pieces of machine codeā€”and Apple would never get the chance to review that code. Once App Review approved it, (developers/hackers) can change the downloaded code into something that logs your passwords or something. And there's no way to grant this power only to UIWebView and not to other parts of an app, because UIWebView runs in the same process as the developer's code.
So basically Apple forbids this because allowing it would break the security provided by the App Store and make iOS more vulnerable to attack. They can allow it for Safari because they control what Safari does, but they can't trust others not to abuse that ability.

How to direct my users to my iPhone enabled site?

I have made an iPhone friendly version of my site, that I want to direct my users to.
The big question now is how to direct my users to this site. There are a few alternatives:
Redirect the user based on the user agent, e.g. if the user agent sent by the browser contains "iPhone" or android or whatever.
If the user agent matches the above criteria, display a notice on the original site telling the user that an iPhone version is available.
Which one is the most user-friendly? Another dimension to consider is the SEO aspect. How do I show Google that my site is iPhone capable?
I recently found some relevant posts on the Google Webmaster Tools homepage:
Help Google index your mobile site
Running Desktop and mobile versions of your site
phidah above has some good links, but remember: always include a link to view the desktop version. nothing is more frustrating than a limited mobile version when the desktop works just fine on the iPhone. there are exceptions, of course - for example if your desktop is mostly flash :p
This strikes me as more of a user experience question than a programming design decision. I would build either solution depending on what makes sense for your site, and your users. If you do go the redirect route, and the content on both version of the site are the same, I wouldn't worry to much about google. If the content is different, I would make sure both sites are visible to googlebot.
Nearly every site that I visit that has a mobile/iPhone version that just redirects me automatically, and then at the bottom there is a link to go to the full version if I want.
For SEO I don't think this would hurt anything, since web crawlers aren't run on mobile devices.
Check out the links below.
web dev kit
and for css info on detection
css Info
it is some of the better info I have found, hope it helps.
Kirk