how to close inappbowoser in cordova -
apk file
<a class='btn btn-primary' onclick="window.open('http://somedomain/payment.php', '_system', 'location=yes');" >payment</a>
paymnet.php file
<div class="login-wrap"> <div class="login-html"> <input id="tab-1" type="radio" name="tab" class="sign-in" checked><label for="tab-1" class="tab"></label> <input id="tab-2" type="radio" name="tab" class="sign-up"><label for="tab-2" class="tab"></label> <div class="login-form"> <form action="" method="post" class="sign-in-htm"> <input type="hidden" name="furl" value=""> <input type="hidden" name="surl" value=""> <div class="group"> <label for="name" class="label">name</label> <input id="name" name="fullname" type="hidden" class="input" value=""> </div> <div class="group"> <label for="email" class="label">email</label> <input id="email" name="email" type="hidden" class="input" value=""> </div> <div class="group"> <label for="email" class="label">price</label> <input type="hidden" name="amount" value=""> </div> <div class="group"> <input type="submit" class="button" value="submit" name="submit"> </div> </form> </div> </div> </div> <?php require "instamojo.php"; if(isset($_post['submit'])){ $api = new instamojo\instamojo('token', 'api', 'https://test.instamojo.com/api/1.1/'); $name=$_post['fullname']; $amount=$_post['amount']; $email=$_post['email']; try { $response = $api->paymentrequestcreate(array( "purpose" => 'h-fm', "name" => $_post['fullname'], "amount" => $_post['amount'], "send_email" => false, "email" => $_post['email'], "redirect_url" => "http://test.com/" )); // print_r($response); $redirect=$response['longurl']; ?> <script type="text/javascript"> window.location.href = "<?php echo $redirect;?>" ; </script> <?php } catch (exception $e) { print('error: ' . $e->getmessage()); } } ?>
how redirect web app mobile app. payment working fine. want give close button . tried window.close . not working . tried ref.close(). not working. please me resolve issue .
simply using close() function of inappbrowser plugin provide facility close app .
var ref = cordova.inappbrowser.open('http://unitedwaymassbay.org/', '_blank', 'location=no'); ref.close();
here reference of function please read inappbrowser
Comments
Post a Comment