程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Firebase Apple 登录 Xamarin Forms 实现大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决Firebase Apple 登录 Xamarin Forms 实现?

开发过程中遇到Firebase Apple 登录 Xamarin Forms 实现的问题如何解决?下面主要结合日常开发的经验,给出你关于Firebase Apple 登录 Xamarin Forms 实现的解决方法建议,希望对你解决Firebase Apple 登录 Xamarin Forms 实现有所启发或帮助;

大家好,我有这个分布式系统,它由 2 个应用程序和一个网站组成,它们都与 Firebase 项目通信。@H_262_3@

由于我不久前实施了 Facebook 登录,因此我必须强制实施 Signing with Apple,现在必须向 Apple Store 提交新版本的应用程序。@H_262_3@

现在,我已经设法使用 React 在我的网站上通过以下流程实现了苹果登录:@H_262_3@

 AppleLogin using Popup -> 
 jwtToken -> 
 callBACk to my BACkend service to valIDate generate the public key ->
 session start
@H_674_11@

现在我必须使用 Firebase.Auth 块在 Xamarin.Forms 上实现所有这些,我需要一个在 AndroID 和 iOS 上都可以使用的跨平台解决方案(我已经添加了 Apple Signin 功能,所以没有问题),唯一的问题是,在 Firebase.Auth 中不存在任何支持苹果登录或使用弹出流登录的原语,我发现的唯一一件事是:@H_262_3@

}@H_262_3@

/// <sumMary>
/// Signin a user insIDe Firebase using the apple login service
/// </sumMary>
/// <returns>Wrapper containing the response of the operation.</returns>
public async Task<authenticationWrapper> appleLoginAsync()
{
    try
    {
       
        var authprovIDer = new FirebaseauthprovIDer(new FirebaseConfig(PersistanceStorage.APIKEY));
        this.sessione = await authprovIDer.SignInWithOAuthAsync(FirebaseAuthType.Apple,TOKEN);

        Firebasetoken = Task.Fromresult(sessione.Firebasetoken);
        return new authenticationWrapper()
        {
            message = "Ok",code = "200"
        };

    }
    catch (Exception err)
    {
        return new authenticationWrapper()
        {
            message = err.message,code = "500"
        };
    }
}
@H_674_11@

现在我有检索 TOKEN 值的问题:@H_262_3@

    @H_618_23@

    应该是什么? jwt苹果令牌?@H_262_3@ @H_618_23@

    我该怎么做?据我所知,有使用 Xamarin.Essentials 的本机支持,但仅适用于 >IOS 13 而没有 AndroID:@H_262_3@

    /// <sumMary>
    /// Start the authentication process insIDe apple services.
    /// </sumMary>
    /// <returns></returns>
    public async Task authAsync() {
        WebAuthenticatorResult result = null;
    
        if (App.isIosPlatform() && DeviceInfo.Version.Major >= 13)
        {
            result = await AppleSignInAuthenticator.AuthenticateAsync();
        }
        else
        {
            throw new NotSupportedException("And Now?")
        }
    
        DeBUG.Writeline(result);
    }
    @H_674_11@
    
    

我也设法找到了 this example 但它真的很混乱。任何帮助将不胜感激,谢谢。@H_262_3@

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!@H_262_3@

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。@H_262_3@

小编邮箱:dio#foxmail.com (将#修改为@)@H_262_3@

大佬总结

以上是大佬教程为你收集整理的Firebase Apple 登录 Xamarin Forms 实现全部内容,希望文章能够帮你解决Firebase Apple 登录 Xamarin Forms 实现所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:实现登录