Keep screen awake

I need my app keep the screen awake in certain page. I looked in the documentation and get stuck till now. Is there any way to achieve this?

There are no direct settings for this in Fuse, so you’ll need to find how this is achieved in native code (Java and Objective-C), and then wrap that in a Uno class using Foreign code feature.

Ok thank you for giving me a lead. After learned a bit about foreign code from tutorial video on youtube and a thread on the forum , I finally achieve this by writing this single uno code

using Uno;
using Uno.Collections;
using Fuse;
using Fuse.Scripting;

using Uno.Compiler.ExportTargetInterop;

public class ScreenAwake: NativeModule {
  
  public ScreenAwake() {
    AddMember(new NativeFunction("setKeepAwake", 
      (NativeCallback)SetKeepAwake));
  }

  object SetKeepAwake(Context c, object[] args) {
    SetKeepAwake();
    
    return null;
  }

  [Foreign(Language.Java)]
  static extern(Android) void SetKeepAwake() 
  @{
    android.app.Activity rootActivity = @(Activity.Package).@(Activity.Name).GetRootActivity();

    rootActivity.runOnUiThread(new Runnable() {
      @Override
      public void run() {
        android.view.Window window = @(Activity.Package).@(Activity.Name).GetRootActivity().getWindow();
        window.addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
      }
    });
  @}

  static extern(!Android) void SetKeepAwake() {
    debug_log("KeepAwake Not supported in this platform");
  }
}

Great job, Riva!