Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

i am trying to implement the apple-sign-in method using a cordova plugin and set the credentials to firebase.

what i actually have is:

    constructor (
        public afAuth: AngularFireAuth,
        public afs: AngularFirestore,
        @Inject(FirebaseApp) firebase: any
    ){
        this.firebase = firebase;
    }

    loginApple(): Promise<boolean> {
        return new Promise((resolve, reject) => {
            cordova.plugins.SignInWithApple.signin({ 
                requestedScopes: [0, 1] 
            }, function(succ){
                var provider = new firebase.auth.OAuthProvider('apple.com').credential(succ.identityToken);
                this.afAuth.auth.signinWithCredential(provider).then(result => {
                    //--> it seems the problem is here, because variable THIS is not available in the cordova plugin without a ionic-native wrapper <--
                }).catch( error => {
                    reject( error.message || error );
                })
            }, function(err){
                reject("Apple login failed");
            })
        })
    }
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
160 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...