Skip to content

Commit e406cb8

Browse files
authored
Merge pull request #45 from ryanlntn/react-native-windows
React Native Windows Support
2 parents 5d5ccc2 + d5b53d6 commit e406cb8

18 files changed

+1383
-8
lines changed

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,18 @@ takeSnapshot(viewRef, { path: PictureDir+"/foo.png" })
6666

6767
Model tested: iPhone 6 (iOS), Nexus 5 (Android).
6868

69-
| System | iOS | Android |
70-
|--------------------|--------------------|-------------------|
71-
| View,Text,Image,.. | YES | YES |
72-
| WebView | YES | YES<sup>1</sup> |
73-
| gl-react v2 | YES | NO<sup>2</sup> |
74-
| react-native-video | NO | NO |
75-
| react-native-maps | YES | [NO](https://github.com/gre/react-native-view-shot/issues/36) |
69+
| System | iOS | Android | Windows |
70+
|--------------------|--------------------|-------------------|-------------------|
71+
| View,Text,Image,.. | YES | YES | YES |
72+
| WebView | YES | YES<sup>1</sup> | YES |
73+
| gl-react v2 | YES | NO<sup>2</sup> | NO<sup>3</sup> |
74+
| react-native-video | NO | NO | NO
75+
| react-native-maps | YES | [NO](https://github.com/gre/react-native-view-shot/issues/36) | NO<sup>3</sup>
7676

7777
>
7878
1. Only supported by wrapping a `<View collapsable={false}>` parent and snapshotting it.
7979
2. It returns an empty image (not a failure Promise).
80+
3. Component itself lacks platform support.
8081

8182
## Caveats
8283

@@ -128,7 +129,10 @@ react-native link react-native-view-shot
128129

129130
#### Windows
130131

131-
Stay tuned, https://github.com/gre/react-native-view-shot/pull/45 will be merged soon!
132+
1. In Visual Studio, in the solution explorer, right click on your solution then select `Add``ExisitingProject`
133+
2. Go to `node_modules``react-native-view-shot` and add `RNViewShot.csproj` (UWP) or optionally `RNViewShot.Net46.csproj` (WPF)
134+
3. In Visual Studio, in the solution explorer, right click on your Application project then select `Add``Reference`
135+
4. Under the projects tab select `RNViewShot` (UWP) or `RNViewShot.Net46` (WPF)
132136

133137
## Thanks
134138

jsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"allowJs": true,
4+
"allowSyntheticDefaultImports": true
5+
},
6+
"exclude": [
7+
"node_modules"
8+
]
9+
}

