Frage

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?

War es hilfreich?

Lösung

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;
?>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top