Ejemplo n.º 1
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method

            new System.Threading.Tasks.Task(() => {
                var srcPath = NSBundle.MainBundle.PathForResource("nodejs-project/main.js", "");
                CLib.StartNodeWithArguments(2, new string[] { "node", srcPath });
            }).Start();

            return(true);
        }
Ejemplo n.º 2
0
        public void Run()
        {
            //The path where we expect the node project to be at runtime.
            var nodeDir = context.FilesDir.AbsolutePath + "/nodejs-project";

            if (WasAPKUpdated())
            {
                //Recursively delete any existing nodejs-project.
                var nodeDirReference = new Java.IO.File(nodeDir);
                if (nodeDirReference.Exists())
                {
                    DeleteFolderRecursively(new File(nodeDir));
                }
                //Copy the node project from assets into the application's data path.
                copyAssetFolder(context.ApplicationContext.Assets, "nodejs-project", nodeDir);

                saveLastUpdateTime();
            }

            CLib.StartNodeWithArguments(2, new String[] { "node", nodeDir + "/main.js" });
        }