Skip to content

Commit edd8f59

Browse files
authored
Merge pull request #2 from mfdeveloper/change-readme
Update README.md
2 parents 78fa19f + 9845d0d commit edd8f59

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,37 @@ description: Starts native view from a cordova app.
77

88
Start or Back to a UIViewController(_ios_) or Activity(_Android_) relative to your cordova app.
99

10-
You can use this in a standalone project (basic cordova project), or into a existing native _Android/IOS_ application, like descibed in [Embed Cordova in native apps](https://cordova.apache.org/docs/en/latest/guide/hybrid/webviews/index.html)
10+
You can use this in a standalone project (basic cordova project), or into a existing native _Android/IOS_ application, like described in [Embed Cordova in native apps](https://cordova.apache.org/docs/en/latest/guide/hybrid/webviews/index.html)
1111

12-
> **OBS:** If you wish just exit from cordova app or back to native view (Android only), use: `navigator['app'].exitApp()`
12+
> **OBS:** If you wish just **EXIT** from cordova app or back to native view (Android only), use: `navigator['app'].exitApp()`
1313
1414
## Installation
15+
16+
```bash
17+
cordova plugin add cordova-plugin-nativeview --save
1518

16-
cordova plugin add cordova-plugin-nativeview --save
19+
# using IONIC
20+
ionic cordova plugin add cordova-plugin-nativeview --save
21+
```
1722

1823
### Extra: Native app (_Android/IOS_ native code)
1924

25+
**ALL PLATFORMS**
26+
27+
Make sure that `config.xml` file contains the `<feature>` tag below:
28+
29+
```xml
30+
<feature name="NativeView">
31+
<param name="android-package" value="br.com.mfdeveloper.cordova.NativeView" />
32+
<param name="onload" value="true" />
33+
</feature>
34+
```
35+
2036
**IOS**
2137

38+
* Copy the `config.xml` from your cordova project to root XCode project directory.
2239
* Install [cocoapods](https://cocoapods.org/)
23-
* Add this plugin like a `pod`:
40+
* Add this plugin like a [pod](https://guides.cocoapods.org/syntax/podfile.html) dependency:
2441

2542
```ruby
2643
# Objective-C version (Default)
@@ -34,7 +51,11 @@ pod 'cordova-plugin-nativeview', :git => 'https://github.com/mfdeveloper/cordova
3451

3552
Until here, this plugin is not registered on cloud. In future, this plugin will be on [jcenter](https://bintray.com/bintray/jcenter) and/or [mavencentral](https://search.maven.org/). By now, you need:
3653

37-
* From your cordova project, copy the content off `platforms/android/assets/www` folder to your android project (usually, `app/src/main/assets`). Or create a **gradle** task to do this.
54+
* From your cordova project:
55+
56+
- Copy the content off `platforms/android/assets/www` folder to your android project (usually, `app/src/main/assets`).
57+
Or create a **gradle** task to do this.
58+
- Copy the `config.xml` to `src/main/res/xml` android project folder.
3859

3960
* Clone this repo, and copy the class: `src/android/NativeView.java` to your Android project
4061

@@ -81,4 +102,4 @@ window.NativeView.show('MyUIViewController');
81102

82103
## License
83104

84-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
105+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

0 commit comments

Comments
 (0)