Screen Orientation Native Plugin

Hello, I’m trying to implement This Plugin into my app but I’m finding that either the docs are wrong or I am doing something completely wrong. When I download the plugin and then try to import the component with

import { ScreenOrientation } from 'ionic-native';

I get this error:

TypeScript error: /var/www/html/myApp/app/services/video-service.ts(4,10): Error TS2305: Module ‘"/var/www/html/myApp/node_modules/ionic-native/dist/index"’ has no exported member ‘ScreenOrientation’.

You might need to bump the version of ionic-native in your project. The latest version 1.3.10, so please upgrade.

Looks like that fixed the error. Thanks for that!

Resurrecting this thread because this plugin is giving me problems again.

@mhartington Is it not supported on IOS anymore? Works perfectly on Android with no problems. Building on IOS brings up this console error. Not entirely sure what to make of it.

[Error] Unhandled Promise rejection: (7)
consoleError (zone.js:461)
_loop_1 (zone.js:490)
drainMicroTaskQueue (zone.js:494)
g (es6-shim.min.js:11:1948)
(anonymous function) (es6-shim.min.js:11:1878)
promiseReactionJob
[Error] Error: Uncaught (in promise): EXCEPTION: Error in build/pages/live/live.html:3:22
ORIGINAL EXCEPTION: TypeError: undefined is not an object (evaluating ‘util_1.get(window, pluginObj.pluginRef)[methodName].apply’)
ORIGINAL STACKTRACE:
callCordovaPlugin@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:93433:63
file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:93573:37
value@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:93636:66
appSetup@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:944:57
ngOnInit@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:528:35
detectChangesInternal
detectChanges@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:32570:35
detectChanges@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:32675:48
detectViewChildrenChanges@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:32596:32
detectChangesInternal
detectChanges@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:32570:35
detectChanges@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:32675:48
detectChanges@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:33027:78
fireWillEnter@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:63546:35
_postRender@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:61880:43
file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:61829:34
file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:62219:21
loaded@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:63523:13
file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:62202:24
invoke@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/zone.js:323:34
onInvoke@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:38069:47
invoke@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/zone.js:322:43
run@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/zone.js:216:50
file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/zone.js:571:61
invokeTask@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/zone.js:356:43
onInvokeTask@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/app.bundle.js:38060:51
invokeTask@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/zone.js:355:55
runTask@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/zone.js:256:58
drainMicroTaskQueue@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/zone.js:474:43
g@file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/es6-shim.min.js:11:1947
file:///var/containers/Bundle/Application/1A3BDE98-2910-4953-A6F3-6E6AC06293DC/Drumeo%20Live.app/www/build/js/es6-shim.min.js:11:1877
promiseReactionJob@[native code]
ERROR CONTEXT:
[object Object] — zone.js:537
consoleError (zone.js:463)
_loop_1 (zone.js:490)
drainMicroTaskQueue (zone.js:494)
g (es6-shim.min.js:11:1948)
(anonymous function) (es6-shim.min.js:11:1878)
promiseReactionJob

Could you open an issue on the ionic-native repo. We’ll take a look at whats going on.
Thanks