Open Links in New Browser Requires Cordova-Plugin-Device

Hi,
I’m trying to make links in my app open in a new browser (running on ios).
I’m using the coffeescript from here which is supposed to do this:


but it requires “device.platform” from cordova.
I have tried to add this plugin but get the error below.

If anyone know a better way to make links open in browser, or what I need to do to get this coffee script to work, I’d much much obliged.

Best, -Duncan.

Duncans-MBP-2:MyLC.ios Duncan$ meteor add cordova:cordova-plugin-device@https://github.com/apache/cordova-plugin-device.git#c0987ae0a3245a6613f0b28b1a00f337b8b59c1a
Added Cordova plugin
cordova-plugin-device@https://github.com/apache/cordova-plugin-device.git#c0987ae0a3245a6613f0b28b1a00f337b8b59c1a.
Duncans-MBP-2:MyLC.ios Duncan$ meteor run ios-device --mobile-server XXX:3000
[[[[[ ~/METEOR/MyLC.ios ]]]]]

=> Started proxy.
=> Started MongoDB.

WARNING: You are testing your app on a remote device. For the mobile app to be able to connect to the local server,
make sure your device is on the same network, and that the network configuration allows clients to talk to
each other (no client isolation).

Your project has been opened in Xcode so that you can run your app on an iOS device. For further instructions, visit
this wiki page: https://github.com/meteor/meteor/wiki/How-to-run-your-app-on-an-iOS-device

=> Started app on iOS Device.
W20160325-16:36:32.877(0)? (STDERR)
W20160325-16:36:32.878(0)? (STDERR) /Users/Duncan/.meteor/packages/meteor-tool/.1.1.10.f0xwxk++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20160325-16:36:32.879(0)? (STDERR) throw(ex);
W20160325-16:36:32.879(0)? (STDERR) ^
W20160325-16:36:32.879(0)? (STDERR) ReferenceError: device is not defined
W20160325-16:36:32.879(0)? (STDERR) at cordova.coffee:2:14
W20160325-16:36:32.880(0)? (STDERR) at /Users/Duncan/METEOR/MyLC.ios/.meteor/local/build/programs/server/boot.js:249:5
=> Exited with code: 8

This is the solution that’s still working for me:

1 Like

did you use version 0.5.4 of the inappbrowser?

@julianmwagner Not sure that’s addressed to me, but I was at the time, yes. I’m now on 1.3.0.

It was, but I found my problem was that i did not include type : ‘navigation’ in the App Access Rules