This package enables deep linking to cordova or browser app.
$ meteor add dispatch:deep-link
Edit your mobile-config.js
App.configurePlugin('cordova-plugin-customurlscheme', {
URL_SCHEME: 'mycoolapp'
});
Create an iosBanner
or have a link
for the user to click on - when the app recieves the link you can catch it like:
DeepLink.once('mycoolapp', function(data, url, scheme, path, querystring){
alert('Got some deep linked data...');
});
Have a look at the QA/Demo app
Thers added an extra api of helpers making it easy to send data to the app:
link(path, data)
generates a url stringbrowserLink(path, data)
(requires url to be set)open(path, data)
opens app using window.openiosBanner(path, data)
add/update ios banner meta tag
var myCoolApp = new DeepLink('mycoolapp', {
// Optional
appId: 'me.dispatch.qa.test.deep.link',
url: 'http://foo.com', // Homepage with intent support
fallbackUrl: 'http://meteor.com' // Only android
});
myCoolApp.link('', { foo: 'bar' }); // This will generate the url to the app
myCoolApp.open('', { foo: 'bar' }); // This will open via window.open
myCoolApp.iosBanner('', { foo: 'bar' }); // This will add/update the meta tag for ios users
// This will use base64 ejson to carry the data - because it contains nested data
myCoolApp.link('path', { foo: 'bar', date: new Date() });
// To create a browser intent
myCoolApp.browserLink('', { foo: 'bar' });
Read more in ADVANCED.md
Thanks goes to Eddy Verbruggen for his Custom URL scheme PhoneGap Plugin