@baviskarmitesh wrote:
I have Created my custom plugin. Created its Wrapper using following steps
- Cloned the ionic native wrapper from
https://github.com/ionic-team/ionic-native/- Installed node modules and @ionic-native/core
- Created native wrapper using gulp
gulp plugin:create -n @ionic-native/HelloWorld- Changed index.ts file plugin information and added my functions to it
@Plugin({
pluginName: ‘Mathcalculator’,
plugin: ‘cordova-plugin-Mathcalculator’, // npm package name, example: cordova-plugin-camera
pluginRef: ‘Mathcalculator’, // the variable reference to call the plugin, example: navigator.geolocation
repo: ‘https://github.com/baviskarmitesh/MathCalculator.git’, // the github repository URL for the plugin
install: ‘’, // OPTIONAL install command, in case the plugin requires variables
installVariables: , // OPTIONAL the plugin requires variables
platforms: [‘Android’] // Array of platforms supported, example: [‘Android’, ‘iOS’]
})
@Injectable()
export class Mathcalculator extends IonicNativePlugin {/**
- This function does something
- @param arg1 {string} Some param to configure something
- @param arg2 {number} Another param to configure something
- @return {Promise} Returns a promise that resolves when something happens
*/
@Cordova()
add(arg1: any): Promise {
return; // We add return; here to avoid any IDE / Compiler errors
}}
Copied this directory into my app
It Is giving me Uncaught TypeError: Object(…) is not a function on the line @cordova
Any suggession. Stuck since last few hours
Posts: 1
Participants: 1