0

im trying to launch my app when user taps on link on email .. i've seen many posts like this but i can't seem to get it to work .. there's a problem i've been encountering, if the link i send is https://www.google.com (or any other valid websites), when i tap on the link, it works. It launches safari then goes to the site.. but if i replace it with my urlScheme, the body in the email appears to be not read as a link .. by the way.. im creating the email message in the client side .. here is sample code..

Nsstring *htmlBodyWebsite = @“<a href=\”https://www.google.com\”>Click here</a>"    < working
Nsstring *htmlBodyUrlScheme = @“<a href=\”myApp://\”>Click here</a>"    <not working
// when i enter in safari browser -  myApp:// << working

so it seems that i've setup urlscheme correctly since when i entered myApp:// in safari, it prompted me to launch my app.

so the process here is, i create the email message in the client side... then our server receives it and sends it via email to target recipient..

now when the recipient receives the email, here are some observations i've made..

when i send htmlBodyWebsite, it works fine. Using google chrome browser and in the email message itself, when i right click, then inspect, i would be able to find the referenced link with proper tagging

but with htmlBodyUrlScheme it doesn't have proper html tagging

thanks

hassan
  • 7,812
  • 2
  • 25
  • 36
  • and what does php tag is doing here ? – hassan Apr 19 '17 at 08:52
  • the server side is written in php – user7888262 Apr 19 '17 at 08:59
  • check the link https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html#//apple_ref/doc/uid/TP40007072-CH6-SW1 – NAVEEN KUMAR Apr 19 '17 at 09:45
  • @NAVEENKUMAR thnx .. but i've done that .. as noted above, safari can launch myApp successfully.. i think the problem could be related to the parameter string that i'm sending.. i've tried replacing \" with ' and removing \" entirely.. but still unsuccessful .. im receiving the email.. but it's not a link – user7888262 Apr 19 '17 at 09:59
  • Possible duplicate of [redirect to application if installed, otherwise to appstore](http://stackoverflow.com/questions/14048159/redirect-to-application-if-installed-otherwise-to-appstore) – iphonic Apr 19 '17 at 10:14
  • @user7888262 u r saying that what ur sending the link - its not triggering ur app? or safari. – NAVEEN KUMAR Apr 19 '17 at 11:05

1 Answers1

0

it seems to work if i tap on the link using the ios built-in Mail app.. neither using safari to open gmail.com nor gmail app doesnt make it resolve this issue..