// Create a tag
$git tag <tagname>
// Push to repository
$git push origin master
升级 cordova plugin
现在暂时没有直接升级的命令,采用的是先卸载后安装新版本的方法。
如何创建 Cordova Plugin 对应的 Ionic Native
Creating Plugin Wrappers
123456789101112
// Navigate to ionic-native root path
$cd ionic-native
// Install dependencies first time
$npm install
// Create plugin wrapper
// When gulp installed locally
$npx gulp plugin:create -n PluginName
// When gulp installed globally
$gulp plugin:create -n PluginName
安装
12345
// You need to run npm run build in the ionic-native project, this will create a dist directory. The dist directory will contain a sub directory @ionic-native with all the packages compiled in there.
$npm run build
//Copy the package(s) you created/modified to your app's node_modules under the @ionic-native directory.
$cp -r dist/@ionic-native/plugin-name ../my-app/node_modules/@ionic-native/
// Import the plugin in a @NgModule and add it to the list of Providers.
// app.module.ts
import { APIClient } from '@ionic-native/api-client/ngx';
...
@NgModule({
...
providers: [
...
APIClient
...
]
...
})
export class AppModule { }
// After the plugin has been declared, it can be imported and injected like any other service:
// login.service.ts
import { APIClient } from '@ionic-native/api-client/ngx';
import { ServiceName } from '@ionic-native/api-client/ngx';
constructor(private apiClient: APIClient) { }
this.apiClient.get(ServiceName.Login, JSON.stringify(user))
.then((result: string) => {
console.log('api client login:', result);
//TODO: Parse server return json to UserExt object
const routePath = this.simulateLogin(username);
resolve(routePath);
})
.catch((error: string) => {
console.log('api client login error:', error);
reject(error);
});