当前位置: 首页 > 软件库 > 手机/移动开发 > >

nativescript-apple-sign-in

授权协议 Apache-2.0 License
开发语言 JavaScript TypeScript
所属分类 手机/移动开发
软件类型 开源软件
地区 不详
投 递 者 耿俊
操作系统 iOS
开源组织
适用人群 未知
 软件概览

Sign In with Apple, for NativeScript

Plugin version 2+ is compatible with NativeScript 7+. If you use an older NativeScript version, please use plugin version 1.1.0.

Requirements

  • Go to the Apple developer website and create a new app identifier with the "Sign In with Apple" Capability enabled. Make sure you sign your app with a provisioning profile using that app identifier.
  • Open your app's App_Resources/iOS folder and add this (or append) to a file named app.entitlements.

Installation

tns plugin add nativescript-apple-sign-in

Demo app

If you're stuck or want a quick demo of how this works, check out the demo app:

git clone https://github.com/EddyVerbruggen/nativescript-apple-sign-in
cd nativescript-apple-sign-in/src
npm run demo.ios

API

isSignInWithAppleSupported

Sign In with Apple was added in iOS 13, so make sure to call this function before showing a "Sign In with Apple" button in your app.On iOS < 13 and Android this will return false.

import { isSignInWithAppleSupported } from "nativescript-apple-sign-in";

const supported: boolean = isSignInWithAppleSupported();

signInWithApple

Now that you know "Sign In with Apple" is supported on this device, you can have theuser sign themself in (after they pressed a nice button for instance).

import { signInWithApple, SignInWithAppleAuthorization } from "nativescript-apple-sign-in";

signInWithApple(
    {
        // by default you don't get these details, but if you provide these scopes you will (and the user will get to choose which ones are allowed)
        scopes: ["EMAIL", "FULLNAME"]
    })
    .then((result: SignInWithAppleAuthorization) => {
        console.log("Signed in, credential: " + result.credential);
        console.log("Signed in, familyName: " + result.credential.fullName.familyName);
        // you can remember the user to check the sign in state later (see 'getSignInWithAppleState' below)
        this.user = result.credential.user;
    })
    .catch(err => console.log("Error signing in: " + err));

getSignInWithAppleState

⚠️ This does not seem to work on a simulator!

If you want to know the current Sign In status of your user, you can pass the user (id) you acquired previously.

import { getSignInWithAppleState } from "nativescript-apple-sign-in";

const user: string = "the id you got back from the signInWithApple function";

