import {Page} from 'ionic-framework/ionic';
declare var Media:any;
@Page({
templateUrl: 'build/pages/settings/offline.html',
})
export class TestPage {
constructor() {
let media = new Media('someurl');
media.play();
}
}
My bad. Had it deleted from the repository. Uploaded again. As mentioned, not all plugins work fine, but the basic ones (vibration, device, status, etc.) are.
Seems like the app is still not going. I pulled again your repo and will give it a go locally.
Many thanks anyway for sharing. Typescript, although it brings some constraints, is the way to go and your Cordova plugins integration demo just fix the missing link until they get somehow integrated in ionic-native I presume.
I still try to wrap my head around why should we not try to inject them(the required cordova plugins) as providers basically. Probably a dummy question I guess.
With typings, I don’t need to reference /// <reference path="Cordova.d.ts"/> on the top of *.ts files. The transpile won’t give any errors, and I got the nice intellisence with Visual Code as well.
This is the correct answer moving forward with “typings” over “tsd”. TSD ultimately will become typings in a sense to prevent need of single repo location and allow typings to be resolved and installed from anywhere. Just a quick FYI.
Just as posted install cordova first then cordova/plugins/YOUR_PLUGIN. this is because you prob. don’t need all plugin definitions installed but rather those you’re using. Upon install “cordova” first you will notice that it strips the individual plugin defs.
I get the following error when i run this command typings install cordova --global --save
did I miss something
typings ERR! message Unable to find “cordova” (“npm”) in the registry.
typings ERR! message However, we found “cordova” for 1 other source: "dt"
typings ERR! message You can install these using the “source” option.
typings ERR! message We could use your help adding these typings to the registry: https://github.com/typings/registry
typings ERR! caused by https://api.typings.org/entries/npm/cordova/versions/latest responded with 404, expected it to equal 200