Hi,
I’m trying to import a provider but ionic 2 keeps saying
Cannot find name 'RateService'.
Below is everywhere I have imported it. For what I can see it should work, I believe I have done everything I need to, anyone got any ideas? Thanks.
app.module.ts
import { RateService } from '../providers/rate-service/rate-service';
providers: [{provide: ErrorHandler, useClass: IonicErrorHandler}, Storage, RateService]
information.ts
import { RateService } from '../../providers/rate-service/rate-service';
constructor(public navCtrl: NavController, public viewCtrl: ViewController, public storage: Storage, public alertCtrl: AlertController, public rateService: RateService, public platform: Platform)
{}
Then call from a button press…
review() {
this.rateService.promptForRating();
}
rate-service.ts
import { Injectable } from '@angular/core';
import { Platform } from 'ionic-angular';
import { AppRate } from 'ionic-native';
@Injectable()
export class RateService {
appRate: any = AppRate;
constructor(public platform: Platform) {
this.platform.ready().then(
() => {
this.appRate.preferences.storeAppURL = {
ios: '849930087',
android: 'market://details?id=com.carlrydings.craftingguideforminecraft',
windows: 'ms-windows-store://pdp/?ProductId=9nblggh1z0w3',
};
this.appRate.preferences.usesUntilPrompt = 2;
this.appRate.preferences.customLocale = {
title: "Rate Crafting Coach",
message: "If you enjoy using Crafting Coach, please rate and review it.",
cancelButtonLabel: "No, Thanks",
laterButtonLabel: "Remind Me Later",
rateButtonLabel: "Rate It Now"
};
}
)
}
}