Madhu Madhu - 1 year ago 85
Objective-C Question

How to get back from web view after some action is done there?

I am implementing the CCAvenue gate way in my application.
In which CCAvenue gateway is loaded in web view from my web site.

Now after Transaction is completed with Success/Failur page,How can i came to know and load my apps success page....
Please help me Friends

Answer Source

The easiest way would be for your web page to send a request with a custom scheme for example myapp://transactionSuccess and your app to handle this in the webView delegate:

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {

    NSURL *URL = [request URL];
    if ([[URL scheme] isEqualToString:@"myapp"]) {
        // handle the response
        NSString *host = [URL host];
        if ([host isEqualToString:@"transactionSuccess"]) {
            // show your custom screen
            return NO;

    return YES;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download