windows/.gitignore

Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,281 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
##
4+
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5+
6+
# User-specific files
7+
*.suo
8+
*.user
9+
*.userosscache
10+
*.sln.docstates
11+
12+
# User-specific files (MonoDevelop/Xamarin Studio)
13+
*.userprefs
14+
15+
# Build results
16+
[Dd]ebug/
17+
[Dd]ebugPublic/
18+
[Rr]elease/
19+
[Rr]eleases/
20+
x64/
21+
x86/
22+
bld/
23+
[Bb]in/
24+
[Oo]bj/
25+
[Ll]og/
26+
27+
# Visual Studio 2015 cache/options directory
28+
.vs/
29+
# Uncomment if you have tasks that create the project's static files in wwwroot
30+
#wwwroot/
31+
32+
# MSTest test Results
33+
[Tt]est[Rr]esult*/
34+
[Bb]uild[Ll]og.*
35+
36+
# NUNIT
37+
*.VisualState.xml
38+
TestResult.xml
39+
40+
# Build Results of an ATL Project
41+
[Dd]ebugPS/
42+
[Rr]eleasePS/
43+
dlldata.c
44+
45+
# .NET Core
46+
project.lock.json
47+
project.fragment.lock.json
48+
artifacts/
49+
**/Properties/launchSettings.json
50+
51+
*_i.c
52+
*_p.c
53+
*_i.h
54+
*.ilk
55+
*.meta
56+
*.obj
57+
*.pch
58+
*.pdb
59+
*.pgc
60+
*.pgd
61+
*.rsp
62+
*.sbr
63+
*.tlb
64+
*.tli
65+
*.tlh
66+
*.tmp
67+
*.tmp_proj
68+
*.log
69+
*.vspscc
70+
*.vssscc
71+
.builds
72+
*.pidb
73+
*.svclog
74+
*.scc
75+
76+
# Chutzpah Test files
77+
_Chutzpah*
78+
79+
# Visual C++ cache files
80+
ipch/
81+
*.aps
82+
*.ncb
83+
*.opendb
84+
*.opensdf
85+
*.sdf
86+
*.cachefile
87+
*.VC.db
88+
*.VC.VC.opendb
89+
90+
# Visual Studio profiler
91+
*.psess
92+
*.vsp
93+
*.vspx
94+
*.sap
95+
96+
# TFS 2012 Local Workspace
97+
$tf/
98+
99+
# Guidance Automation Toolkit
100+
*.gpState
101+
102+
# ReSharper is a .NET coding add-in
103+
_ReSharper*/
104+
*.[Rr]e[Ss]harper
105+
*.DotSettings.user
106+
107+
# JustCode is a .NET coding add-in
108+
.JustCode
109+
110+
# TeamCity is a build add-in
111+
_TeamCity*
112+
113+
# DotCover is a Code Coverage Tool
114+
*.dotCover
115+
116+
# Visual Studio code coverage results
117+
*.coverage
118+
*.coveragexml
119+
120+
# NCrunch
121+
_NCrunch_*
122+
.*crunch*.local.xml
123+
nCrunchTemp_*
124+
125+
# MightyMoose
126+
*.mm.*
127+
AutoTest.Net/
128+
129+
# Web workbench (sass)
130+
.sass-cache/
131+
132+
# Installshield output folder
133+
[Ee]xpress/
134+
135+
# DocProject is a documentation generator add-in
136+
DocProject/buildhelp/
137+
DocProject/Help/*.HxT
138+
DocProject/Help/*.HxC
139+
DocProject/Help/*.hhc
140+
DocProject/Help/*.hhk
141+
DocProject/Help/*.hhp
142+
DocProject/Help/Html2
143+
DocProject/Help/html
144+
145+
# Click-Once directory
146+
publish/
147+
148+
# Publish Web Output
149+
*.[Pp]ublish.xml
150+
*.azurePubxml
151+
# TODO: Comment the next line if you want to checkin your web deploy settings
152+
# but database connection strings (with potential passwords) will be unencrypted
153+
*.pubxml
154+
*.publishproj
155+
156+
# Microsoft Azure Web App publish settings. Comment the next line if you want to
157+
# checkin your Azure Web App publish settings, but sensitive information contained
158+
# in these scripts will be unencrypted
159+
PublishScripts/
160+
161+
# NuGet Packages
162+
*.nupkg
163+
# The packages folder can be ignored because of Package Restore
164+
**/packages/*
165+
# except build/, which is used as an MSBuild target.
166+
!**/packages/build/
167+
# Uncomment if necessary however generally it will be regenerated when needed
168+
#!**/packages/repositories.config
169+
# NuGet v3's project.json files produces more ignorable files
170+
*.nuget.props
171+
*.nuget.targets
172+
173+
# Microsoft Azure Build Output
174+
csx/
175+
*.build.csdef
176+
177+
# Microsoft Azure Emulator
178+
ecf/
179+
rcf/
180+
181+
# Windows Store app package directories and files
182+
AppPackages/
183+
BundleArtifacts/
184+
Package.StoreAssociation.xml
185+
_pkginfo.txt
186+
187+
# Visual Studio cache files
188+
# files ending in .cache can be ignored
189+
*.[Cc]ache
190+
# but keep track of directories ending in .cache
191+
!*.[Cc]ache/
192+
193+
# Others
194+
ClientBin/
195+
~$*
196+
*~
197+
*.dbmdl
198+
*.dbproj.schemaview
199+
*.jfm
200+
*.pfx
201+
*.publishsettings
202+
orleans.codegen.cs
203+
204+
# Since there are multiple workflows, uncomment next line to ignore bower_components
205+
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
206+
#bower_components/
207+
208+
# RIA/Silverlight projects
209+
Generated_Code/
210+
211+
# Backup & report files from converting an old project file
212+
# to a newer Visual Studio version. Backup files are not needed,
213+
# because we have git ;-)
214+
_UpgradeReport_Files/
215+
Backup*/
216+
UpgradeLog*.XML
217+
UpgradeLog*.htm
218+
219+
# SQL Server files
220+
*.mdf
221+
*.ldf
222+
223+
# Business Intelligence projects
224+
*.rdl.data
225+
*.bim.layout
226+
*.bim_*.settings
227+
228+
# Microsoft Fakes
229+
FakesAssemblies/
230+
231+
# GhostDoc plugin setting file
232+
*.GhostDoc.xml
233+
234+
# Node.js Tools for Visual Studio
235+
.ntvs_analysis.dat
236+
node_modules/
237+
238+
# Typescript v1 declaration files
239+
typings/
240+
241+
# Visual Studio 6 build log
242+
*.plg
243+
244+
# Visual Studio 6 workspace options file
245+
*.opt
246+
247+
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
248+
*.vbw
249+
250+
# Visual Studio LightSwitch build output
251+
**/*.HTMLClient/GeneratedArtifacts
252+
**/*.DesktopClient/GeneratedArtifacts
253+
**/*.DesktopClient/ModelManifest.xml
254+
**/*.Server/GeneratedArtifacts
255+
**/*.Server/ModelManifest.xml
256+
_Pvt_Extensions
257+
258+
# Paket dependency manager
259+
.paket/paket.exe
260+
paket-files/
261+
262+
# FAKE - F# Make
263+
.fake/
264+
265+
# JetBrains Rider
266+
.idea/
267+
*.sln.iml
268+
269+
# CodeRush
270+
.cr/
271+
272+
# Python Tools for Visual Studio (PTVS)
273+
__pycache__/
274+
*.pyc
275+
276+
# Cake - Uncomment if you are using it
277+
# tools/**
278+
# !tools/packages.config
279+
280+
# Telerik's JustMock configuration file
281+
*.jmconfig
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("RNViewShot.Net46")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("RNViewShot.Net46")]
13+
[assembly: AssemblyCopyright("Copyright © 2017")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("1dd45d00-ddf4-43b4-ab28-f98e6dc325b5")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)