* Improved logic for searching plist file path for iOS postlink.js
Added Xcode package for parsing xcodeproj file and retrieving correct plist file related to the project. This should also fix issue described here: https://github.com/Microsoft/react-native-code-push/issues/661
* Improved logic for searching plist file path for iOS postlink.js
Added logic to narrow xcode 'getBuildProperty' function results to specified Product_Name property. This should help us to chsose correct project from pbxproj file when we have several projects defined.
* Added logic to try to get 'Release' build of ProductName matching the package name first and if it doesn't exist then try to get any other if existing
Added support react-native-windows dotNet
Added example for react-native-windows UWP based
Added example for react-native-windows dotNet based
Project structure:
CodePush.Shared - shared code between UWP and dotNet
CodePush - UWP specific code
CodePush.Net46 - dotNet specific code
For UWP solution it needs to be added the following projects:
CodePush.Shared
CodePush
For dotNet solution it needs to be added the following projects:
CodePush.Shared
CodePush.Net46
Examples:
Examples\CodePushDemoApp\windows\CodePushDemoApp.sln the solution contains both examples (UWP and dotNet).
Notes
Example for ARM configuration has not been tested. Since there is no changes in UWP part of implementation, there is low risk of failure.
In this implementation we tried to reuse UWP library as much as possible. The following issues are relevant for both platforms:
ZipFile.ExtractToDirectory is not reliable and throws exception if:
folder exists already
path is too long (> 250 chars)
Un-zipping is quite long operation. Does it make sense for async?
await UpdateUtils.UnzipBundleAsync(downloadFile.Path, unzippedFolder.Path);
AsyncTasks are executed on a single thread to avoid common application errors caused by parallel execution.
So to make it possible to use tools like AsyncStorage while CodePush downloading an update we should use
`asyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);` code instead of `asyncTask.execute()`
Instead of `#import "CodePush.h"`, use `#import "<CodePush/CodePush.h>` and export CodePush.h from our module.
* [iOS][Build] Add `Headers` and `Copy Files` build phases
Due to changes in new release of `react-native@0.40.0`
there is `CodePush.h file not found` error occures.
To fix it I've added `CodePush.h` header file in `Headers`
and `Copy Files` build phases and changed
`codePushHeaderImportStatement` variable value from `#import "CodePush.h"`
to `#import <CodePush/CodePush.h>` in `postlink.js` file.
Fix https://github.com/Microsoft/react-native-code-push/issues/662
* readme: update iOS manual plugin installation/usage documentation
Due to changes in React Native v0.40.0 and changes in CodePush project Step 6. of iOS manual plugin installation (add “Header Search Paths”) is not needed anymore. Also changed path to `CodePush.h` file in `AppDelegate.m` to `#import <CodePush/CodePush.h>`
In case version of 'Android Plugin for Gradle'' is lower than 1.3.0
'$buildDir' has slightly different structure - 'merged' folder
does not exists so '${targetPath}' folder contains directly in 'res' folder.
Fix issue https://github.com/Microsoft/react-native-code-push/issues/584
* Update README for iOS Manual plugin installation
Wrong/incomplete path to Codepush iOS library set in the `Header Search Paths` causes Xcode to fail without specifying any errors.
The path to the library should be changed from
```
$(SRCROOT)/../node_modules/react-native-code-push
to
$(SRCROOT)/../node_modules/react-native-code-push/ios
```
Small detail but might cause a developer significant amount of time trying to pin down the cause of the build failure, especially when Xcode does not return any useful error.
The Xcode log when the header search path is wrong:
```
# Exit Status 65
Verify final result code for completed build operation
Build operation failed without specifying any errors. Individual build tasks may have failed for unknown reasons.
One possible cause is if there are too many (possibly zombie) processes; in this case, rebooting may fix the problem.
Some individual build task failures (up to 12) may be listed below.
```
Cheers!
* Update related screenshot for `Header Search Path`
Update related screenshot for `Header Search Path` configuration for manual iOS plugin installation
In issue #477 there was an issue when the project has, for some reason, multiple AppDelegate.m files (eg project sample files) within the ios subdir of an RN project.
This fix will give priority to the AppDelegate.m found inside any path that has the application name (as defined in package.json) in it. If it cannot find that, it will revert to previous behavior (the first element in the path array).