10000 feat(facebook): FB iOS SDK v18 (#617) · Ombuweb/plugins@74f3ece · GitHub
[go: up one dir, main page]

Skip to content

Commit 74f3ece

Browse files
feat(facebook): FB iOS SDK v18 (NativeScript#617)
1 parent 6b15c8e commit 74f3ece

File tree

8 files changed

+827
-58
lines changed

8 files changed

+827
-58
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ npm-debug.log
3636
yarn-error.log
3737
testem.log
3838
/typings
39+
.history
3940

4041
# System Files
4142
.DS_Store
@@ -58,4 +59,4 @@ packages/**/native-src/ios/**/xcuserdata/
5859
packages/**/native-src/ios/**/project.xcworkspace/
5960
packages/**/native-src/ios/**/build
6061
.nx/cache
61-
.nx/workspace-data
62+
.nx/workspace-data

apps/demo/src/plugin-demos/facebook.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<StackLayout class="p-4">
77
<ScrollView class="h-full">
88
<StackLayout>
9-
<Button text="Test facebook" tap="{{ testIt }}" class="btn btn-primary"/>
9+
<Button text="Test facebook Login" tap="{{ login }}" class="btn btn-primary"/>
1010

1111
</StackLayout>
1212
</ScrollView>
1313
</StackLayout>
14-
</Page>
14+
</Page>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pod 'FBSDKCoreKit', '~> 16.0.0'
2-
pod 'FBSDKLoginKit', '~> 16.0.0'
1+
pod 'FBSDKCoreKit', '~> 18.0.0'
2+
pod 'FBSDKLoginKit', '~> 18.0.0'

packages/facebook/typings/objc!FBAEMKit.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ declare var FBAEMNetworking: {
88
declare class FBAEMReporter extends NSObject implements FBSDKAEMReporter {
99
static alloc(): FBAEMReporter; // inherited from NSObject
1010

11+
static configureWithNetworkerAppIDReporter(networker: FBAEMNetworking, appID: string, reporter: FBSKAdNetworkReporting): void;
12+
13+
static configureWithNetworkerAppIDReporterAnalyticsAppIDStore(networker: FBAEMNetworking, appID: string, reporter: FBSKAdNetworkReporting, analyticsAppID: string, store: FBSDKDataPersisting): void;
14+
1115
static enable(): void;
1216

1317
static handle(url: NSURL): void;

packages/facebook/typings/objc!FBSDKCoreKit.d.ts

Lines changed: 728 additions & 38 deletions
Large diffs are not rendered by default.

packages/facebook/typings/objc!FBSDKCoreKit_Basics.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ declare var FBSDKCrashObserving: {
119119
};
120120

121121
interface FBSDKDataPersisting {
122+
fb_boolForKey(key: string): boolean;
123+
122124
fb_dataForKey(key: string): NSData;
123125

124126
fb_integerForKey(key: string): number;
@@ -127,6 +129,8 @@ interface FBSDKDataPersisting {
127129

128130
fb_removeObjectForKey(key: string): void;
129131

132+
fb_setBoolForKey(value: boolean, key: string): void;
133+
130134
fb_setIntegerForKey(integer: number, key: string): void;
131135

132136
fb_setObjectForKey(object: any, key: string): void;

packages/facebook/typings/objc!FBSDKLoginKit.d.ts

Lines changed: 74 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ declare class FBSDKDeviceLoginManager extends NSObject implements NSNetServiceDe
8989

9090
isMemberOfClass(aClass: typeof NSObject): boolean;
9191

92+
/**
93+
* @since 7.0
94+
*/
9295
netServiceDidAcceptConnectionWithInputStreamOutputStream(sender: NSNetService, inputStream: NSInputStream, outputStream: NSOutputStream): void;
9396

9497
netServiceDidNotPublish(sender: NSNetService, errorDict: NSDictionary<string, number>): void;
@@ -154,26 +157,55 @@ declare class FBSDKLoginButton extends FBSDKButton {
154157

155158
static appearance(): FBSDKLoginButton; // inherited from UIAppearance
156159

160+
/**
161+
* @since 8.0
162+
*/
157163
static appearanceForTraitCollection(trait: UITraitCollection): FBSDKLoginButton; // inherited from UIAppearance
158164

165+
/**
166+
* @since 8.0
167+
* @deprecated 9.0
168+
*/
159169
static appearanceForTraitCollectionWhenContainedIn(trait: UITraitCollection, ContainerClass: typeof NSObject): FBSDKLoginButton; // inherited from UIAppearance
160170

161-
static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(trait: UITraitCollection, containerTypes: NSArray<typeof NSObject> | typeof NSObject[]): FBSDKLoginButton; // inherited from UIAppearance
171+
/**
172+
* @since 9.0
173+
*/
174+
static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(trait: UITraitCollection, containerTypes: NSArray<typeof NSObject> | (typeof NSObject)[]): FBSDKLoginButton; // inherited from UIAppearance
162175

176+
/**
177+
* @since 5.0
178+
* @deprecated 9.0
179+
*/
163180
static appearanceWhenContainedIn(ContainerClass: typeof NSObject): FBSDKLoginButton; // inherited from UIAppearance
164181

165-
static appearanceWhenContainedInInstancesOfClasses(containerTypes: NSArray<typeof NSObject> | typeof NSObject[]): FBSDKLoginButton; // inherited from UIAppearance
182+
/**
183+
* @since 9.0
184+
*/
185+
static appearanceWhenContainedInInstancesOfClasses(containerTypes: NSArray<typeof NSObject> | (typeof NSObject)[]): FBSDKLoginButton; // inherited from UIAppearance
166186

187+
/**
188+
* @since 15.0
189+
*/
167190
static buttonWithConfigurationPrimaryAction(configuration: UIButtonConfiguration, primaryAction: UIAction): FBSDKLoginButton; // inherited from UIButton
168191

169192
static buttonWithType(buttonType: UIButtonType): FBSDKLoginButton; // inherited from UIButton
170193

194+
/**
195+
* @since 14.0
196+
*/
171197
static buttonWithTypePrimaryAction(buttonType: UIButtonType, primaryAction: UIAction): FBSDKLoginButton; // inherited from UIButton
172198

173199
static new(): FBSDKLoginButton; // inherited from NSObject
174200

201+
/**
202+
* @since 13.0
203+
*/
175204
static systemButtonWithImageTargetAction(image: UIImage, target: any, action: string): FBSDKLoginButton; // inherited from UIButton
176205

206+
/**
207+
* @since 14.0
208+
*/
177209
static systemButtonWithPrimaryAction(primaryAction: UIAction): FBSDKLoginButton; // inherited from UIButton
178210

179211
authType: string;
@@ -252,6 +284,8 @@ declare class FBSDKLoginCompletionParameters extends NSObject {
252284
profile: FBSDKProfile;
253285

254286
userID: string;
287+
288+
userTokenNonce: string;
255289
}
256290

257291
declare class FBSDKLoginConfiguration extends NSObject {
@@ -421,15 +455,32 @@ declare class FBSDKLoginTooltipView extends FBSDKTooltipView {
421455

422456
static appearance(): FBSDKLoginTooltipView; // inherited from UIAppearance
423457

458+
/**
459+
* @since 8.0
460+
*/
424461
static appearanceForTraitCollection(trait: UITraitCollection): FBSDKLoginTooltipView; // inherited from UIAppearance
425462

463+
/**
464+
* @since 8.0
465+
* @deprecated 9.0
466+
*/
426467
static appearanceForTraitCollectionWhenContainedIn(trait: UITraitCollection, ContainerClass: typeof NSObject): FBSDKLoginTooltipView; // inherited from UIAppearance
427468

428-
static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(trait: UITraitCollection, containerTypes: NSArray<typeof NSObject> | typeof NSObject[]): FBSDKLoginTooltipView; // inherited from UIAppearance
469+
/**
470+
* @since 9.0
471+
*/
472+
static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(trait: UITraitCollection, containerTypes: NSArray<typeof NSObject> | (typeof NSObject)[]): FBSDKLoginTooltipView; // inherited from UIAppearance
429473

474+
/**
475+
* @since 5.0
476+
* @deprecated 9.0
477+
*/
430478
static appearanceWhenContainedIn(ContainerClass: typeof NSObject): FBSDKLoginTooltipView; // inherited from UIAppearance
431479

432-
static appearanceWhenContainedInInstancesOfClasses(containerTypes: NSArray<typeof NSObject> | typeof NSObject[]): FBSDKLoginTooltipView; // inherited from UIAppearance
480+
/**
481+
* @since 9.0
482+
*/
483+
static appearanceWhenContainedInInstancesOfClasses(containerTypes: NSArray<typeof NSObject> | (typeof NSObject)[]): FBSDKLoginTooltipView; // inherited from UIAppearance
433484

434485
static new(): FBSDKLoginTooltipView; // inherited from NSObject
435486

@@ -482,15 +533,32 @@ declare class FBSDKTooltipView extends UIView {
482533

483534
static appearance(): FBSDKTooltipView; // inherited from UIAppearance
484535

536+
/**
537+
* @since 8.0
538+
*/
485539
static appearanceForTraitCollection(trait: UITraitCollection): FBSDKTooltipView; // inherited from UIAppearance
486540

541+
/**
542+
* @since 8.0
543+
* @deprecated 9.0
544+
*/
487545
static appearanceForTraitCollectionWhenContainedIn(trait: UITraitCollection, ContainerClass: typeof NSObject): FBSDKTooltipView; // inherited from UIAppearance
488546

489-
static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(trait: UITraitCollection, containerTypes: NSArray<typeof NSObject> | typeof NSObject[]): FBSDKTooltipView; // inherited from UIAppearance
547+
/**
548+
* @since 9.0
549+
*/
550+
static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(trait: UITraitCollection, containerTypes: NSArray<typeof NSObject> | (typeof NSObject)[]): FBSDKTooltipView; // inherited from UIAppearance
490551

552+
/**
553+
* @since 5.0
554+
* @deprecated 9.0
555+
*/
491556
static appearanceWhenContainedIn(ContainerClass: typeof NSObject): FBSDKTooltipView; // inherited from UIAppearance
492557

493-
static appearanceWhenContainedInInstancesOfClasses(containerTypes: NSArray<typeof NSObject> | typeof NSObject[]): FBSDKTooltipView; // inherited from UIAppearance
558+
/**
559+
* @since 9.0
560+
*/
561+
static appearanceWhenContainedInInstancesOfClasses(containerTypes: NSArray<typeof NSObject> | (typeof NSObject)[]): FBSDKTooltipView; // inherited from UIAppearance
494562

495563
static new(): FBSDKTooltipView; // inherited from NSObject
496564

tools/demo/facebook/index.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import { DemoSharedBase } from '../utils';
22
import { LoginManager } from '@nativescript/facebook';
33

44
export class DemoSharedFacebook extends DemoSharedBase {
5-
6-
testIt() {
7-
LoginManager.logInWithPermissions(['public_profile']).then(profile => {
8-
console.log('profile', profile);
9-
}).catch(e => {
10-
console.log('Facebook login error:', e);
11-
})
12-
}
13-
}
5+
login() {
6+
LoginManager.init();
7+
LoginManager.logInWithPermissions(['public_profile'])
8+
.then((profile) => {
9+
console.log('profile', profile);
10+
})
11+
.catch((e) => {
12+
console.log('Facebook login error:', e);
13+
});
14+
}
15+
}

0 commit comments

Comments
 (0)
0