當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ionic-native.AppAvailability類代碼示例

本文整理匯總了TypeScript中ionic-native.AppAvailability的典型用法代碼示例。如果您正苦於以下問題:TypeScript AppAvailability類的具體用法?TypeScript AppAvailability怎麽用?TypeScript AppAvailability使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了AppAvailability類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: checkTwitter

 checkTwitter() {
     AppAvailability.check(this.app)
         .then(
             yes => this.isAvailable = 'Twitter is Installed',
             no => this.isAvailable = 'Twitter is not Installed'
         );
 }
開發者ID:ralphowino,項目名稱:ionic-native-kitchen-sink,代碼行數:7,代碼來源:app-availability.ts

示例2: openFacebook

    /**
     * opens the url with the system app if installed or in the browser
     * @param url url of the website
     */
    openFacebook(url) {
        let app;
        if (this.platform.is('ios')) {
            app = 'fb://';
        }
        else if (this.platform.is('android')) {
            app = 'com.facebook.katana';
        }

        AppAvailability.check(app).then(
            function () {  // Success callback
                open('fb://page/' + url, '_system', 'location=no');
                console.log('Facebook is available');
            },
            function () {  // Error callback
                open('https://www.facebook.com/' + url, '_system', 'location=no');
                console.log('Facebook is not available');
            });
    }
開發者ID:GSE-Project,項目名稱:SS2016-group3,代碼行數:23,代碼來源:about.ts

示例3: openYouTube

    /**
     * opens the url with the system app if installed or in the browser
     * @param url url of the website
     */
    openYouTube(url) {
        let app;
        if (this.platform.is('ios')) {
            app = 'youtube://';
        }
        else if (this.platform.is('android')) {
            app = 'com.google.android.youtube';
        }

        AppAvailability.check(app).then(
            function () {  // Success callback
                open(url, '_system', 'location=no');
                console.log('YouTube is available');
            },
            function () {  // Error callback
                open(url, '_system', 'location=no');
                console.log('YouTube is not available');
            });
    }
開發者ID:GSE-Project,項目名稱:SS2016-group3,代碼行數:23,代碼來源:about.ts

示例4: openTwitter

    /**
     * opens the url with the system app if installed or in the browser
     * @param url url of the website
     */
    openTwitter(url) {
        let app;
        if (this.platform.is('ios')) {
            app = 'twitter://';
        }
        else if (this.platform.is('android')) {
            app = 'com.twitter.android';
        }

        AppAvailability.check(app).then(
            function () {  // Success callback
                open(url, '_system', 'location=no');
                console.log('Twitter is available');
            },
            function () {  // Error callback
                open(url, '_system', 'location=no');
                console.log('Twitter is not available');
            });
    }
開發者ID:GSE-Project,項目名稱:SS2016-group3,代碼行數:23,代碼來源:about.ts


注:本文中的ionic-native.AppAvailability類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。