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


TypeScript ngx-facebook.FacebookService類代碼示例

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


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

示例1: constructor

  constructor(private fb: FacebookService, private accountService: AccountService) {
    let initParams: InitParams = {
      appId: '2012751978958165',
      xfbml: true,
      version: 'v2.8'
    };

    fb.init(initParams);
  }
開發者ID:eclaramunt,項目名稱:socialcrawler,代碼行數:9,代碼來源:fb.service.ts

示例2: constructor

  constructor(private fb: FacebookService, private translate: TranslateService, private authorizationService: AuthorizationService, private router: Router) {

    console.log('Initializing Facebook');

    fb.init({
      appId: '229433700788344',
      version: 'v2.9'
    });

    translate.addLangs(['en', 'ru']);
    translate.setDefaultLang('en');

    const browserLang = translate.getBrowserLang();
    translate.use(browserLang.match(/en|ru/) ? browserLang : 'en');
  }
開發者ID:klymenko-ruslan,項目名稱:cryptocurrency,代碼行數:15,代碼來源:app.component.ts

示例3: isLoggin

 isLoggin(): Promise<boolean> {
   return this.fb.getLoginStatus()
     .then((response: LoginStatus) => {
       return response.status === 'connected';
     })
     .catch(e => { return false; })
 }
開發者ID:eclaramunt,項目名稱:socialcrawler,代碼行數:7,代碼來源:fb.service.ts

示例4: loginWithFacebook

  loginWithFacebook(): void {

    this.fb.login()
      .then((response: LoginResponse) => console.log(response))
      .catch((error: any) => console.error(error));

  }
開發者ID:klymenko-ruslan,項目名稱:cryptocurrency,代碼行數:7,代碼來源:authorization.service.ts

示例5: InitService

    public InitService() {
        let initParams: InitParams = {
            appId: '447972592264310',
            xfbml: true,
            version: 'v2.10'
        };

        this.facebookService.init(initParams);
    }
開發者ID:OvidiuCaba,項目名稱:StatisticsRomania,代碼行數:9,代碼來源:share.service.ts

示例6: addFacebook

 addFacebook(): void {
   this.fb.login({ scope: "user_posts", enable_profile_selector: true })
     .then((response: LoginResponse) => {
       //Obtenida la respuesta, aĂąado la cuenta al servidor
       this.accountService.addAccount({
         type: 'facebook',
         facebook_id: response.authResponse.userID
       })
     })
     .catch((error: any) => console.error(error));
 }
開發者ID:eclaramunt,項目名稱:socialcrawler,代碼行數:11,代碼來源:fb.service.ts

示例7: faceshare

  faceshare(url: string) {

    let params: UIParams = {
      href: url,
      method: 'share'
    };

    this.fb.ui(params)
      .then((res: UIResponse) => console.log(res))
      .catch((e: any) => console.error(e));
  }
開發者ID:midanirachdi,項目名稱:RC-Angular,代碼行數:11,代碼來源:eventsection.component.ts

示例8: attachments

 attachments(post_id) {
   let attachments = [];
   return this.fb.api(post_id + '/attachments').then(
     (res) => {
       if (res.data[0].media) {
         attachments.push(res.data[0].media.image.src);
       }
       else {
         if (res.data[0].subattachments) {
           res.data[0].subattachments.data.forEach((element) => {
             attachments.push(element.media.image.src);
           })
         }
       }
       return attachments;
     }
   ).catch(e => console.log(e));
 }
開發者ID:eclaramunt,項目名稱:socialcrawler,代碼行數:18,代碼來源:fb.service.ts

示例9: me

 me() {
   return this.fb.api('me?fields=posts.limit(7)')
     .then(res => res.posts)
     .catch(e => console.log(e));
 }
開發者ID:eclaramunt,項目名稱:socialcrawler,代碼行數:5,代碼來源:fb.service.ts


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