#Few Line of Hack Code Make React-Native Run on Windows
While React-Native just add support of Android,yet officeally they just only support on OSX.
After a few hours of debugging, I find a simple way of let React-Native run on Windows.
| (function (window) { | |
| //兼容 | |
| window.URL = window.URL || window.webkitURL; | |
| navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; | |
| //**blob to dataURL** | |
| var blobToDataURL = function (blob, callback) { | |
| var a = new FileReader(); | |
| a.onload = function (e) { callback(e.target.result); } | |
| a.readAsDataURL(blob); |
| <!DOCTYPE html> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <title></title> | |
| </head> | |
| <body> | |
| <div> | |
| <audio controls autoplay></audio> | |
| <input onclick="startRecording()" type="button" value="录音" /> |
| #!/bin/bash | |
| #Modify this with your IP range | |
| MY_IP_RANGE="192\.168\.1" | |
| #You usually wouldn't have to modify this | |
| PORT_BASE=5555 | |
| #List the devices on the screen for your viewing pleasure | |
| adb devices |
| // | |
| // API.swift | |
| // | |
| // Created by Taro Minowa on 6/10/14. | |
| // Copyright (c) 2014 Higepon Taro Minowa. All rights reserved. | |
| // | |
| import Foundation | |
| typealias JSONDictionary = Dictionary<String, AnyObject> |
| <script type="text/javascript"> | |
| var custom = "myapp://custom_url"; | |
| var alt = "http://mywebsite.com/alternate/content"; | |
| var g_intent = "intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;end"; | |
| var timer; | |
| var heartbeat; | |
| var iframe_timer; | |
| function clearTimers() { | |
| clearTimeout(timer); |
| <?xml version="1.0" encoding="utf-8"?> | |
| <dns> | |
| <retcode>0</retcode> | |
| <domainlist> | |
| <domain name="extshort.weixin.qq.com" timeout="1800"> | |
| <ip>101.226.76.175</ip> | |
| <ip>101.227.131.102</ip> | |
| </domain> | |
| <domain name="long.weixin.qq.com" timeout="1800"> |
| // Include gulp | |
| var gulp = require('gulp'); | |
| // Include Our Plugins | |
| var sass = require('gulp-sass'); | |
| var lr = require('tiny-lr'), | |
| refresh = require('gulp-livereload'), | |
| server = lr(); |
| // Joins path segments. Preserves initial "/" and resolves ".." and "." | |
| // Does not support using ".." to go above/outside the root. | |
| // This means that join("foo", "../../bar") will not resolve to "../bar" | |
| function join(/* path segments */) { | |
| // Split the inputs into a list of path commands. | |
| var parts = []; | |
| for (var i = 0, l = arguments.length; i < l; i++) { | |
| parts = parts.concat(arguments[i].split("/")); | |
| } | |
| // Interpret the path commands to get the new resolved path. |
Read the blog at http://fokkezb.nl/2013/09/20/url-schemes-for-ios-and-android-2/