nativescript-ausweisapp-sdk-wrapper
NativeScript plugin to wrap Ausweisapp2 SDK API
npm i --save nativescript-ausweisapp-sdk-wrapper
- Version: 1.0.1
- GitHub: https://github.com/daniele-pecora/nativescript-ausweisapp-sdk-wrapper
- NPM: https://www.npmjs.com/package/nativescript-ausweisapp-sdk-wrapper
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 0
nativescript-ausweisapp-sdk-wrapper
This plugin wraps the Ausweisapp2 SDK to a simpler Javascript API.
Official documentation at https://www.ausweisapp.bund.de/sdk/
DEMO
Contains a DEMO angular application
Run DEMO
$ cd demo-angular
$ tns debug android
Consider using PersoSim to simulate a test eID-Card.
Installation
Install this plugin regulary with this command
tns plugin add nativescript-ausweisapp-sdk-wrapper
Integration in app
Head over to the guide here on how to integrate this API in your project
There you will find details on how to
- Create required activity
- Configure webpack
- Edit AndroidManifest.xml
Usage
Use this typings definition for Typescript and adding IntelliSense support.
/// <reference path="./node_modules/nativescript-ausweisapp-sdk-wrapper/typings/ausweisapp-sdk-wrapper-android-declarations.d.ts" />
let foregroundActivity = androidApp.foregroundActivity as globalAndroid.app.Activity
const wrapper = sf.AusweisappSDKWrapper.getInstance(foregroundActivity) as sf.AusweisappSDKWrapper
const callbacks = [
new sf.MessageCallbackPair(sf.Message.__ANY_MESSAGE,
new sf.IMessageCallback({
onMessage: (message: sf.Message, jsonObject: JSONObject) => {
console.log(`received`, `message:${message}`, `${jsonObject.toString(2)}`)
}
}))
]
wrapper.onReady(new sf.AusweisappSDKConnector.IAusweisappSDKConnectorListener({
onReady: () => {
console.log(`SDK wrapper is ready now`)
wrapper.getCommander().exec(sf.Command.SET_PIN, new JSONObject().put('value', '123456'), callbacks)
},
onDisconnect: () => {
console.log(`SDK wrapper disconnected`)
},
onError: (throwable: java.lang.Throwable) => {
console.log(`SDK wrapper failed:`, `${throwable}`)
}
}))
API
See API usage guide here for a deeper look inside.
Also take a look to the official documentation site of the Ausweisapp SDK at https://www.ausweisapp.bund.de/sdk/
License
Apache License Version 2.0, January 2004