@@ -67,15 +67,15 @@ Once the above commands are executed successfully, Check the versions of cordova
67
67
68
68
``` bash
69
69
C:\p rojects> cordova -v
70
- 6.4.0
70
+ 7.0.1
71
71
72
72
C:\p rojects> ionic -v
73
- 2.2.3
73
+ 3.4.0
74
74
```
75
75
76
76
These are the latest versions as of writting this document.
77
77
78
- On successful execution of above commands, you're all set to create your app with Ionic 3 framework.
78
+ On successful execution of above commands, you're all set to create your app with Ionic framework.
79
79
80
80
To create your app, change into the directory where you want your app to reside and execute the following command
81
81
@@ -90,45 +90,57 @@ Change to the project directory, which was just created with above command
90
90
> C:\projects\auth-ng4-ionic3-af2>ionic info
91
91
92
92
``` bash
93
- Cordova CLI: 6.4.0
94
- Ionic Framework Version: 3.1.1
95
- Ionic CLI Version: 2.2.3
96
- Ionic App Lib Version: 2.2.1
97
- Ionic App Scripts Version: 1.3.7
98
- ios-deploy version: Not installed
99
- ios-sim version: Not installed
100
- OS: Windows 10
101
- Node Version: v6.10.2
102
- Xcode version: Not installed
93
+ global packages:
103
94
95
+ @ionic/cli-utils : 1.4.0
96
+ Cordova CLI : 7.0.1
97
+ Ionic CLI : 3.4.0
98
+
99
+ local packages:
100
+
101
+ @ionic/app-scripts : 1.3.12
102
+ @ionic/cli-plugin-cordova : 1.4.0
103
+ @ionic/cli-plugin-ionic-angular : 1.3.1
104
+ Cordova Platforms : none
105
+ Ionic Framework : ionic-angular 3.5.0
106
+
107
+ System:
108
+
109
+ Node : v8.1.2
110
+ OS : Windows 10
111
+ Xcode : not installed
112
+ ios-deploy : not installed
113
+ ios-sim : not installed
114
+ npm : 5.0.4
104
115
```
105
116
You need to ensure you've got Ionic Framework Version 3, as shown above.
106
117
107
118
Alternatively you can open ` package.json ` to ensure you've got the following angualr and Ionic versions
108
119
109
- ``` bash
120
+ ``` json
110
121
"dependencies" : {
111
- " @angular/common" : " 4.0.2 " ,
112
- " @angular/compiler" : " 4.0.2 " ,
113
- " @angular/compiler-cli" : " 4.0.2 " ,
114
- " @angular/core" : " 4.0.2 " ,
115
- " @angular/forms" : " 4.0.2 " ,
116
- " @angular/http" : " 4.0.2 " ,
117
- " @angular/platform-browser" : " 4.0.2 " ,
118
- " @angular/platform-browser-dynamic" : " 4.0.2 " ,
119
- " @ionic-native/core" : " 3.6 .1" ,
120
- " @ionic-native/splash-screen" : " 3.6 .1" ,
121
- " @ionic-native/status-bar" : " 3.6 .1" ,
122
+ "@angular/common" : " 4.1.3 " ,
123
+ "@angular/compiler" : " 4.1.3 " ,
124
+ "@angular/compiler-cli" : " 4.1.3 " ,
125
+ "@angular/core" : " 4.1.3 " ,
126
+ "@angular/forms" : " 4.1.3 " ,
127
+ "@angular/http" : " 4.1.3 " ,
128
+ "@angular/platform-browser" : " 4.1.3 " ,
129
+ "@angular/platform-browser-dynamic" : " 4.1.3 " ,
130
+ "@ionic-native/core" : " 3.12 .1" ,
131
+ "@ionic-native/splash-screen" : " 3.12 .1" ,
132
+ "@ionic-native/status-bar" : " 3.12 .1" ,
122
133
"@ionic/storage" : " 2.0.1" ,
123
- " ionic-angular" : " 3.1.1 " ,
134
+ "ionic-angular" : " 3.5.0 " ,
124
135
"ionicons" : " 3.0.0" ,
125
- " rxjs" : " 5.1.1 " ,
126
- " sw-toolbox" : " 3.4 .0" ,
127
- " zone.js" : " ^ 0.8.10 "
136
+ "rxjs" : " 5.4.0 " ,
137
+ "sw-toolbox" : " 3.6 .0" ,
138
+ "zone.js" : " 0.8.12 "
128
139
},
129
140
"devDependencies" : {
130
- " @ionic/app-scripts" : " 1.3.7" ,
131
- " typescript" : " ~2.2.1"
141
+ "@ionic/app-scripts" : " 1.3.12" ,
142
+ "@ionic/cli-plugin-ionic-angular" : " 1.3.1" ,
143
+ "typescript" : " ~2.3.4"
132
144
}
133
145
134
146
```
@@ -157,9 +169,9 @@ C:\projects\auth-ng4-ionic3-af2>npm install angularfire2 firebase --save
157
169
158
170
_ This should add angularfire2 and firebase entry in your project's package.json file in dependencies section. Something similar_
159
171
160
- > "angularfire2": "^4.0.0-rc.0 ",
172
+ > "angularfire2": "^4.0.0-rc.1 ",
161
173
162
- > "firebase": "^3.9.0 ",
174
+ > "firebase": "^4.1.3 ",
163
175
164
176
### Setup @NgModule
165
177
@@ -176,7 +188,7 @@ and add the following three entries.
176
188
177
189
your ` app.module.ts ` file should look something like this.
178
190
179
- ``` bash
191
+ ``` typescript
180
192
181
193
import { BrowserModule } from ' @angular/platform-browser' ;
182
194
import { ErrorHandler , NgModule } from ' @angular/core' ;
@@ -239,7 +251,7 @@ following changes:
239
251
240
252
Your ` home.ts ` file should look like this.
241
253
242
- ` ` ` bash
254
+ ``` typescript
243
255
244
256
import { Component } from ' @angular/core' ;
245
257
import { NavController } from ' ionic-angular' ;
@@ -265,7 +277,7 @@ export class HomePage {
265
277
266
278
** Update** your ` home.html ` at ` src/pages/home/home.html ` , with following entry
267
279
268
- ```bash
280
+ ``` html
269
281
270
282
<ion-header >
271
283
<ion-navbar >
@@ -327,7 +339,7 @@ removing calls to fetch data.`
327
339
328
340
The ` home.html ` should look like below
329
341
330
- ` ` ` bash
342
+ ``` html
331
343
332
344
<ion-header >
333
345
<ion-navbar >
@@ -352,7 +364,7 @@ Let's update the `home.ts` to add the corresponding methods:
352
364
353
365
The ` home.ts ` should look like below
354
366
355
- ```bash
367
+ ``` typescript
356
368
import { Component } from ' @angular/core' ;
357
369
import { NavController } from ' ionic-angular' ;
358
370
@@ -404,7 +416,7 @@ Also add the property in our template to render them on screen.
404
416
405
417
Your ` home.ts ` should look as follows:
406
418
407
- ` ` ` bash
419
+ ``` typescript
408
420
409
421
import { Component } from ' @angular/core' ;
410
422
import { NavController } from ' ionic-angular' ;
@@ -448,7 +460,7 @@ export class HomePage {
448
460
449
461
and ` home.html ` shouldlook like this
450
462
451
- ` ` ` bash
463
+ ``` html
452
464
453
465
<ion-header >
454
466
<ion-navbar >
@@ -516,13 +528,13 @@ and `APP_NAME` with your App Name.
516
528
``` bash
517
529
518
530
C:\p rojects\a uth-ng4-ionic3-af2>
519
- ionic plugin add cordova-plugin-facebook4 --variable APP_ID=" 123456789" --variable APP_NAME=" myApplication" --save
531
+ ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID=" 123456789" --variable APP_NAME=" myApplication"
520
532
521
533
```
522
534
523
535
This should add following entry in your config.xml, located at the root of your project.
524
536
525
- ` ` ` bash
537
+ ``` xml
526
538
527
539
<plugin name =" cordova-plugin-facebook4" spec =" ~1.7.4" >
528
540
<variable name =" APP_ID" value =" 1689092456387654" />
@@ -546,12 +558,12 @@ After executing the above command, ensure you got following entry in your `packa
546
558
547
559
``` bash
548
560
549
- " @ionic-native/facebook" : " ^3.5.0 " ,
561
+ " @ionic-native/facebook" : " ^3.12.1 " ,
550
562
551
563
```
552
564
Now import the ` Platform ` and ` Facebook ` objects in your ` home.ts ` and inject the objects in constructor.
553
565
554
- ` ` ` bash
566
+ ``` typescript
555
567
556
568
import { Platform } from ' ionic-angular' ;
557
569
import { Facebook } from ' @ionic-native/facebook' ;
@@ -562,7 +574,7 @@ Update the "signInWithFacebook" method and use Platform Service to determine the
562
574
563
575
your ` home.ts ` should look as below
564
576
565
- ` ` ` bash
577
+ ``` typescript
566
578
567
579
import { Component } from ' @angular/core' ;
568
580
import { NavController } from ' ionic-angular' ;
@@ -619,7 +631,7 @@ You'll also need to add the "Facebook" object in the provider section in app.mod
619
631
620
632
The final ` app.module.ts ` should look like below
621
633
622
- ```bash
634
+ ``` typescript
623
635
624
636
import { BrowserModule } from ' @angular/platform-browser' ;
625
637
import { ErrorHandler , NgModule } from ' @angular/core' ;
@@ -684,7 +696,7 @@ Everything should work. Now trying running the app on your android phone
684
696
685
697
``` bash
686
698
687
- C:\projects\auth-ng4-ionic3-af2> ionic run android
699
+ C:\p rojects\a uth-ng4-ionic3-af2> ionic cordova run android
688
700
689
701
```
690
702
0 commit comments