By using this design, you may hardcode the web server URL into the mobile web app so that your user does not have to remember what is your URL. The other advantage is that it is able to handle the Push Notification from the server.
The following article provides all the necessary sample codes on how to implement it.
http://developer.apple.com/library/ios/#DOCUMENTATION/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/DisplayWebContent/DisplayWebContent.html
Things that you may try out
- Drag a text field, a button and a WebView to the iOS screen.
- The UIWebView is referencing by "browser_ctl".
- The button is referencing by "go_btn".
- The text field is referencing by "url_txt".
- Finally, link the button click event to the following method:
NSString *fullURL = self.url_txt.text;
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[self.browser_ctl loadRequest:requestObj];
}
No comments:
Post a Comment