0

I Would like to open my app from safari, i am new with working with iOS and mobile application development. My Website is written in PHP, And i Am Using Objective-c for iOS development.

1 Answers1

0

Ow figured it out was a mistake of not refreshing app here is an example of switching from browser totally using javascript

window.location = "myApp://";

This example call app to an iframe so as to preserve the state of the website: still in javascript:

    var frame = document.createElement('iframe');
            frame.src = 'myApp://';
            frame.style.display = 'none';
            document.body.appendChild(frame);

            // avoid unnecessary iframe on the page

            setTimeout(function() { document.body.removeChild(frame); }, 4);

Note that on this examples i have not put any parameters yet which would be like:

myApp://params

Objective-c End Looks more like this:

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options 

Still have a long way to go but will get there thanks for you help.