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


TypeScript Facebook.logout方法代碼示例

本文整理匯總了TypeScript中@ionic-native/facebook.Facebook.logout方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Facebook.logout方法的具體用法?TypeScript Facebook.logout怎麽用?TypeScript Facebook.logout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@ionic-native/facebook.Facebook的用法示例。


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

示例1: signOut

  signOut() : firebase.Promise<any> {
    if (this.angularFireAuth.auth.currentUser.providerData.length) {
      for (var i = 0; i < this.angularFireAuth.auth.currentUser.providerData.length; i++) {
        var provider = this.angularFireAuth.auth.currentUser.providerData[i];

        if (provider.providerId == firebase.auth.GoogleAuthProvider.PROVIDER_ID) { // Se for o gooogle
          // o disconnect limpa o oAuth token e tambem esquece qual conta foi selecionada para o login
          return this.googlePlus.disconnect()
            .then(() => {
              return this.signOutFirebase();
            });
        } else if (provider.providerId == firebase.auth.FacebookAuthProvider.PROVIDER_ID) { // Se for facebook
          return this.facebook.logout()
            .then(() => {
              return this.signOutFirebase();
            })
        } else if (provider.providerId == firebase.auth.TwitterAuthProvider.PROVIDER_ID) { // Se for twitter
          return this.twitter.logout()
            .then(() => {
              return this.signOutFirebase();
            })
        }
      }
    }

    return this.signOutFirebase();
  }
開發者ID:joaorobertoifrn,項目名稱:ionicfirebaseauth,代碼行數:27,代碼來源:auth-service.ts

示例2: resolve

 this.http.post(this.storageProvider.serverAddress+"/logout",JSON.stringify({version:this.storageProvider.version}),{headers: headers}).map(res=>res.json()).subscribe((res)=>{
     this.fb.logout().then((result)=>{
          resolve(res); 
     },(err)=>{
           resolve(res);
     });
 },(err)=>{
開發者ID:raceyi,項目名稱:takit,代碼行數:7,代碼來源:fb-provider.ts

示例3: logout

 logout(){
     this.fb.logout().then((res) => 
     console.log('Logged into Facebook!', res)).catch(e => 
     console.log('Error logging into Facebook', e));
     this.googleplus.logout().then((res) => 
     console.log('logged out of google',res)).catch(err => console.error(err));
     localStorage.clear();
     this.navCtrl.setRoot(LoginPage);
  }
開發者ID:Tanisha9000,項目名稱:shaddivendor,代碼行數:9,代碼來源:logout.ts

示例4: Promise

      return new Promise((resolve,reject)=>{
            this.fb.logout().then((result)=>{
                console.log("facebook logout success");
                    console.log("logout");
                    let headers = new Headers();
                    headers.append('Content-Type', 'application/json');
                    console.log("server: "+ this.storageProvider.serverAddress);
                    let body = JSON.stringify({version:this.storageProvider.version});

                    this.http.post(this.storageProvider.serverAddress+"/shop/logout",body,{headers: headers}).map(res=>res.json()).subscribe((res)=>{
                        resolve(res); // 'success'(move into home page) or 'invalidId'(move into signup page)
                    },(err)=>{
                        console.log("logout no response "+JSON.stringify(err));
                        reject("logout no response");
                    });
            },(err)=>{
                console.log("facebook logout failure");
                reject("facebook logout failure");
            });
      });
開發者ID:raceyi,項目名稱:takit,代碼行數:20,代碼來源:fb-provider.ts


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