File tree Expand file tree Collapse file tree 5 files changed +21
-17
lines changed
apps/demo/src/plugin-demos Expand file tree Collapse file tree 5 files changed +21
-17
lines changed Original file line number Diff line number Diff line change 11import { Observable , EventData , Page } from '@nativescript/core' ;
22import { DemoSharedAppleSignIn } from '@demo/shared' ;
3- import { } from '@nativescript/apple-sign-in' ;
3+ import { SignIn } from '@nativescript/apple-sign-in' ;
44
55export function navigatingTo ( args : EventData ) {
66 const page = < Page > args . object ;
77 page . bindingContext = new DemoModel ( ) ;
88}
99
10-
11- export class DemoModel extends DemoSharedAppleSignIn {
12- login ( args ) {
13- console . log ( 'login' ) ;
14- }
15- }
10+ export class DemoModel extends DemoSharedAppleSignIn { }
Original file line number Diff line number Diff line change 44 </ActionBar >
55 </Page .actionBar>
66 <StackLayout class =" p-20" >
7- <ui : SignInButton tap =" {{ login }}" />
7+ <ui : SignInButton tap =" {{ login }}" height = " 56 " />
88 </StackLayout >
99</Page >
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ user sign themself in (after they pressed a nice button for instance).
4747``` typescript
4848import { SignIn , User } from " @nativescript/apple-sign-in" ;
4949
50- signIn (
50+ SignIn . signIn (
5151 {
5252 // 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)
5353 scopes: [" EMAIL" , " FULLNAME" ]
Original file line number Diff line number Diff line change 22<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33<plist version =" 1.0" >
44 <dict >
5- <key >com.apple.developer.contacts.notes</key >
6- <true />
5+ <key >com.apple.developer.applesignin</key >
6+ <array >
7+ <string >Default</string >
8+ </array >
79 </dict >
810</plist >
Original file line number Diff line number Diff line change 11import { DemoSharedBase } from '../utils' ;
2- import { } from '@nativescript/apple-sign-in' ;
2+ import { SignIn , User } from '@nativescript/apple-sign-in' ;
33
44export class DemoSharedAppleSignIn extends DemoSharedBase {
5-
6- testIt ( ) {
7- console . log ( 'test apple-sign-in!' ) ;
8- }
9- }
5+ login ( ) {
6+ SignIn . signIn ( {
7+ // 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)
8+ scopes : [ 'EMAIL' , 'FULL_NAME' ] ,
9+ } )
10+ . then ( ( result : User ) => {
11+ console . log ( 'Signed in, user: ' + result ) ;
12+ console . log ( 'Signed in, familyName: ' + result . fullName . familyName ) ;
13+ } )
14+ . catch ( ( err ) => console . log ( 'Error signing in: ' + err ) ) ;
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments