Beispiel #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);
        }
        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;
        }