Lock screen orientation on Mobile, but not Tablet

Hi guys,


Is there a way to lock screen orientation on Mobile devices only, but not Tablet?


Thanks,

HI Minh,

You have option to device detection based on this you can write your comdtion


Regards

Rahul

Hi Minh,

Please try out the below mentioned implementation steps for your use-case...

Steps:

1) Add the below mentioned declaration statement in the Extensibility Configuration Property of the application module

{
    "plugin" : {
        "url": "https://github.com/apache/cordova-plugin-screen-orientation.git"
    }
}


2) Introduce an OnInitialize Handler in the Layout and the LayoutBlank Block

3) Then Handler Action flow will be defined as shown below

4) Use JS code as per your requirement

screen.orientation.lock('landscape');

OR

screen.orientation.lock('portrait');

5) Re-build/Generate the application installer file

6) Re-install the application and check the implementation in the native device.


Hope this helps you!


Regards,

Benjith Sam