Custom URL scheme starting with http not working

I used the custom url scheme in the application. I successfully redirect from safari to my application. How I made the URL scheme "appname". Check out http://prntscr.com/2cjx0p .

I need to use a solution like ios url redirect from mail to app , but I'm not sure how to set a cookie.

I found that I must first set a cookie for the server http://myappname.com "in my application. But how do I do this?


Background:

I can use it, for example, by typing "appname: //" in Safari, and I am redirected to my application.

Now I have to share this with the mail. And the requirement is to open the application from mail. Thus, I also set this link for clickability in the body of the message. But since it starts with "appname: //", I am not redirected to my application. This means that this link should begin with "http: //".

Then I set "http" instead of "appname" in the URL scheme and exchange that text again. therefore it will look like "http: //". But by typing this, it does not redirect it to my application.

+7
ios iphone cookies url-scheme
source share
3 answers

I decided this ...

What I did was having a live url containing the Test.html page. In this case, the script is written below ..

<script type="text/javascript"> window.location = 'appName://'; </script> 

Now, using a common URL, it looks like http://demo.com/test.php/?d= '. And from the mail I opened this link, and it has already been redirected to my special application page.

I found the biggest help HERE .

+4
source

In the question that you are linking to the code, the link opens:

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.myApp.com/appInstalled"]]; 

Safari opens on the specified page of your server. The only thing the page does is set a cookie and then redirect back to the application (using the custom URL scheme). This needs to be done on the downloadable webpage (therefore using the returned headers and HTML).

The purpose of this is to keep the cookie in Safari (i.e. where it will be needed in the future), and in the future it should have an expiration date. I don’t think you can save the cookie in Safari from the application (sandbox).

You will see the Safari switch, but it should immediately return to your application.


You should be able to redirect using javascript on the returned HTML page:

 <script type="text/javascript"> <!-- window.location = "gameswap://?d" //--> </script> 

or with HTML (in the section):

 <meta http-equiv="refresh" content="0; url=gameswap://?d" /> 
+6
source

Use this format if you do not want to use http.

Set this in your URL scheme

 www.my.app 

Communication format for opening an application

 www.<characters>.<characters>://<characters> 

eg,

 www.my.app://open 
+1
source

All Articles