react native library in android can use "getCurrentActivity()" to replace "this"
final Activity activity = getCurrentActivity();
And In ios How can use to replace "self" to get current UIViewController
react native library in android can use "getCurrentActivity()" to replace "this"
final Activity activity = getCurrentActivity();
And In ios How can use to replace "self" to get current UIViewController
For "current UIViewController" you most probably needs RCTPresentedViewController function from RCTUtils.h file:
#import <React/RCTUtils.h>
// ...
UIViewController* vc = RCTPresentedViewController();
// ...
Note: Very old RN versions do not has this API, but it can be easy implemented by hands, implementation is easy enough: RCTUtils.m
On iOS - unless you use wix's react native navigation - there is generally only one UIViewController, instantiated in your AppDelegate.
1st question: Why do you need your app UIViewController ?
if you really need to access it, here is a suggestion : UIApplication.sharedApplication().window.rootViewController (this code might not work for complex native setup, but for simple cases, it should give you your app ViewController)