nraboy / nativescript-ratings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get this plugin worked with javascript?

nrbn opened this issue · comments

commented

How do I get to work with regular javascript. When I try to integrate this plugin, I get error, ratings is not a constructor, undefined. Please help me!

image

Seems to be working for me, a Hello World example:
`const Ratings = require('nativescript-ratings').Ratings;

function onNavigatingTo(args) {
var page = args.object;

page.bindingContext = createViewModel();
let ratings = new Ratings({
    id: "appname-1.0.0",
    showOnCount: 1,
    title: "Please rate",
    text: "Will you please rate my app?",
    agreeButtonText: "Rate Now",
    remindButtonText: "Remind Me Later",
    declineButtonText: "No Thanks",
    androidPackageId: "com.nativescript.demo",
    iTunesAppId: "12345"
});
ratings.init();
ratings.prompt();

}
exports.onNavigatingTo = onNavigatingTo;`