本文整理汇总了TypeScript中@ionic-native/core.checkAvailability函数的典型用法代码示例。如果您正苦于以下问题:TypeScript checkAvailability函数的具体用法?TypeScript checkAvailability怎么用?TypeScript checkAvailability使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkAvailability函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: createAuthenticationContext
createAuthenticationContext(authority: string, validateAuthority: boolean = true) {
let authContext: any;
if (checkAvailability(MSAdal.getPluginRef(), null, MSAdal.getPluginName()) === true) {
authContext = new (MSAdal.getPlugin()).AuthenticationContext(authority);
}
return new AuthenticationContext(authContext);
}
示例2: create
/**
* Creates a new instance of FlurryAnalyticsObject
* @param options {FlurryAnalyticsOptions} options
* @return {FlurryAnalyticsObject}
*/
create(options: FlurryAnalyticsOptions): FlurryAnalyticsObject {
let instance: any;
if (checkAvailability(FlurryAnalytics.pluginRef, null, FlurryAnalytics.pluginName) === true) {
instance = new (window as any).FlurryAnalytics(options);
}
return new FlurryAnalyticsObject(instance);
}
示例3: switchMap
switchMap(() => {
/**
* Native HTTP Cordova plugin doesn't like local requests
*/
const isExternalRequest = checkExternalRequest(req);
if (
isExternalRequest &&
checkAvailability('cordova.plugin.http') === true
) {
return this.cordovaHttpBackend.handle(req);
} else {
return this.fallbackBackend.handle(req);
}
}),
示例4: constructor
constructor(title: string, options: LocalNotificationOptions) {
if (checkAvailability(PhonegapLocalNotification.pluginRef, null, PhonegapLocalNotification.pluginName) === true) {
this._objectInstance = new Notification(title, options);
}
}
示例5: constructor
constructor(options: PushOptions) {
if (checkAvailability('PushNotification', 'init', 'PushNotification') === true) {
this._objectInstance = window.PushNotification.init(options);
}
}
示例6: constructor
constructor() {
if (checkAvailability('navigator.contacts', 'create', 'Contacts') === true) {
this._objectInstance = navigator.contacts.create();
}
}