nordnet / cordova-universal-links-plugin

[DEPRECATED] - Cordova plugin to support Universal/Deep Links for iOS/Android.
https://github.com/nordnet/cordova-universal-links-plugin/issues/160
MIT License
349 stars 526 forks source link

iOS universal linking not working with meteor #111

Closed EuropeanUniversityFoundation closed 5 years ago

EuropeanUniversityFoundation commented 7 years ago

My next app has to support universal linking for both iOS and android. For android everything is working but for iOS I just can't get it to work. I'm using Meteor and react to develop my app.

For Meteor we have to use a "mobile-config.js" file to generate a config.xml file. I'm using the following code: (I have changed my bundle ID and team ID in the pasted code for security

App.info({
  id: 'com.feu.project.sasmus',
  name: 'My website',
  version: 0.2,
  ....
});
....
App.appendToConfig(`
  <widget id="com.feu.project.sasmus" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <universal-links>
      <ios-team-id value="8GFQSAHBBL" />
      <host scheme="https" name="website.eu.meteorapp.com" event="didLaunchAppFromLink"/>
    </universal-links>
  </widget>
`);

The "didLaunchAppFromLink" is living in my main.js file and is implemented in the following way:

componentWillMount() {
    if (Meteor.isCordova) {
      universalLinks.subscribe('didLaunchAppFromLink', function(eventData){
        browserHistory.replace(eventData.url);
      });
    }
  }

(this is working for android so I assume this will also work for iOS?)

I created an "apple-app-site-association" file and place this into my root folder. I did this in the following way:

{
  "activitycontinuation": {
    "apps": [
      "8GFQSAHBBL.com.feu.project.sasmus"
    ]
  },
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "8GFQSAHBBL.com.feu.project.sasmus",
        "paths": ["*"]
      }
    ]
  }
}

This file is downloadable like apple wants it via the following link: https://website.eu.meteorapp.com/apple-app-site-association (this won't work here because I changed the website name for security reasons)

So far as I know I completed all the tasks and I don't see where I did wrong. Can anyone help me?

mackbrowne commented 7 years ago

Hello @EuropeanUniversityFoundation how did you end up fixing this? I'm currently working through the issue right now and having the same effect. Android is working with meteor-cordova, ios will only open in safari.

I've already tested other urls, for example youtube urls will open the app in whatsapp, but slack will open safari still. So I've at least ruled out that universal links do in fact work for the way I am clicking them on my phone, just not with my app.

sirpy commented 6 years ago

Maybe you are using cordova facebook4 plugin, it has a bug, it catches all incoming urls and doesnt correctly return FALSE(NO) when the url is not handled by this plugin. i've experienced this issue using the firebase dynamiclinks plugin. we solved this by simply creating a window.handleOpenUrl = function(url){} this is a feature of cordova for ios (atleast for the latest versions), i guess this link catcher runs before others so you can parse the universal link there.

sirpy commented 6 years ago

any one tried my solution?

crooy commented 6 years ago

@sirpy did you file a bugreport with the cordova facebook4 plugin? could you share the link?

nordnet-deprecation-bot commented 5 years ago

👋 Hi! Thank you for your interest in this repo.

😢 We are not using nordnet/cordova-universal-links-plugin anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork.

🔒 This will now be closed & locked.

ℹ️ Please see #160 for more information.