Skip to content

Commit

Permalink
Remove our custom activity because it's no longer needed (since Nativ…
Browse files Browse the repository at this point in the history
…eScript 5.4.0) #38
  • Loading branch information
EddyVerbruggen committed Jun 26, 2019
1 parent 52ef308 commit 789f87c
Show file tree
Hide file tree
Showing 11 changed files with 295 additions and 386 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ The [demo app](demo) has this:
```

## Android Setup
> ⚠️ Since plugin version 4.0.0 this section is no longer needed, but you HAVE to run NativeScript 5.4.0 or newer. If you need to support older NativeScript versions, please stick to plugin version < 4.0.0.
Update the `activity` entry in your `App_Resources/Android/AndroidManifest.xml` file:

```xml
Expand All @@ -60,20 +62,20 @@ Update the `activity` entry in your `App_Resources/Android/AndroidManifest.xml`

So replace `com.tns.NativeScriptActivity` with `com.tns.NativeScriptNfcActivity`.

#### Webpack (again, no longer needed from plugin version 4.0.0)
If you're using Webpack to bundle your app you'll need to add 1 line of configuration in case you're targeting Android.

- Open `webpack.config.js` (it's in the root of your project).
- Look for an Array named `appComponents`, which likely contains stuff like `"tns-core-modules/ui/frame"`.
- Add `resolve(__dirname, "node_modules/nativescript-nfc/nfc-activity.android.js")` [as shown here](https://github.com/EddyVerbruggen/nativescript-nfc/blob/6dfa0ff4f77cab5ab7f494ac3055f728ce51d131/demo/webpack.config.js#L17).

## Demo app (those screenshots above)
Want to dive in quickly? Check out [the demo](https://github.com/EddyVerbruggen/nativescript-nfc/tree/master/demo)!

You can run the demo app from the root of the project by typing `npm run demo.ios.device` or `npm run demo.android`.

> [This is what it looks like in action on iOS](https://twitter.com/eddyverbruggen/status/899617497741185025)!
## Webpack
If you're using Webpack to bundle your app you'll need to add 1 line of configuration in case you're targeting Android.

- Open `webpack.config.js` (it's in the root of your project).
- Look for an Array named `appComponents`, which likely contains stuff like `"tns-core-modules/ui/frame"`.
- Add `resolve(__dirname, "node_modules/nativescript-nfc/nfc-activity.android.js")` [as shown here](https://github.com/EddyVerbruggen/nativescript-nfc/blob/6dfa0ff4f77cab5ab7f494ac3055f728ce51d131/demo/webpack.config.js#L17).

## API

### `available`
Expand Down
2 changes: 1 addition & 1 deletion demo/app/App_Resources/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
android:theme="@style/AppTheme">

<activity
android:name="com.tns.NativeScriptNfcActivity"
android:name="com.tns.NativeScriptActivity"
android:label="NFC"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@style/LaunchScreenTheme">
Expand Down
11 changes: 5 additions & 6 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"nativescript": {
"id": "org.nativescript.plugindemo.nfc",
"tns-ios": {
"version": "5.3.1"
"version": "6.0.0-2019-06-10-154118-03"
},
"tns-android": {
"version": "5.3.1"
"version": "6.0.0-2019-06-11-172137-01"
}
},
"dependencies": {
"nativescript-nfc": "file:../src",
"nativescript-theme-core": "~1.0.4",
"tns-core-modules": "~5.3.1"
"tns-core-modules": "6.0.0-next-2019-06-20-155941-01"
},
"devDependencies": {
"babel-traverse": "6.26.0",
Expand All @@ -23,10 +23,9 @@
"karma-jasmine": "^1.0.2",
"karma-nativescript-launcher": "^0.4.0",
"lazy": "1.0.11",
"nativescript-dev-typescript": "next",
"nativescript-dev-webpack": "next",
"nativescript-unit-test-runner": "^0.3.4",
"tns-platform-declarations": "~5.3.1",
"typescript": "~3.2.2"
"tns-platform-declarations": "next",
"typescript": "3.4.1"
}
}
Loading

0 comments on commit 789f87c

Please sign in to comment.