File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -154,3 +154,30 @@ export class RcTestAppComponent {
154154 }
155155}
156156```
157+
158+ ## Cordova case
159+
160+ Firebase authentication wasn't entirely compatible with cordova. You need to add some specific operations.
161+
162+ ** Example:**
163+
164+ Login with Facebook.
165+
166+ 1- Install cordova plugin
167+
168+ ``` cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication" ```
169+
170+ 2- Use signInWithCredential login method
171+
172+ ``` ts
173+ console .log (" Facebook success: " + JSON .stringify (result ));
174+ var provider = firebase .auth .FacebookAuthProvider .credential (result .authResponse .accessToken );
175+
176+ firebase .auth ().signInWithCredential (provider )
177+ .then ((success ) => {
178+ console .log (" Firebase success: " + JSON .stringify (success ));
179+ })
180+ .catch ((error ) => {
181+ console .log (" Firebase failure: " + JSON .stringify (error ));
182+ });
183+ ```
You can’t perform that action at this time.
0 commit comments