Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PhoneGap and AngularJS for Cross-platform Development

You're reading from   PhoneGap and AngularJS for Cross-platform Development Build exciting cross-platform applications using PhoneGap and AngularJS

Arrow left icon
Product type Paperback
Published in Oct 2014
Publisher
ISBN-13 9781783988921
Length 122 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Yuxian E Liang Yuxian E Liang
Author Profile Icon Yuxian E Liang
Yuxian E Liang
Eugene Liang Eugene Liang
Author Profile Icon Eugene Liang
Eugene Liang
Arrow right icon
View More author details
Toc

From web to PhoneGap

If you remember, in the previous section, I briefly mentioned that making calls to Facebook using the JavaScript SDK is now slightly different in PhoneGap, compared to the web-based version. Instead of a simplistic FB.login() call in the web version, we need to make a facebookConnectPlugin.login() call in the PhoneGap version. In this section, we'll take careful steps to port our code from the web-based version to a PhoneGap version.

Importing Facebook and PhoneGap plugins

First, we need to import Facebook- and PhoneGap-related plugins. We also need to slightly change how we initiate the FB object. So going back to your index.html file, here's what you need to do:

<!doctype html>
<html ng-app="todoApp">
  <head>
    <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
    <style>
    body {
      padding: 40px 20px 0 20px;
    }
    </style>
  &lt...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image