Custom URL Scheme for Meteor/Cordova Apps


Anyone ever get custom URL schemes working in their Meteor App?!topic/meteor-talk/bQTWv_lmKYg

I’m having trouble getting this plugin to work, just thought I’d ask around.


Did you solve it? Stuck with the same thing


This is the version I am using (from my package list):


I am using it like that and it works fine so far:

document.addEventListener('deviceready', function() {
    handleOpenURL = function handleOpenURL(url) {
        var url = url.replace("myapp://", "http://meteor.local/"); 
        Meteor.defer(function() {
            window.location.href = url; 


@benjick I was able to get things to work, but I found that this plugin isn’t compatible with the WizCorp Facebook Plugin. The issue is actually a Cordova one where both apps try to add a custom url scheme to the iOS .plist file and only the first one gets it’s entry in. You can read about it here: The best thing to do in the meantime is to simply edit the .plist file manually before building in Xcode to add both the FB and the custom entry. Then things work fine.

I also found that sometimes the handleOpenURL function is called really fast, like before Meteor is ready to handle it, so I put this JS in the head of my page to store the url off of the window object that I check for when Meteor is ready

// Handle opening the native apps from a custom url scheme
if (window && !window.handleOpenURL) {
  function handleOpenURL(url) {
    if (window) window.invokeURL = url;


anyone managed to trigger the handleOpenURL function on a cold start (aka : when the app isn’t in background mode) ?
I can’t figure out how to do this, aside from that the plugin works great.


Looks like it’s currently a bug when the plugin is used with Meteor. See here:

Has been fixed for Android, but iOS is still waiting.


FYI for anyone coming across this post, I got this working just fine with iOS and no hard-coded site url:

import {Meteor} from 'meteor/meteor';

Meteor.startup(() => {
  global.handleOpenURL = url => window.location.replace(url.replace('myappname://', '/'));


hi, @markoshust @MaximeB @benjick @alpjor

any achievement solved?

I need to do something similar open from the mobile app, a page say chrome or safari is possible is possible with Eddy Verbruggen’s library?


I’m going to check out Cordova’s universal links plugin. It looks much more advanced and supports deep linking out of the box.