
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
nativescript-screen-orientation
Advanced tools
A plugin to force change the orientation of a page programmatically in NativeScript. Supports both Android and iOS.
A plugin to force change the orientation of a page programmatically in NativeScript. Supports both Android and iOS. V2.0 works on iOS10.x, angular, xcode 8 and webpack.
var orientationModule = require("nativescript-screen-orientation");
function pageLoaded(){
orientationModule.setCurrentOrientation("landscape",function(){
console.log("landscape orientation set");
});
}
function onNavigatingFrom(){
orientationModule.orientationCleanup();
}
exports.pageLoad=pageLoaded;
exports.onNavigatingFrom=onNavigatingFrom;
import {setCurrentOrientation , orientationCleanup} from 'nativescript-screen-orientation';
@Component({moduleId:module.id,selector:"sample",templateUrl:"./sample.component.html"})
export class SampleComponent{
constructor(page:Page){
page.on("navigatedTo",function(){
setCurrentOrientation("portrait",function(){
console.log("portrait orientation");
});
});
page.on("navigatingFrom",function(){
orientationCleanup();
});
});
}
}
To allow force setting of orientation at page - level programmatically.
tns plugin add nativescript-screen-orientation
Allowed orientations are 'portrait', 'landscape' and 'all'.
In order to force an orientation, hook the respective setCurrentOrientation methods at the pageLoad/navigatedTo event of page, while make sure the method orientationCleanup is called at the navigatingFrom event of the page.
setCurrentOrientation(orientation,callback)
orientation is a string with possible values 'landscape' , 'portrait' and 'all' . Parameter callback is a function to call once the orientation is set, can be null.
orientationCleanup()
should be called on the navigatingFrom event if setCurrentOrientation is called, if this method is not called, can lead to inconsistent behavior.
In iOS , on iPad, if the plugin is not working, it is due to changes in the features supported by iPad. It is required for latest iOS to support multiple apps at the same time by screen sharing, which discourages locking of orientation in a particular mode. In order to make it work on iPad, set the key 'Requires Fullscreen' in xCode under app settings.
FAQs
A plugin to force change the orientation of a page programmatically in NativeScript. Supports both Android and iOS.
The npm package nativescript-screen-orientation receives a total of 14 weekly downloads. As such, nativescript-screen-orientation popularity was classified as not popular.
We found that nativescript-screen-orientation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.