Resolve CodePush.h for new iOS apps created with RN 0.40 (#665)

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>`
This commit is contained in:
Sergey Akhalkov
2017-01-20 03:50:20 +03:00
committed by BO KANG
parent 294b46cb0f
commit 90f0bb81d1
3 changed files with 18 additions and 7 deletions

View File

@@ -24,7 +24,7 @@ https://github.com/microsoft/react-native-code-push#plugin-configuration-ios`);
var appDelegateContents = fs.readFileSync(appDelegatePath, "utf8");
// 1. Add the header import statement
var codePushHeaderImportStatement = `#import "CodePush.h"`;
var codePushHeaderImportStatement = `#import <CodePush/CodePush.h>`;
if (~appDelegateContents.indexOf(codePushHeaderImportStatement)) {
console.log(`"CodePush.h" header already imported.`);
} else {