getSignInWithAppleState(user)
    .then(state => console.log("Sign in state: " + state))
    .catch(err => console.log("Error getting sign in state: " + err));
  • Sign in with Apple 服务端要做的其实很简单 nodejs需要装三个东西 npm install node-rsa npm install axios npm install jsonwebtoken 提供一个接口让客户端上传他那边获取到的identity 当客户端通过请求你提供的接口时,服务端可以使用axios请求这个接口 https://appleid.apple.com/au

  • 公司项目需要接入sign in with Apple,花了几天时间,查看各种文档博客,最终完成接入。 客户端接入遇到的一些问题 1.首次登录时调用的代码: if (@available(iOS 13.0, *)) { // 基于用户的Apple ID授权用户,生成用户授权请求的一种机制 ASAuthorizationAppleIDProvider *appleIDP

  • 详细配置参考:https://developer.okta.com/blog/2019/06/04/what-the-heck-is-sign-in-with-apple 本文主要参考: https://easeapi.com/blog/blog/88-sign-with-apple.html https://blog.csdn.net/wpf199402076118/article/detail

  • 苹果登录会验证用户:identityToken 的合法性,验证方法是JWT验证。   完整的验证identityToken的代码可参考:https://github.com/GriffinLedingham/php-apple-signin  use AppleSignIn\ASDecoder; $identityToken = Request::instance()->param('identi

  • <?php /** * Sign in with Apple 示例 * composer安装: composer require griffinledingham/php-apple-signin * 引用 ASDecoder.php 类 */ use AppleSignIn\ASDecoder; session_start(); class Api_Login extends Api_C

  • 前言 App Store审核要求: New Guidelines for Sign in with Apple We’ve updated the App Store Review Guidelines to provide criteria for when apps are required to use Sign in with Apple. Starting today, new apps

  • 不得提一嘴,苹果的开发者文档写的真不怎么样,可能是我英语水平比较菜吧。。。 这里只介绍基于JWT的算法的验证方式,据说基于授权码的后端验证比较麻烦,csdn上有位老哥也许是老弟搞了几天都没成功!话说回来基于JWT的算法的验证的我也搞了好久,还是在iOS小哥哥的帮助下搞定的! 遇到的错误:JWT signature does not match locally computed signature.

  • 1. 用户授权 当用户在IOS APP端授权登陆之后,APP端可以拿到 identityToken, authorizationCode, userID 这三个字段的数据。 2. php-jwt 后端从前端接收到 identityToken 字符串之后,由于 identityToken 是一个 JWT,因此我们需要安装如下第三方库对 identityToken 进行解析 composer requ

  • 苹果登陆iOS 13-Sign In with Apple

  • 苹果在2019年 9 月12 号更新了审核指南,加入 4.8 Sign in with Apple 一条,要求所有使用第三方登录 的 App,都必须接入 Sign in with Apple。已经上架的 App 需在 2020 年 4 月 前完成接入工作,新上架 App(如果支持三方登录)必须接入Sign in with Apple,否则将被拒。 App登录成功后,需要将获取到的 identity

  • 最近上架APP被苹果拒绝,理由是使用第三方登录需加上苹果登录,否则不给上架,所以在这分享一下ionic4的苹果登录 首先安装cordova插件,获取系统版本插件 ionic cordova plugin add cordova-plugin-sign-in-with-apple ionic cordova plugin add cordova-plugin-device npm install @

  • IOS苹果登录sign in with apple后端校验 最近新开发的app在IOS平台app store connent提审的时候,被拒了,原因是app上如果有接第三方登陆(比如微信,微博,facebook等),那就必须要接apple id登陆,坑爹~苹果霸权啊!然而没办法,所以只能接入苹果登录。 APP端的接入可以看上一篇博客:iOS苹果授权登录(Sign in with Apple)/Ap

  • APP端苹果登录java后端校验 主要校验苹果授权登录token 是否正确 主要方法 public RSAPublicKeySpec build(final String n, final String e) { final BigInteger modulus = new BigInteger(1, Base64.decodeBase64(n)); final BigInteger public

 相关资料
  • 如果number大于0,则返回1;如果number为0,则返回0;如果number小于0,则返回-1。 语法 (Syntax) SIGN(i) 参数 (Parameters) i - 需要确定符号的输入数字。 返回值 (Return Value) 如果number大于0,则返回1;如果number为0,则返回0;如果number小于0,则返回-1。 例子 (Example) /* Main p

  • 返回减一,零或加一,具体取决于数字的符号和数值。 如果数字小于零,则此属性返回减1,如果数字大于零,则返回1,如果数字等于零,则返回0。 语法 (Syntax) num.sign 例子 (Example) void main() { int posNum = 10; int negNum = -12; int valZero = 0; print(posNum.s

  • sign 签名工具,给出任意一个字符串,可以生成基本不会重合的2个32位无符号的数字。如果自己是数字,那么就直接赋值给低位。检索用的可能比较多。 1 API int create_sign64(const char* input, unsigned int* sign1, unsigned int* sign2); input 是输入 sign1 是返回的高位 sign2 是返回的低位 2 代码范

  • HTTP Sign 是一个RESTful API 签名认证项目。 该项目将解决HTTP通信中的如下问题: 防止重放攻击 防止中途篡改数据 保证请求服务幂等 从而,尽可能地让 HTTP 通信接近安全。 HTTP Sign 的设计 字面约定 字面格式 含义 < > 变量 [ ] 可选项 { } 必选项 | 互斥关系 标点符号 本文一律采用英文标点符号 请求参数名,命名规则 首字母小写,如果名称由多个单

  • 在本章中,我们将了解如何使用带有Gradle构建的Spring Boot应用程序添加Google OAuth2登录。 首先,在构建配置文件中添加Spring Boot OAuth2安全依赖项,下面给出了构建配置文件。 buildscript { ext { springBootVersion = '1.5.8.RELEASE' } repositories {

  • 问题内容: 我在SQL Server上有很好的经验,但是突然我发现了这个奇怪的命令 或者 始终返回标量值为零(),或者返回所有值为的新列 那是什么? 问题答案: 当SQL Server遇到您的符号时,它将自动将其转换为数据类型。由于美元符号后没有显式值,因此SQL Server假设为。从MSDN: 转换为或时,假定整数为货币单位。例如,整数值4转换为等值的货币4美元(对于us_english,默认