Link from app to site

I don’t know if I’m missing something but I have a link on my Android App, whenever I click on the link. It does not open it.

Ps: link is referenced with an element.

Please could someone help me understand what am I doing wrong?

Thank you so much,
Laurent Kouassi,

I feel there is far too little info. However, let’s start from here - did you add this to your Cordova Android App: ?

1 Like

Thank you so much @paulishca for your help but no, I have not added it yet. Could you please send me the installation instructions?

Starting with meteor add.

Thank you so much.

  1. External link like http(s)://www… or deep linking for mobile apps.

I’ll give you a custom (improved) version

meteor add cordova:cordova-plugin-inappbrowser@

In your client startup you add these lines:

if (Meteor.isCordova) { =

Then you can create a handler similar to this:

import { Meteor } from 'meteor/meteor'

const handleOpenUrl = (e, url) => {
  if (e) { e.preventDefault() }
  if (Meteor.isCordova && url) {
    const target = '_blank'
    const options = 'location=no,clearcache=yes,presentationstyle=formsheet,allowInlineMediaPlayback=yes,shouldPauseOnSuspend=yes,' +
      'closebuttoncaption=Close,toolbarcolor=#fafafa,hidenavigationbuttons=yes,hardwareback=no,closebuttoncolor=#666666,' +
      'disallowoverscroll=yes', target, options)

export { handleOpenUrl }

Then use above function where needed like so:

// example with actionsheet:

 if (tag) {
  , i => {
              if (i === 1) { console.log('do a query in activitree') }
              if (i === 2) { console.log('start followign this tag, add a record to follows') }
              if (i === 3) { handleOpenUrl(null, `${tag}`) } // this one
              if (i === 4) { this.setState({ infoModalOpen: true }) }

or like so:

<span onClick={e => handleOpenUrl(e, url)}>Dari-Dada</span>
  1. Internal link in the app (routing). You need to use a (the) router in order to navigate inside the app. Ex. for React you would use something like Home where Link is imported from react DOM or router DOM.
1 Like

Thank you so much @paulishca. That was really helpful.
Love you hahaha.

1 Like