Question

I am trying to implement URL Schemes in my iPhone.

Actually i Want to open a transaction page in my iPhone application. It opens in some browser lets say i opened http:www.xxxx.com. Now it has some php code written at backend. There is a submit button. I submit , it process the php code and do obtain some response.

Now I want to open the application again and get that response. How can I call my application from my php code of that webpage I called and pass that response?

Was it helpful?

Solution

you must add url scheme in your application. Go in Xcode to your target -> info->URL Types and create an url scheme like "myapp". In your app delegate implement the -canOpenUrl... method and return yes when you want your app to launch.

On your php side, you will need to tell the browser to open the address myapp://dataTopasstoYourApplicationThatYouCanParseInTheCanOpenURLMethodInYourAppDelegate

basically you do this with some javascript like location.somethingIDontRemember... = myapp://... or in PHP with header location

<?php
header('Location: myapp://whatYouWant');
exit;
?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top