Ejemplo n.º 1
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // create a new window instance based on the screen size
            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            var props   = new NSDictionary();
            var options = new NSDictionary();

            var url = NSBundle.MainBundle.GetUrlForResource("main", "jsbundle");

            //var url = NSUrl.FromString("http://localhost:8081/index.bundle?platform=ios");

            CFunctions.RCTRegisterModule(ObjCRuntime.Class.GetHandle(typeof(ToastExampleModule)));
            CFunctions.RCTRegisterModule(ObjCRuntime.Class.GetHandle(typeof(RandomNumberModule)));
            CFunctions.RCTRegisterModule(ObjCRuntime.Class.GetHandle(typeof(EventsModule)));

            RCTRootView rootView = new RCTRootView(url, new NSString("MyReactNativeApp"), props, options);
            var         vc       = new UIViewController();

            vc.View = rootView;

            Window.RootViewController = vc;

            // make the window visible
            Window.MakeKeyAndVisible();

            return(true);
        }
Ejemplo n.º 2
0
        public KSAMOnboardViewController() : base("KSAMOnboardViewController", null)
        {
            var props   = new NSDictionary();
            var options = new NSDictionary();

            var url = NSBundle.MainBundle.GetUrlForResource("main", "jsbundle");

            //var url = NSUrl.FromString("http://localhost:8081/index.bundle?platform=ios");

            CFunctions.RCTRegisterModule(ObjCRuntime.Class.GetHandle(typeof(KSAMOnboardModule)));

            RCTRootView rootView = new RCTRootView(url, new NSString("xxxx"), props, options);

            base.View = rootView;
        }
Ejemplo n.º 3
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // create a new window instance based on the screen size
            Window = new UIWindow (UIScreen.MainScreen.Bounds);

            // If you have defined a root view controller, set it here:
            // Window.RootViewController = myViewController;

            var options = new NSDictionary ();

            var url = NSBundle.MainBundle.GetUrlForResource ("main", "jsbundle");
            //var url = NSUrl.FromString("http://192.168.0.11:8081/index.ios.bundle");

            RCTRootView rct = new RCTRootView(url, new NSString("ReactNative"), options);
            var vc = new UIViewController ();
            vc.View = rct;
            vc.Init ();
            Window.RootViewController = vc;

            // make the window visible
            Window.MakeKeyAndVisible ();

            return true;
        }