Hi there!
I was working with wixLocation.to(mailto: ) and would like to use this deeplink logic also for wixLocation.to(instagram:…) and other social media platforms. Unfortunately, somehow this is not working for me. Can someone help me figure out how to open a link directly in a mobile app?
Thanks a lot for your help!
1 Like
Share your link/code here… Then I can check what’s the issue.
Thanks so much!
What I am doing is that a user can set up a profile and create a redirect to his/her social media profiles. Here you can see one of the redirect commands I coded. This works all fine. The problem I have is that wixLocation.to() does not open the link in the mobile app on the phone I visit the page with. It only opens in the same browser window. I know that [wixLocation.to(mailto:](wixLocation.to(mailto:) …) opens in the mail application so I am trying [wixLocation.to(instagram://](wixLocation.to("instagram://) …) (see below) but it is not working.
So my problem is that I have an instagram link and would like to open it in the mobile app on my phone but I am somehow not able to do this. Thanks for your help with this!
//REDIRECT to Instagram PROFILE
if(RediriectPlatform === "InstagramProfile"){
//Search for Instagram Link in Database Collection
wixData.query("MemberProfileData")
.eq("cardActivationCode", thisUser.cardActivationCode)
.find()
.then( (results) => {
let items = results.items;
let item = items[0];
let InstagramProfileName = item.priority1Text; //Priority1Text is the column name of Instagram in the Database
wixLocation.to("instagram://user?username=_" + InstagramProfileName);
})}
Try giving the full Instagram link inside “” for testing. It will work and if it works ,I guess you are having some syntax error. And also I am not sure Instagram:// works like mailto: works . The error is definitely there.
I really appreciate your help! Thanks a lot!
Putting the instagram link inside “” redirects me to the profile but only in the mobile browser. It does not switch to the mobile app. I am wondering if there is a way to open links in “external” apps?!
Normally, I would simply code window.open(“URL”, “_self”) in HTML but I could not find the right command in wix. Most people in the forum write that it should be wixLocation.to() but I don’t get it working…
I guess it is because of ur phone setting. In Android there is an an option to always open using a particular app. So if it was selected like that before it might only using the browser. I was bake to open whatapp in my Android phone just using the normal way though.
Ok thats great to know! Then I will search the problem in my browser settings! I was testing it only in Safari on the iPhone but I will try if it works already on Android. Maybe I can figure out sth! Thanks a lot!
If you have any more ideas please let me know! I also tried it with an iFrame, so far without success…