From 79120effc7c977fba6edfd0b929edb2fa3d02e23 Mon Sep 17 00:00:00 2001 From: VladimirAmiorkov Date: Wed, 15 May 2019 17:22:44 +0300 Subject: [PATCH 1/3] feat: upgrade to latest native iOS Facebook SDK frameworks --- demo-angular/app/app.module.ts | 6 +- demo-vue/app/app.js | 3 +- demo/app/app.ts | 4 +- src/index.android.ts | 1 - src/index.d.ts | 1 - src/index.ios.ts | 5 +- src/login-behavior.d.ts | 24 -- src/login-behavior.ts | 6 - src/login-manager.android.ts | 3 +- src/login-manager.d.ts | 4 +- src/login-manager.ios.ts | 12 +- src/platforms/ios/Podfile | 6 +- .../ios/typings/objc!FBSDKCoreKit.d.ts | 331 +++++++-------- .../ios/typings/objc!FBSDKLoginKit.d.ts | 66 +-- .../ios/typings/objc!FBSDKShareKit.d.ts | 387 +++--------------- 15 files changed, 251 insertions(+), 608 deletions(-) delete mode 100644 src/login-behavior.d.ts delete mode 100644 src/login-behavior.ts diff --git a/demo-angular/app/app.module.ts b/demo-angular/app/app.module.ts index bd8863c..406530d 100644 --- a/demo-angular/app/app.module.ts +++ b/demo-angular/app/app.module.ts @@ -2,16 +2,14 @@ import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; import { NativeScriptModule } from "nativescript-angular/nativescript.module"; import { NativeScriptRouterModule } from "nativescript-angular/router"; import { AppComponent } from "./app.component"; -import { LoginModule } from "./pages/login/login.module"; -import { HomeModule } from "./pages/home/home.module"; import { NativeScriptFacebookModule } from "nativescript-facebook/angular"; import * as application from 'tns-core-modules/application'; import { routes } from "./app.routing"; import { NavigationService } from "./services/navigation.service"; -import { init, LoginBehavior } from "nativescript-facebook"; +import { init } from "nativescript-facebook"; application.on(application.launchEvent, function (args) { - init("1771472059772879", LoginBehavior.LoginBehaviorWeb); + init("1771472059772879"); }); @NgModule({ diff --git a/demo-vue/app/app.js b/demo-vue/app/app.js index a674dad..076c739 100644 --- a/demo-vue/app/app.js +++ b/demo-vue/app/app.js @@ -4,7 +4,6 @@ import Login from "./components/Login"; import { init, - LoginBehavior } from 'nativescript-facebook'; import FacebookPlugin from "nativescript-facebook/vue"; @@ -13,7 +12,7 @@ Vue.use(FacebookPlugin); Vue.config.silent = true; application.on(application.launchEvent, function (args) { - init("1771472059772879", LoginBehavior.LoginBehaviorWeb); + init("1771472059772879"); }); new Vue({ diff --git a/demo/app/app.ts b/demo/app/app.ts index 1155f8f..2f7b977 100644 --- a/demo/app/app.ts +++ b/demo/app/app.ts @@ -1,8 +1,8 @@ import * as application from 'tns-core-modules/application'; -import { init, LoginBehavior } from "nativescript-facebook"; +import { init } from "nativescript-facebook"; application.on(application.launchEvent, function (args) { - init("1771472059772879", LoginBehavior.LoginBehaviorWeb); + init("1771472059772879"); }); application.run({ moduleName: "app-root" }); diff --git a/src/index.android.ts b/src/index.android.ts index a954a70..a113366 100644 --- a/src/index.android.ts +++ b/src/index.android.ts @@ -1,6 +1,5 @@ export * from "./login-manager"; export * from "./ui/login-button"; export * from "./login-event-data"; -export * from "./login-behavior"; export * from './share-manager'; export * from "./ui/share-button"; \ No newline at end of file diff --git a/src/index.d.ts b/src/index.d.ts index 8b7fdaf..12ac365 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -2,6 +2,5 @@ export * from "./login-manager"; export * from "./ui/login-button"; export * from "./login-response"; export * from "./login-event-data"; -export * from "./login-behavior"; export * from './share-manager'; export * from "./ui/share-button"; diff --git a/src/index.ios.ts b/src/index.ios.ts index ec58754..f33788b 100644 --- a/src/index.ios.ts +++ b/src/index.ios.ts @@ -2,7 +2,6 @@ import * as applicationModule from "tns-core-modules/application"; export * from "./ui/login-button"; export * from "./login-manager"; export * from "./login-event-data"; -export * from "./login-behavior"; export * from './share-manager'; export * from "./ui/share-button"; @@ -13,11 +12,11 @@ class BaseDelegate extends UIResponder implements UIApplicationDelegate { public static ObjCProtocols = [UIApplicationDelegate]; applicationDidFinishLaunchingWithOptions(application: UIApplication, launchOptions: NSDictionary): boolean { - return FBSDKApplicationDelegate.sharedInstance().applicationDidFinishLaunchingWithOptions(application, launchOptions); + return FBSDKApplicationDelegate.sharedInstance.applicationDidFinishLaunchingWithOptions(application, launchOptions); } applicationOpenURLSourceApplicationAnnotation(application, url, sourceApplication, annotation) { - return FBSDKApplicationDelegate.sharedInstance().applicationOpenURLSourceApplicationAnnotation(application, url, sourceApplication, annotation); + return FBSDKApplicationDelegate.sharedInstance.applicationOpenURLSourceApplicationAnnotation(application, url, sourceApplication, annotation); } applicationDidBecomeActive(application: UIApplication): void { diff --git a/src/login-behavior.d.ts b/src/login-behavior.d.ts deleted file mode 100644 index 98c5d82..0000000 --- a/src/login-behavior.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -export declare enum LoginBehavior { - /** - This is the default behavior, and indicates logging in through the native - Facebook app may be used. The SDK may still use Safari instead. - */ - LoginBehaviorNative = 0, - /** - Attempts log in through the Safari or SFSafariViewController, if available. - */ - LoginBehaviorBrowser = 1, - /** - Attempts log in through the Facebook account currently signed in through - the device Settings. - @note If the account is not available to the app (either not configured by user or - as determined by the SDK) this behavior falls back to \c LoginBehaviorNative. - */ - LoginBehaviorSystemAccount = 2, - /** - Attempts log in through a modal \c UIWebView pop up - @note This behavior is only available to certain types of apps. Please check the Facebook - Platform Policy to verify your app meets the restrictions. - */ - LoginBehaviorWeb = 3, -} \ No newline at end of file diff --git a/src/login-behavior.ts b/src/login-behavior.ts deleted file mode 100644 index df839c9..0000000 --- a/src/login-behavior.ts +++ /dev/null @@ -1,6 +0,0 @@ -export enum LoginBehavior { - LoginBehaviorNative = 0, - LoginBehaviorBrowser = 1, - LoginBehaviorSystemAccount = 2, - LoginBehaviorWeb = 3, -} \ No newline at end of file diff --git a/src/login-manager.android.ts b/src/login-manager.android.ts index 03140b4..2dbdd71 100644 --- a/src/login-manager.android.ts +++ b/src/login-manager.android.ts @@ -1,7 +1,6 @@ import * as application from "tns-core-modules/application"; import { LoginResponse } from './login-response'; import { FacebookAccessToken } from "./facebook-access-token"; -import { LoginBehavior } from "./login-behavior"; const LOGIN_PERMISSIONS = ["public_profile", "email"]; @@ -15,7 +14,7 @@ export function _registerLogoutCallback(callback: Function) { onLogoutCallback = callback; } -export function init(fbId: string, fbLoginBehavior: LoginBehavior = LoginBehavior.LoginBehaviorBrowser) { +export function init(fbId: string) { com.facebook.FacebookSdk.setAutoLogAppEventsEnabled(true); setAppId(fbId); androidApplication = application.android; diff --git a/src/login-manager.d.ts b/src/login-manager.d.ts index 88f8f72..a70bd85 100644 --- a/src/login-manager.d.ts +++ b/src/login-manager.d.ts @@ -2,15 +2,13 @@ export declare function _registerLoginCallback(callback: Function): void; export declare function _registerLogoutCallback(callback: Function): void; export declare let onLoginCallback: Function; export declare let onLogoutCallback: Function; -import { LoginBehavior } from "./login-behavior"; import { FacebookAccessToken } from "./facebook-access-token"; /** * Sets the Facebook application Id for the current app and init the native facebook sdk. * @param {string} fbAppId the application Id -* @param {LoginBehavior} fbLoginBehavior (iOS only) specifies the login behavior, default value: LoginBehavior.FBSDKLoginBehaviorSystemAccount */ -export declare function init(fbId: string, fbLoginBehavior?: LoginBehavior): void; +export declare function init(fbId: string): void; /** * Request the specified publish permissions. * @param {string[]} permissions Array of the requested publish permissions. diff --git a/src/login-manager.ios.ts b/src/login-manager.ios.ts index 9966d68..6969ed6 100644 --- a/src/login-manager.ios.ts +++ b/src/login-manager.ios.ts @@ -1,6 +1,4 @@ -import * as applicationModule from "tns-core-modules/application"; import { LoginResponse } from './login-response'; -import { LoginBehavior } from './login-behavior'; import { FacebookAccessToken } from "./facebook-access-token"; const LOGIN_PERMISSIONS = ["public_profile", "email"]; @@ -11,10 +9,10 @@ export let onLogoutCallback; let loginManager; -export function init(fbId: string, fbLoginBehavior: LoginBehavior = LoginBehavior.LoginBehaviorBrowser) { +export function init(fbId: string) { setAppId(fbId); loginManager = FBSDKLoginManager.alloc().init(); - loginManager.loginBehavior = fbLoginBehavior; + loginManager.loginBehavior = FBSDKLoginBehavior.Browser; } export function _registerLogoutCallback(callback: Function) { @@ -53,7 +51,7 @@ export function _registerLoginCallback(callback: Function) { } function setAppId(fbAppId: string) { - FBSDKSettings.setAppID(fbAppId); + FBSDKSettings.appID = fbAppId; } export function requestPublishPermissions(permissions: string[], callback: Function) { @@ -63,7 +61,7 @@ export function requestPublishPermissions(permissions: string[], callback: Funct export function requestReadPermissions(permissions: string[], callback: Function) { _registerLoginCallback(callback); - loginManager.logInWithReadPermissionsHandler(permissions, onLoginCallback); + loginManager.logInWithPermissionsFromViewControllerHandler(permissions, undefined, onLoginCallback); } export function login(callback: Function) { @@ -71,7 +69,7 @@ export function login(callback: Function) { } export function getCurrentAccessToken() { - let sdkAccessToken = FBSDKAccessToken.currentAccessToken(); + let sdkAccessToken = FBSDKAccessToken.currentAccessToken; let accessToken = null; if (sdkAccessToken) { diff --git a/src/platforms/ios/Podfile b/src/platforms/ios/Podfile index 8bf00ba..b9a5bbe 100644 --- a/src/platforms/ios/Podfile +++ b/src/platforms/ios/Podfile @@ -1,3 +1,3 @@ -pod 'FBSDKCoreKit', '~> 4.38.0' -pod 'FBSDKLoginKit', '~> 4.38.0' -pod 'FBSDKShareKit', '~> 4.38.0' \ No newline at end of file +pod 'FBSDKCoreKit', '~> 5.0' +pod 'FBSDKLoginKit', '~> 5.0' +pod 'FBSDKShareKit', '~> 5.0' diff --git a/src/platforms/ios/typings/objc!FBSDKCoreKit.d.ts b/src/platforms/ios/typings/objc!FBSDKCoreKit.d.ts index d74b17f..9a983c5 100644 --- a/src/platforms/ios/typings/objc!FBSDKCoreKit.d.ts +++ b/src/platforms/ios/typings/objc!FBSDKCoreKit.d.ts @@ -3,29 +3,25 @@ declare class FBSDKAccessToken extends NSObject implements FBSDKCopying, NSSecur static alloc(): FBSDKAccessToken; // inherited from NSObject - static currentAccessToken(): FBSDKAccessToken; - - static currentAccessTokenIsActive(): boolean; - static new(): FBSDKAccessToken; // inherited from NSObject static refreshCurrentAccessToken(completionHandler: (p1: FBSDKGraphRequestConnection, p2: any, p3: NSError) => void): void; - static setCurrentAccessToken(token: FBSDKAccessToken): void; - readonly appID: string; readonly dataAccessExpirationDate: Date; readonly dataAccessExpired: boolean; - readonly declinedPermissions: NSSet; + readonly declinedPermissions: NSSet; readonly expirationDate: Date; readonly expired: boolean; - readonly permissions: NSSet; + readonly expiredPermissions: NSSet; + + readonly permissions: NSSet; readonly refreshDate: Date; @@ -33,6 +29,10 @@ declare class FBSDKAccessToken extends NSObject implements FBSDKCopying, NSSecur readonly userID: string; + static currentAccessToken: FBSDKAccessToken; + + static readonly currentAccessTokenIsActive: boolean; + readonly debugDescription: string; // inherited from NSObjectProtocol readonly description: string; // inherited from NSObjectProtocol @@ -49,9 +49,7 @@ declare class FBSDKAccessToken extends NSObject implements FBSDKCopying, NSSecur constructor(o: { coder: NSCoder; }); // inherited from NSCoding - constructor(o: { tokenString: string; permissions: NSArray | any[]; declinedPermissions: NSArray | any[]; appID: string; userID: string; expirationDate: Date; refreshDate: Date; }); - - constructor(o: { tokenString: string; permissions: NSArray | any[]; declinedPermissions: NSArray | any[]; appID: string; userID: string; expirationDate: Date; refreshDate: Date; dataAccessExpirationDate: Date; }); + constructor(o: { tokenString: string; permissions: NSArray | string[]; declinedPermissions: NSArray | string[]; expiredPermissions: NSArray | string[]; appID: string; userID: string; expirationDate: Date; refreshDate: Date; dataAccessExpirationDate: Date; }); class(): typeof NSObject; @@ -67,9 +65,7 @@ declare class FBSDKAccessToken extends NSObject implements FBSDKCopying, NSSecur initWithCoder(aDecoder: NSCoder): this; - initWithTokenStringPermissionsDeclinedPermissionsAppIDUserIDExpirationDateRefreshDate(tokenString: string, permissions: NSArray | any[], declinedPermissions: NSArray | any[], appID: string, userID: string, expirationDate: Date, refreshDate: Date): this; - - initWithTokenStringPermissionsDeclinedPermissionsAppIDUserIDExpirationDateRefreshDateDataAccessExpirationDate(tokenString: string, permissions: NSArray | any[], declinedPermissions: NSArray | any[], appID: string, userID: string, expirationDate: Date, refreshDate: Date, dataAccessExpirationDate: Date): this; + initWithTokenStringPermissionsDeclinedPermissionsExpiredPermissionsAppIDUserIDExpirationDateRefreshDateDataAccessExpirationDate(tokenString: string, permissions: NSArray | string[], declinedPermissions: NSArray | string[], expiredPermissions: NSArray | string[], appID: string, userID: string, expirationDate: Date, refreshDate: Date, dataAccessExpirationDate: Date): this; isEqual(object: any): boolean; @@ -98,9 +94,23 @@ declare var FBSDKAccessTokenChangeOldKey: string; declare var FBSDKAccessTokenDidChangeNotification: string; -declare var FBSDKAccessTokenDidChangeUserID: string; +declare var FBSDKAccessTokenDidChangeUserIDKey: string; -declare var FBSDKAccessTokenDidExpire: string; +declare var FBSDKAccessTokenDidExpireKey: string; + +declare var FBSDKAppEventCity: string; + +declare var FBSDKAppEventCountry: string; + +declare var FBSDKAppEventDateOfBirth: string; + +declare var FBSDKAppEventEmail: string; + +declare var FBSDKAppEventFirstName: string; + +declare var FBSDKAppEventGender: string; + +declare var FBSDKAppEventLastName: string; declare var FBSDKAppEventNameAchievedLevel: string; @@ -128,6 +138,8 @@ declare var FBSDKAppEventNameFindLocation: string; declare var FBSDKAppEventNameInitiatedCheckout: string; +declare var FBSDKAppEventNamePurchased: string; + declare var FBSDKAppEventNameRated: string; declare var FBSDKAppEventNameSchedule: string; @@ -142,6 +154,8 @@ declare var FBSDKAppEventNameSubmitApplication: string; declare var FBSDKAppEventNameSubscribe: string; +declare var FBSDKAppEventNameSubscriptionHeartbeat: string; + declare var FBSDKAppEventNameUnlockedAchievement: string; declare var FBSDKAppEventNameViewedContent: string; @@ -174,10 +188,58 @@ declare var FBSDKAppEventParameterNameSearchString: string; declare var FBSDKAppEventParameterNameSuccess: string; +declare var FBSDKAppEventParameterProductAppLinkAndroidAppName: string; + +declare var FBSDKAppEventParameterProductAppLinkAndroidPackage: string; + +declare var FBSDKAppEventParameterProductAppLinkAndroidUrl: string; + +declare var FBSDKAppEventParameterProductAppLinkIOSAppName: string; + +declare var FBSDKAppEventParameterProductAppLinkIOSAppStoreID: string; + +declare var FBSDKAppEventParameterProductAppLinkIOSUrl: string; + +declare var FBSDKAppEventParameterProductAppLinkIPadAppName: string; + +declare var FBSDKAppEventParameterProductAppLinkIPadAppStoreID: string; + +declare var FBSDKAppEventParameterProductAppLinkIPadUrl: string; + +declare var FBSDKAppEventParameterProductAppLinkIPhoneAppName: string; + +declare var FBSDKAppEventParameterProductAppLinkIPhoneAppStoreID: string; + +declare var FBSDKAppEventParameterProductAppLinkIPhoneUrl: string; + +declare var FBSDKAppEventParameterProductAppLinkWindowsPhoneAppID: string; + +declare var FBSDKAppEventParameterProductAppLinkWindowsPhoneAppName: string; + +declare var FBSDKAppEventParameterProductAppLinkWindowsPhoneUrl: string; + +declare var FBSDKAppEventParameterProductCategory: string; + +declare var FBSDKAppEventParameterProductCustomLabel0: string; + +declare var FBSDKAppEventParameterProductCustomLabel1: string; + +declare var FBSDKAppEventParameterProductCustomLabel2: string; + +declare var FBSDKAppEventParameterProductCustomLabel3: string; + +declare var FBSDKAppEventParameterProductCustomLabel4: string; + declare var FBSDKAppEventParameterValueNo: string; declare var FBSDKAppEventParameterValueYes: string; +declare var FBSDKAppEventPhone: string; + +declare var FBSDKAppEventState: string; + +declare var FBSDKAppEventZip: string; + declare class FBSDKAppEvents extends NSObject { static activateApp(): void; @@ -188,61 +250,59 @@ declare class FBSDKAppEvents extends NSObject { static clearUserData(): void; + static clearUserDataForType(type: string): void; + static clearUserID(): void; static flush(): void; - static flushBehavior(): FBSDKAppEventsFlushBehavior; - static getUserData(): string; static logEvent(eventName: string): void; - static logEventParameters(eventName: string, parameters: NSDictionary): void; + static logEventParameters(eventName: string, parameters: NSDictionary): void; static logEventValueToSum(eventName: string, valueToSum: number): void; - static logEventValueToSumParameters(eventName: string, valueToSum: number, parameters: NSDictionary): void; + static logEventValueToSumParameters(eventName: string, valueToSum: number, parameters: NSDictionary): void; - static logEventValueToSumParametersAccessToken(eventName: string, valueToSum: number, parameters: NSDictionary, accessToken: FBSDKAccessToken): void; + static logEventValueToSumParametersAccessToken(eventName: string, valueToSum: number, parameters: NSDictionary, accessToken: FBSDKAccessToken): void; - static logProductItemAvailabilityConditionDescriptionImageLinkLinkTitlePriceAmountCurrencyGtinMpnBrandParameters(itemID: string, availability: FBSDKProductAvailability, condition: FBSDKProductCondition, description: string, imageLink: string, link: string, title: string, priceAmount: number, currency: string, gtin: string, mpn: string, brand: string, parameters: NSDictionary): void; + static logProductItemAvailabilityConditionDescriptionImageLinkLinkTitlePriceAmountCurrencyGtinMpnBrandParameters(itemID: string, availability: FBSDKProductAvailability, condition: FBSDKProductCondition, description: string, imageLink: string, link: string, title: string, priceAmount: number, currency: string, gtin: string, mpn: string, brand: string, parameters: NSDictionary): void; static logPurchaseCurrency(purchaseAmount: number, currency: string): void; - static logPurchaseCurrencyParameters(purchaseAmount: number, currency: string, parameters: NSDictionary): void; + static logPurchaseCurrencyParameters(purchaseAmount: number, currency: string, parameters: NSDictionary): void; - static logPurchaseCurrencyParametersAccessToken(purchaseAmount: number, currency: string, parameters: NSDictionary, accessToken: FBSDKAccessToken): void; + static logPurchaseCurrencyParametersAccessToken(purchaseAmount: number, currency: string, parameters: NSDictionary, accessToken: FBSDKAccessToken): void; static logPushNotificationOpen(payload: NSDictionary): void; static logPushNotificationOpenAction(payload: NSDictionary, action: string): void; - static loggingOverrideAppID(): string; - static new(): FBSDKAppEvents; // inherited from NSObject static requestForCustomAudienceThirdPartyIDWithAccessToken(accessToken: FBSDKAccessToken): FBSDKGraphRequest; static sendEventBindingsToUnity(): void; - static setFlushBehavior(flushBehavior: FBSDKAppEventsFlushBehavior): void; - static setIsUnityInit(isUnityInit: boolean): void; - static setLoggingOverrideAppID(appID: string): void; - static setPushNotificationsDeviceToken(deviceToken: NSData): void; - static setUserData(userData: NSDictionary): void; + static setPushNotificationsDeviceTokenString(deviceTokenString: string): void; + + static setUserDataForType(data: string, type: string): void; static setUserEmailFirstNameLastNamePhoneDateOfBirthGenderCityStateZipCountry(email: string, firstName: string, lastName: string, phone: string, dateOfBirth: string, gender: string, city: string, state: string, zip: string, country: string): void; - static setUserID(userID: string): void; + static updateUserPropertiesHandler(properties: NSDictionary, handler: (p1: FBSDKGraphRequestConnection, p2: any, p3: NSError) => void): void; + + static flushBehavior: FBSDKAppEventsFlushBehavior; - static updateUserPropertiesHandler(properties: NSDictionary, handler: (p1: FBSDKGraphRequestConnection, p2: any, p3: NSError) => void): void; + static loggingOverrideAppID: string; - static userID(): string; + static userID: string; } declare const enum FBSDKAppEventsFlushBehavior { @@ -283,8 +343,6 @@ declare class FBSDKAppLinkNavigation extends NSObject { static callbackAppLinkDataForAppWithNameUrl(appName: string, url: string): NSDictionary>; - static defaultResolver(): FBSDKAppLinkResolving; - static navigateToAppLinkError(link: FBSDKAppLink): FBSDKAppLinkNavigationType; static navigateToURLHandler(destination: NSURL, handler: (p1: FBSDKAppLinkNavigationType, p2: NSError) => void): void; @@ -301,17 +359,17 @@ declare class FBSDKAppLinkNavigation extends NSObject { static resolveAppLinkResolverHandler(destination: NSURL, resolver: FBSDKAppLinkResolving, handler: (p1: FBSDKAppLink, p2: NSError) => void): void; - static setDefaultResolver(resolver: FBSDKAppLinkResolving): void; - readonly appLink: FBSDKAppLink; readonly appLinkData: NSDictionary; readonly extras: NSDictionary; - navigate(): FBSDKAppLinkNavigationType; + readonly navigationType: FBSDKAppLinkNavigationType; + + static defaultResolver: FBSDKAppLinkResolving; - navigationType(): FBSDKAppLinkNavigationType; + navigate(): FBSDKAppLinkNavigationType; } declare const enum FBSDKAppLinkNavigationType { @@ -325,7 +383,7 @@ declare const enum FBSDKAppLinkNavigationType { declare var FBSDKAppLinkParseEventName: string; -declare class FBSDKAppLinkResolver extends NSObject implements BFAppLinkResolving, FBSDKAppLinkResolving { +declare class FBSDKAppLinkResolver extends NSObject implements FBSDKAppLinkResolving { static alloc(): FBSDKAppLinkResolver; // inherited from NSObject @@ -347,12 +405,8 @@ declare class FBSDKAppLinkResolver extends NSObject implements BFAppLinkResolvin appLinkFromURLHandler(url: NSURL, handler: (p1: FBSDKAppLink, p2: NSError) => void): void; - appLinkFromURLInBackground(url: NSURL): BFTask; - appLinksFromURLsHandler(urls: NSArray | NSURL[], handler: (p1: NSDictionary, p2: NSError) => void): void; - appLinksFromURLsInBackground(urls: NSArray | NSURL[]): BFTask; - class(): typeof NSObject; conformsToProtocol(aProtocol: any /* Protocol */): boolean; @@ -518,8 +572,6 @@ declare class FBSDKAppLinkUtility extends NSObject { static appInvitePromotionCodeFromURL(url: NSURL): string; - static fetchDeferredAppInvite(handler: (p1: NSURL) => void): boolean; - static fetchDeferredAppLink(handler: (p1: NSURL, p2: NSError) => void): void; static new(): FBSDKAppLinkUtility; // inherited from NSObject @@ -531,17 +583,26 @@ declare class FBSDKApplicationDelegate extends NSObject { static alloc(): FBSDKApplicationDelegate; // inherited from NSObject + static initializeSDK(launchOptions: NSDictionary): void; + static new(): FBSDKApplicationDelegate; // inherited from NSObject - static sharedInstance(): FBSDKApplicationDelegate; + static readonly sharedInstance: FBSDKApplicationDelegate; - applicationDidFinishLaunchingWithOptions(application: UIApplication, launchOptions: NSDictionary): boolean; + applicationDidFinishLaunchingWithOptions(application: UIApplication, launchOptions: NSDictionary): boolean; applicationOpenURLOptions(application: UIApplication, url: NSURL, options: NSDictionary): boolean; applicationOpenURLSourceApplicationAnnotation(application: UIApplication, url: NSURL, sourceApplication: string, annotation: any): boolean; } +declare class FBSDKBasicUtility extends NSObject { + + static alloc(): FBSDKBasicUtility; // inherited from NSObject + + static new(): FBSDKBasicUtility; // inherited from NSObject +} + declare class FBSDKButton extends UIButton { static alloc(): FBSDKButton; // inherited from NSObject @@ -611,37 +672,6 @@ declare var FBSDKErrorArgumentNameKey: string; declare var FBSDKErrorArgumentValueKey: string; -declare const enum FBSDKErrorCode { - - ReservedErrorCode = 0, - - EncryptionErrorCode = 1, - - InvalidArgumentErrorCode = 2, - - UnknownErrorCode = 3, - - NetworkErrorCode = 4, - - AppEventsFlushErrorCode = 5, - - GraphRequestNonTextMimeTypeReturnedErrorCode = 6, - - GraphRequestProtocolMismatchErrorCode = 7, - - GraphRequestGraphAPIErrorCode = 8, - - DialogUnavailableErrorCode = 9, - - AccessTokenRequiredErrorCode = 10, - - AppVersionUnsupportedErrorCode = 11, - - BrowserUnavailableErrorCode = 12, - - BrowswerUnavailableErrorCode = 12 -} - declare var FBSDKErrorDeveloperMessageKey: string; declare var FBSDKErrorDomain: string; @@ -693,23 +723,31 @@ declare class FBSDKGraphRequest extends NSObject { readonly graphPath: string; - readonly parameters: NSMutableDictionary; + parameters: NSDictionary; readonly tokenString: string; readonly version: string; - constructor(o: { graphPath: string; parameters: NSDictionary; }); + constructor(o: { graphPath: string; }); + + constructor(o: { graphPath: string; HTTPMethod: string; }); + + constructor(o: { graphPath: string; parameters: NSDictionary; }); + + constructor(o: { graphPath: string; parameters: NSDictionary; HTTPMethod: string; }); - constructor(o: { graphPath: string; parameters: NSDictionary; HTTPMethod: string; }); + constructor(o: { graphPath: string; parameters: NSDictionary; tokenString: string; version: string; HTTPMethod: string; }); - constructor(o: { graphPath: string; parameters: NSDictionary; tokenString: string; version: string; HTTPMethod: string; }); + initWithGraphPath(graphPath: string): this; - initWithGraphPathParameters(graphPath: string, parameters: NSDictionary): this; + initWithGraphPathHTTPMethod(graphPath: string, method: string): this; - initWithGraphPathParametersHTTPMethod(graphPath: string, parameters: NSDictionary, HTTPMethod: string): this; + initWithGraphPathParameters(graphPath: string, parameters: NSDictionary): this; - initWithGraphPathParametersTokenStringVersionHTTPMethod(graphPath: string, parameters: NSDictionary, tokenString: string, version: string, HTTPMethod: string): this; + initWithGraphPathParametersHTTPMethod(graphPath: string, parameters: NSDictionary, method: string): this; + + initWithGraphPathParametersTokenStringVersionHTTPMethod(graphPath: string, parameters: NSDictionary, tokenString: string, version: string, method: string): this; setGraphErrorRecoveryDisabled(disable: boolean): void; @@ -722,25 +760,25 @@ declare class FBSDKGraphRequestConnection extends NSObject { static new(): FBSDKGraphRequestConnection; // inherited from NSObject - static setDefaultConnectionTimeout(defaultConnectionTimeout: number): void; - - readonly URLResponse: NSHTTPURLResponse; - delegate: FBSDKGraphRequestConnectionDelegate; + delegateQueue: NSOperationQueue; + timeout: number; - addRequestCompletionHandler(request: FBSDKGraphRequest, handler: (p1: FBSDKGraphRequestConnection, p2: any, p3: NSError) => void): void; + readonly urlResponse: NSHTTPURLResponse; - addRequestCompletionHandlerBatchEntryName(request: FBSDKGraphRequest, handler: (p1: FBSDKGraphRequestConnection, p2: any, p3: NSError) => void, name: string): void; + static defaultConnectionTimeout: number; - addRequestCompletionHandlerBatchParameters(request: FBSDKGraphRequest, handler: (p1: FBSDKGraphRequestConnection, p2: any, p3: NSError) => void, batchParameters: NSDictionary): void; + addRequestBatchEntryNameCompletionHandler(request: FBSDKGraphRequest, name: string, handler: (p1: FBSDKGraphRequestConnection, p2: any, p3: NSError) => void): void; - cancel(): void; + addRequestBatchParametersCompletionHandler(request: FBSDKGraphRequest, batchParameters: NSDictionary, handler: (p1: FBSDKGraphRequestConnection, p2: any, p3: NSError) => void): void; - overrideVersionPartWith(version: string): void; + addRequestCompletionHandler(request: FBSDKGraphRequest, handler: (p1: FBSDKGraphRequestConnection, p2: any, p3: NSError) => void): void; - setDelegateQueue(queue: NSOperationQueue): void; + cancel(): void; + + overrideGraphAPIVersion(version: string): void; start(): void; } @@ -786,23 +824,8 @@ declare const enum FBSDKGraphRequestError { Recoverable = 2 } -declare const enum FBSDKGraphRequestErrorCategory { - - Other = 0, - - Transient = 1, - - Recoverable = 2 -} - -declare var FBSDKGraphRequestErrorCategoryKey: string; - -declare var FBSDKGraphRequestErrorGraphErrorCode: string; - declare var FBSDKGraphRequestErrorGraphErrorCodeKey: string; -declare var FBSDKGraphRequestErrorGraphErrorSubcode: string; - declare var FBSDKGraphRequestErrorGraphErrorSubcodeKey: string; declare var FBSDKGraphRequestErrorHTTPStatusCodeKey: string; @@ -811,13 +834,17 @@ declare var FBSDKGraphRequestErrorKey: string; declare var FBSDKGraphRequestErrorParsedJSONResponseKey: string; +declare var FBSDKHTTPMethodDELETE: string; + +declare var FBSDKHTTPMethodGET: string; + +declare var FBSDKHTTPMethodPOST: string; + declare const enum FBSDKIncludeStatusBarInSize { Never = 0, - IOS7AndLater = 1, - - Always = 2 + Always = 1 } declare var FBSDKLoggingBehaviorAccessTokens: string; @@ -853,8 +880,6 @@ declare var FBSDKMeasurementEventNameKey: string; declare var FBSDKMeasurementEventNotification: string; -declare var FBSDKMeasurementEventNotificationName: string; - interface FBSDKMutableCopying extends FBSDKCopying, NSMutableCopying { mutableCopy(): any; @@ -892,16 +917,12 @@ declare class FBSDKProfile extends NSObject implements NSCopying, NSSecureCoding static alloc(): FBSDKProfile; // inherited from NSObject - static currentProfile(): FBSDKProfile; - static enableUpdatesOnAccessTokenChange(enable: boolean): void; static loadCurrentProfileWithCompletion(completion: (p1: FBSDKProfile, p2: NSError) => void): void; static new(): FBSDKProfile; // inherited from NSObject - static setCurrentProfile(profile: FBSDKProfile): void; - readonly firstName: string; readonly lastName: string; @@ -916,6 +937,8 @@ declare class FBSDKProfile extends NSObject implements NSCopying, NSSecureCoding readonly userID: string; + static currentProfile: FBSDKProfile; + static readonly supportsSecureCoding: boolean; // inherited from NSSecureCoding constructor(o: { coder: NSCoder; }); // inherited from NSCoding @@ -926,8 +949,6 @@ declare class FBSDKProfile extends NSObject implements NSCopying, NSSecureCoding encodeWithCoder(aCoder: NSCoder): void; - imagePathForPictureModeSize(mode: FBSDKProfilePictureMode, size: CGSize): string; - imageURLForPictureModeSize(mode: FBSDKProfilePictureMode, size: CGSize): NSURL; initWithCoder(aDecoder: NSCoder): this; @@ -977,65 +998,45 @@ declare class FBSDKProfilePictureView extends UIView { declare class FBSDKSettings extends NSObject { - static JPEGCompressionQuality(): number; - static alloc(): FBSDKSettings; // inherited from NSObject - static appID(): string; - - static appURLSchemeSuffix(): string; - - static autoLogAppEventsEnabled(): number; - - static clientToken(): string; - - static codelessDebugLogEnabled(): number; - static disableLoggingBehavior(loggingBehavior: string): void; - static displayName(): string; - static enableLoggingBehavior(loggingBehavior: string): void; - static facebookDomainPart(): string; - - static graphAPIVersion(): string; - - static legacyUserDefaultTokenInformationKeyName(): string; - - static limitEventAndDataUsage(): boolean; + static new(): FBSDKSettings; // inherited from NSObject - static loggingBehavior(): NSSet; + static JPEGCompressionQuality: number; - static new(): FBSDKSettings; // inherited from NSObject + static advertiserIDCollectionEnabled: boolean; - static sdkVersion(): string; + static appID: string; - static setAppID(appID: string): void; + static appURLSchemeSuffix: string; - static setAppURLSchemeSuffix(appURLSchemeSuffix: string): void; + static autoInitEnabled: boolean; - static setAutoLogAppEventsEnabled(AutoLogAppEventsEnabled: number): void; + static autoLogAppEventsEnabled: boolean; - static setClientToken(clientToken: string): void; + static clientToken: string; - static setCodelessDebugLogEnabled(CodelessDebugLogEnabled: number): void; + static codelessDebugLogEnabled: boolean; - static setDisplayName(displayName: string): void; + static readonly defaultGraphAPIVersion: string; - static setFacebookDomainPart(facebookDomainPart: string): void; + static displayName: string; - static setGraphAPIVersion(version: string): void; + static facebookDomainPart: string; - static setGraphErrorRecoveryDisabled(disableGraphErrorRecovery: boolean): void; + static graphAPIVersion: string; - static setJPEGCompressionQuality(JPEGCompressionQuality: number): void; + static graphErrorRecoveryEnabled: boolean; - static setLegacyUserDefaultTokenInformationKeyName(tokenInformationKeyName: string): void; + static limitEventAndDataUsage: boolean; - static setLimitEventAndDataUsage(limitEventAndDataUsage: boolean): void; + static loggingBehaviors: NSSet; - static setLoggingBehavior(loggingBehavior: NSSet): void; + static readonly sdkVersion: string; } declare class FBSDKTestUsersManager extends NSObject { @@ -1046,13 +1047,13 @@ declare class FBSDKTestUsersManager extends NSObject { static sharedInstanceForAppIDAppSecret(appID: string, appSecret: string): FBSDKTestUsersManager; - addTestAccountWithPermissionsCompletionHandler(permissions: NSSet, handler: (p1: NSArray, p2: NSError) => void): void; + addTestAccountWithPermissionsCompletionHandler(permissions: NSSet, handler: (p1: NSArray, p2: NSError) => void): void; makeFriendsWithFirstSecondCallback(first: FBSDKAccessToken, second: FBSDKAccessToken, callback: (p1: NSError) => void): void; removeTestAccountCompletionHandler(userId: string, handler: (p1: NSError) => void): void; - requestTestAccountTokensWithArraysOfPermissionsCreateIfNotFoundCompletionHandler(arraysOfPermissions: NSArray | any[], createIfNotFound: boolean, handler: (p1: NSArray, p2: NSError) => void): void; + requestTestAccountTokensWithArraysOfPermissionsCreateIfNotFoundCompletionHandler(arraysOfPermissions: NSArray> | NSSet[], createIfNotFound: boolean, handler: (p1: NSArray, p2: NSError) => void): void; } declare class FBSDKURL extends NSObject { @@ -1090,11 +1091,11 @@ declare class FBSDKUtility extends NSObject { static alloc(): FBSDKUtility; // inherited from NSObject - static dictionaryWithQueryString(queryString: string): NSDictionary; + static dictionaryWithQueryString(queryString: string): NSDictionary; static new(): FBSDKUtility; // inherited from NSObject - static queryStringWithDictionaryError(dictionary: NSDictionary): string; + static queryStringWithDictionaryError(dictionary: NSDictionary): string; static startGCDTimerWithIntervalBlock(interval: number, block: () => void): NSObject; @@ -1107,7 +1108,7 @@ declare class FBSDKWebViewAppLinkResolver extends NSObject implements FBSDKAppLi static new(): FBSDKWebViewAppLinkResolver; // inherited from NSObject - static sharedInstance(): FBSDKWebViewAppLinkResolver; + static readonly sharedInstance: FBSDKWebViewAppLinkResolver; readonly debugDescription: string; // inherited from NSObjectProtocol diff --git a/src/platforms/ios/typings/objc!FBSDKLoginKit.d.ts b/src/platforms/ios/typings/objc!FBSDKLoginKit.d.ts index befd40d..ec792f2 100644 --- a/src/platforms/ios/typings/objc!FBSDKLoginKit.d.ts +++ b/src/platforms/ios/typings/objc!FBSDKLoginKit.d.ts @@ -36,17 +36,6 @@ declare const enum FBSDKDeviceLoginError { CodeExpired = 1349152 } -declare const enum FBSDKDeviceLoginErrorSubcode { - - ExcessivePollingErrorSubcode = 1349172, - - AuthorizationDeclinedErrorSubcode = 1349173, - - AuthorizationPendingErrorSubcode = 1349174, - - CodeExpiredErrorSubcode = 1349152 -} - declare class FBSDKDeviceLoginManager extends NSObject implements NSNetServiceDelegate { static alloc(): FBSDKDeviceLoginManager; // inherited from NSObject @@ -142,15 +131,13 @@ declare class FBSDKDeviceLoginManagerResult extends NSObject { readonly cancelled: boolean; } -declare const enum FBSDKLoginBehavior { - - Native = 0, +declare var FBSDKLoginAuthTypeReauthorize: string; - Browser = 1, +declare var FBSDKLoginAuthTypeRerequest: string; - SystemAccount = 2, +declare const enum FBSDKLoginBehavior { - Web = 3 + Browser = 0 } declare class FBSDKLoginButton extends FBSDKButton { @@ -179,9 +166,11 @@ declare class FBSDKLoginButton extends FBSDKButton { loginBehavior: FBSDKLoginBehavior; - publishPermissions: NSArray; + permissions: NSArray; - readPermissions: NSArray; + publishPermissions: NSArray; + + readPermissions: NSArray; tooltipBehavior: FBSDKLoginButtonTooltipBehavior; @@ -231,27 +220,6 @@ declare const enum FBSDKLoginError { BadChallengeString = 308 } -declare const enum FBSDKLoginErrorCode { - - ReservedErrorCode = 300, - - UnknownErrorCode = 301, - - PasswordChangedErrorCode = 302, - - UserCheckpointedErrorCode = 303, - - UserMismatchErrorCode = 304, - - UnconfirmedUserErrorCode = 305, - - SystemAccountAppDisabledErrorCode = 306, - - SystemAccountUnavailableErrorCode = 307, - - BadChallengeString = 308 -} - declare var FBSDKLoginErrorDomain: string; declare var FBSDKLoginKitVersionNumber: number; @@ -264,21 +232,17 @@ declare class FBSDKLoginManager extends NSObject { static new(): FBSDKLoginManager; // inherited from NSObject - static renewSystemCredentials(handler: (p1: ACAccountCredentialRenewResult, p2: NSError) => void): void; - authType: string; defaultAudience: FBSDKDefaultAudience; loginBehavior: FBSDKLoginBehavior; - logInWithPublishPermissionsFromViewControllerHandler(permissions: NSArray | any[], fromViewController: UIViewController, handler: (p1: FBSDKLoginManagerLoginResult, p2: NSError) => void): void; - - logInWithPublishPermissionsHandler(permissions: NSArray | any[], handler: (p1: FBSDKLoginManagerLoginResult, p2: NSError) => void): void; + logInWithPermissionsFromViewControllerHandler(permissions: NSArray | string[], fromViewController: UIViewController, handler: (p1: FBSDKLoginManagerLoginResult, p2: NSError) => void): void; - logInWithReadPermissionsFromViewControllerHandler(permissions: NSArray | any[], fromViewController: UIViewController, handler: (p1: FBSDKLoginManagerLoginResult, p2: NSError) => void): void; + logInWithPublishPermissionsFromViewControllerHandler(permissions: NSArray | string[], fromViewController: UIViewController, handler: (p1: FBSDKLoginManagerLoginResult, p2: NSError) => void): void; - logInWithReadPermissionsHandler(permissions: NSArray | any[], handler: (p1: FBSDKLoginManagerLoginResult, p2: NSError) => void): void; + logInWithReadPermissionsFromViewControllerHandler(permissions: NSArray | string[], fromViewController: UIViewController, handler: (p1: FBSDKLoginManagerLoginResult, p2: NSError) => void): void; logOut(): void; @@ -291,17 +255,17 @@ declare class FBSDKLoginManagerLoginResult extends NSObject { static new(): FBSDKLoginManagerLoginResult; // inherited from NSObject - declinedPermissions: NSSet; + declinedPermissions: NSSet; - grantedPermissions: NSSet; + grantedPermissions: NSSet; readonly isCancelled: boolean; token: FBSDKAccessToken; - constructor(o: { token: FBSDKAccessToken; isCancelled: boolean; grantedPermissions: NSSet; declinedPermissions: NSSet; }); + constructor(o: { token: FBSDKAccessToken; isCancelled: boolean; grantedPermissions: NSSet; declinedPermissions: NSSet; }); - initWithTokenIsCancelledGrantedPermissionsDeclinedPermissions(token: FBSDKAccessToken, isCancelled: boolean, grantedPermissions: NSSet, declinedPermissions: NSSet): this; + initWithTokenIsCancelledGrantedPermissionsDeclinedPermissions(token: FBSDKAccessToken, isCancelled: boolean, grantedPermissions: NSSet, declinedPermissions: NSSet): this; } declare class FBSDKLoginTooltipView extends FBSDKTooltipView { diff --git a/src/platforms/ios/typings/objc!FBSDKShareKit.d.ts b/src/platforms/ios/typings/objc!FBSDKShareKit.d.ts index 39b3dad..fa68078 100644 --- a/src/platforms/ios/typings/objc!FBSDKShareKit.d.ts +++ b/src/platforms/ios/typings/objc!FBSDKShareKit.d.ts @@ -1,36 +1,4 @@ -declare class FBSDKAppGroupAddDialog extends NSObject { - - static alloc(): FBSDKAppGroupAddDialog; // inherited from NSObject - - static new(): FBSDKAppGroupAddDialog; // inherited from NSObject - - static showWithContentDelegate(content: FBSDKAppGroupContent, delegate: FBSDKAppGroupAddDialogDelegate): FBSDKAppGroupAddDialog; - - content: FBSDKAppGroupContent; - - delegate: FBSDKAppGroupAddDialogDelegate; - - canShow(): boolean; - - show(): boolean; - - validateWithError(): boolean; -} - -interface FBSDKAppGroupAddDialogDelegate extends NSObjectProtocol { - - appGroupAddDialogDidCancel(appGroupAddDialog: FBSDKAppGroupAddDialog): void; - - appGroupAddDialogDidCompleteWithResults(appGroupAddDialog: FBSDKAppGroupAddDialog, results: NSDictionary): void; - - appGroupAddDialogDidFailWithError(appGroupAddDialog: FBSDKAppGroupAddDialog, error: NSError): void; -} -declare var FBSDKAppGroupAddDialogDelegate: { - - prototype: FBSDKAppGroupAddDialogDelegate; -}; - declare class FBSDKAppGroupContent extends NSObject implements FBSDKCopying, NSSecureCoding { static alloc(): FBSDKAppGroupContent; // inherited from NSObject @@ -92,38 +60,6 @@ declare class FBSDKAppGroupContent extends NSObject implements FBSDKCopying, NSS self(): this; } -declare class FBSDKAppGroupJoinDialog extends NSObject { - - static alloc(): FBSDKAppGroupJoinDialog; // inherited from NSObject - - static new(): FBSDKAppGroupJoinDialog; // inherited from NSObject - - static showWithGroupIDDelegate(groupID: string, delegate: FBSDKAppGroupJoinDialogDelegate): FBSDKAppGroupJoinDialog; - - delegate: FBSDKAppGroupJoinDialogDelegate; - - groupID: string; - - canShow(): boolean; - - show(): boolean; - - validateWithError(): boolean; -} - -interface FBSDKAppGroupJoinDialogDelegate extends NSObjectProtocol { - - appGroupJoinDialogDidCancel(appGroupJoinDialog: FBSDKAppGroupJoinDialog): void; - - appGroupJoinDialogDidCompleteWithResults(appGroupJoinDialog: FBSDKAppGroupJoinDialog, results: NSDictionary): void; - - appGroupJoinDialogDidFailWithError(appGroupJoinDialog: FBSDKAppGroupJoinDialog, error: NSError): void; -} -declare var FBSDKAppGroupJoinDialogDelegate: { - - prototype: FBSDKAppGroupJoinDialogDelegate; -}; - declare const enum FBSDKAppGroupPrivacy { Open = 0, @@ -143,8 +79,6 @@ declare class FBSDKAppInviteContent extends NSObject implements FBSDKCopying, FB destination: FBSDKAppInviteDestination; - previewImageURL: NSURL; - promotionCode: string; promotionText: string; @@ -207,40 +141,6 @@ declare const enum FBSDKAppInviteDestination { Messenger = 1 } -declare class FBSDKAppInviteDialog extends NSObject { - - static alloc(): FBSDKAppInviteDialog; // inherited from NSObject - - static new(): FBSDKAppInviteDialog; // inherited from NSObject - - static showFromViewControllerWithContentDelegate(viewController: UIViewController, content: FBSDKAppInviteContent, delegate: FBSDKAppInviteDialogDelegate): FBSDKAppInviteDialog; - - static showWithContentDelegate(content: FBSDKAppInviteContent, delegate: FBSDKAppInviteDialogDelegate): FBSDKAppInviteDialog; - - readonly canShow: boolean; - - content: FBSDKAppInviteContent; - - delegate: FBSDKAppInviteDialogDelegate; - - fromViewController: UIViewController; - - show(): boolean; - - validateWithError(): boolean; -} - -interface FBSDKAppInviteDialogDelegate extends NSObjectProtocol { - - appInviteDialogDidCompleteWithResults(appInviteDialog: FBSDKAppInviteDialog, results: NSDictionary): void; - - appInviteDialogDidFailWithError(appInviteDialog: FBSDKAppInviteDialog, error: NSError): void; -} -declare var FBSDKAppInviteDialogDelegate: { - - prototype: FBSDKAppInviteDialogDelegate; -}; - declare class FBSDKCameraEffectArguments extends NSObject implements FBSDKCopying, NSSecureCoding { static alloc(): FBSDKCameraEffectArguments; // inherited from NSObject @@ -263,7 +163,7 @@ declare class FBSDKCameraEffectArguments extends NSObject implements FBSDKCopyin constructor(o: { coder: NSCoder; }); // inherited from NSCoding - arrayForKey(key: string): NSArray; + arrayForKey(key: string): NSArray; class(): typeof NSObject; @@ -386,16 +286,12 @@ declare class FBSDKGameRequestContent extends NSObject implements FBSDKCopying, objectID: string; - recipientSuggestions: NSArray; - - recipients: NSArray; + recipientSuggestions: NSArray; - suggestions: NSArray; + recipients: NSArray; title: string; - to: NSArray; - readonly debugDescription: string; // inherited from NSObjectProtocol readonly description: string; // inherited from NSObjectProtocol @@ -451,6 +347,8 @@ declare class FBSDKGameRequestDialog extends NSObject { static alloc(): FBSDKGameRequestDialog; // inherited from NSObject + static dialogWithContentDelegate(content: FBSDKGameRequestContent, delegate: FBSDKGameRequestDialogDelegate): FBSDKGameRequestDialog; + static new(): FBSDKGameRequestDialog; // inherited from NSObject static showWithContentDelegate(content: FBSDKGameRequestContent, delegate: FBSDKGameRequestDialogDelegate): FBSDKGameRequestDialog; @@ -472,7 +370,7 @@ interface FBSDKGameRequestDialogDelegate extends NSObjectProtocol { gameRequestDialogDidCancel(gameRequestDialog: FBSDKGameRequestDialog): void; - gameRequestDialogDidCompleteWithResults(gameRequestDialog: FBSDKGameRequestDialog, results: NSDictionary): void; + gameRequestDialogDidCompleteWithResults(gameRequestDialog: FBSDKGameRequestDialog, results: NSDictionary): void; gameRequestDialogDidFailWithError(gameRequestDialog: FBSDKGameRequestDialog, error: NSError): void; } @@ -551,161 +449,6 @@ declare class FBSDKHashtag extends NSObject implements FBSDKCopying, NSSecureCod self(): this; } -declare class FBSDKLikeButton extends FBSDKButton implements FBSDKLiking { - - static alloc(): FBSDKLikeButton; // inherited from NSObject - - static appearance(): FBSDKLikeButton; // inherited from UIAppearance - - static appearanceForTraitCollection(trait: UITraitCollection): FBSDKLikeButton; // inherited from UIAppearance - - static appearanceForTraitCollectionWhenContainedIn(trait: UITraitCollection, ContainerClass: typeof NSObject): FBSDKLikeButton; // inherited from UIAppearance - - static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(trait: UITraitCollection, containerTypes: NSArray | typeof NSObject[]): FBSDKLikeButton; // inherited from UIAppearance - - static appearanceWhenContainedIn(ContainerClass: typeof NSObject): FBSDKLikeButton; // inherited from UIAppearance - - static appearanceWhenContainedInInstancesOfClasses(containerTypes: NSArray | typeof NSObject[]): FBSDKLikeButton; // inherited from UIAppearance - - static buttonWithType(buttonType: UIButtonType): FBSDKLikeButton; // inherited from UIButton - - static new(): FBSDKLikeButton; // inherited from NSObject - - soundEnabled: boolean; - - readonly debugDescription: string; // inherited from NSObjectProtocol - - readonly description: string; // inherited from NSObjectProtocol - - readonly hash: number; // inherited from NSObjectProtocol - - readonly isProxy: boolean; // inherited from NSObjectProtocol - - objectID: string; // inherited from FBSDKLiking - - objectType: FBSDKLikeObjectType; // inherited from FBSDKLiking - - readonly superclass: typeof NSObject; // inherited from NSObjectProtocol - - readonly // inherited from NSObjectProtocol - - class(): typeof NSObject; - - conformsToProtocol(aProtocol: any /* Protocol */): boolean; - - isEqual(object: any): boolean; - - isKindOfClass(aClass: typeof NSObject): boolean; - - isMemberOfClass(aClass: typeof NSObject): boolean; - - performSelector(aSelector: string): any; - - performSelectorWithObject(aSelector: string, object: any): any; - - performSelectorWithObjectWithObject(aSelector: string, object1: any, object2: any): any; - - respondsToSelector(aSelector: string): boolean; - - retainCount(): number; - - self(): this; -} - -declare class FBSDKLikeControl extends UIControl implements FBSDKLiking { - - static alloc(): FBSDKLikeControl; // inherited from NSObject - - static appearance(): FBSDKLikeControl; // inherited from UIAppearance - - static appearanceForTraitCollection(trait: UITraitCollection): FBSDKLikeControl; // inherited from UIAppearance - - static appearanceForTraitCollectionWhenContainedIn(trait: UITraitCollection, ContainerClass: typeof NSObject): FBSDKLikeControl; // inherited from UIAppearance - - static appearanceForTraitCollectionWhenContainedInInstancesOfClasses(trait: UITraitCollection, containerTypes: NSArray | typeof NSObject[]): FBSDKLikeControl; // inherited from UIAppearance - - static appearanceWhenContainedIn(ContainerClass: typeof NSObject): FBSDKLikeControl; // inherited from UIAppearance - - static appearanceWhenContainedInInstancesOfClasses(containerTypes: NSArray | typeof NSObject[]): FBSDKLikeControl; // inherited from UIAppearance - - static new(): FBSDKLikeControl; // inherited from NSObject - - foregroundColor: UIColor; - - likeControlAuxiliaryPosition: FBSDKLikeControlAuxiliaryPosition; - - likeControlHorizontalAlignment: FBSDKLikeControlHorizontalAlignment; - - likeControlStyle: FBSDKLikeControlStyle; - - preferredMaxLayoutWidth: number; - - soundEnabled: boolean; - - readonly debugDescription: string; // inherited from NSObjectProtocol - - readonly description: string; // inherited from NSObjectProtocol - - readonly hash: number; // inherited from NSObjectProtocol - - readonly isProxy: boolean; // inherited from NSObjectProtocol - - objectID: string; // inherited from FBSDKLiking - - objectType: FBSDKLikeObjectType; // inherited from FBSDKLiking - - readonly superclass: typeof NSObject; // inherited from NSObjectProtocol - - readonly // inherited from NSObjectProtocol - - class(): typeof NSObject; - - conformsToProtocol(aProtocol: any /* Protocol */): boolean; - - isEqual(object: any): boolean; - - isKindOfClass(aClass: typeof NSObject): boolean; - - isMemberOfClass(aClass: typeof NSObject): boolean; - - performSelector(aSelector: string): any; - - performSelectorWithObject(aSelector: string, object: any): any; - - performSelectorWithObjectWithObject(aSelector: string, object1: any, object2: any): any; - - respondsToSelector(aSelector: string): boolean; - - retainCount(): number; - - self(): this; -} - -declare const enum FBSDKLikeControlAuxiliaryPosition { - - Inline = 0, - - Top = 1, - - Bottom = 2 -} - -declare const enum FBSDKLikeControlHorizontalAlignment { - - Left = 0, - - Center = 1, - - Right = 2 -} - -declare const enum FBSDKLikeControlStyle { - - Standard = 0, - - BoxCount = 1 -} - declare const enum FBSDKLikeObjectType { Unknown = 0, @@ -730,6 +473,8 @@ declare class FBSDKMessageDialog extends NSObject implements FBSDKSharingDialog static alloc(): FBSDKMessageDialog; // inherited from NSObject + static dialogWithContentDelegate(content: FBSDKSharingContent, delegate: FBSDKSharingDelegate): FBSDKMessageDialog; + static new(): FBSDKMessageDialog; // inherited from NSObject static showWithContentDelegate(content: FBSDKSharingContent, delegate: FBSDKSharingDelegate): FBSDKMessageDialog; @@ -842,6 +587,8 @@ declare class FBSDKShareAPI extends NSObject implements FBSDKSharing { static alloc(): FBSDKShareAPI; // inherited from NSObject + static apiWithContentDelegate(content: FBSDKSharingContent, delegate: FBSDKSharingDelegate): FBSDKShareAPI; + static new(): FBSDKShareAPI; // inherited from NSObject static shareWithContentDelegate(content: FBSDKSharingContent, delegate: FBSDKSharingDelegate): FBSDKShareAPI; @@ -999,7 +746,7 @@ declare class FBSDKShareCameraEffectContent extends NSObject implements FBSDKSha pageID: string; // inherited from FBSDKSharingContent - peopleIDs: NSArray; // inherited from FBSDKSharingContent + peopleIDs: NSArray; // inherited from FBSDKSharingContent placeID: string; // inherited from FBSDKSharingContent @@ -1017,8 +764,6 @@ declare class FBSDKShareCameraEffectContent extends NSObject implements FBSDKSha addParametersBridgeOptions(existingParameters: NSDictionary, bridgeOptions: FBSDKShareBridgeOptions): NSDictionary; - addToParametersBridgeOptions(parameters: NSMutableDictionary, bridgeOptions: FBSDKShareBridgeOptions): void; - class(): typeof NSObject; conformsToProtocol(aProtocol: any /* Protocol */): boolean; @@ -1060,6 +805,8 @@ declare class FBSDKShareDialog extends NSObject implements FBSDKSharingDialog { static alloc(): FBSDKShareDialog; // inherited from NSObject + static dialogWithViewControllerWithContentDelegate(viewController: UIViewController, content: FBSDKSharingContent, delegate: FBSDKSharingDelegate): FBSDKShareDialog; + static new(): FBSDKShareDialog; // inherited from NSObject static showFromViewControllerWithContentDelegate(viewController: UIViewController, content: FBSDKSharingContent, delegate: FBSDKSharingDelegate): FBSDKShareDialog; @@ -1143,17 +890,6 @@ declare const enum FBSDKShareError { Unknown = 203 } -declare const enum FBSDKShareErrorCode { - - ReservedErrorCode = 200, - - OpenGraphErrorCode = 201, - - DialogNotAvailableErrorCode = 202, - - UnknownErrorCode = 203 -} - declare var FBSDKShareErrorDomain: string; declare var FBSDKShareKitVersionNumber: number; @@ -1166,12 +902,6 @@ declare class FBSDKShareLinkContent extends NSObject implements FBSDKSharingCont static new(): FBSDKShareLinkContent; // inherited from NSObject - readonly contentDescription: string; - - readonly contentTitle: string; - - readonly imageURL: NSURL; - quote: string; contentURL: NSURL; // inherited from FBSDKSharingContent @@ -1188,7 +918,7 @@ declare class FBSDKShareLinkContent extends NSObject implements FBSDKSharingCont pageID: string; // inherited from FBSDKSharingContent - peopleIDs: NSArray; // inherited from FBSDKSharingContent + peopleIDs: NSArray; // inherited from FBSDKSharingContent placeID: string; // inherited from FBSDKSharingContent @@ -1206,8 +936,6 @@ declare class FBSDKShareLinkContent extends NSObject implements FBSDKSharingCont addParametersBridgeOptions(existingParameters: NSDictionary, bridgeOptions: FBSDKShareBridgeOptions): NSDictionary; - addToParametersBridgeOptions(parameters: NSMutableDictionary, bridgeOptions: FBSDKShareBridgeOptions): void; - class(): typeof NSObject; conformsToProtocol(aProtocol: any /* Protocol */): boolean; @@ -1243,13 +971,20 @@ declare class FBSDKShareLinkContent extends NSObject implements FBSDKSharingCont validateWithOptionsError(bridgeOptions: FBSDKShareBridgeOptions): boolean; } +interface FBSDKShareMedia extends NSObjectProtocol { +} +declare var FBSDKShareMedia: { + + prototype: FBSDKShareMedia; +}; + declare class FBSDKShareMediaContent extends NSObject implements FBSDKSharingContent { static alloc(): FBSDKShareMediaContent; // inherited from NSObject static new(): FBSDKShareMediaContent; // inherited from NSObject - media: NSArray; + media: NSArray; contentURL: NSURL; // inherited from FBSDKSharingContent @@ -1265,7 +1000,7 @@ declare class FBSDKShareMediaContent extends NSObject implements FBSDKSharingCon pageID: string; // inherited from FBSDKSharingContent - peopleIDs: NSArray; // inherited from FBSDKSharingContent + peopleIDs: NSArray; // inherited from FBSDKSharingContent placeID: string; // inherited from FBSDKSharingContent @@ -1283,8 +1018,6 @@ declare class FBSDKShareMediaContent extends NSObject implements FBSDKSharingCon addParametersBridgeOptions(existingParameters: NSDictionary, bridgeOptions: FBSDKShareBridgeOptions): NSDictionary; - addToParametersBridgeOptions(parameters: NSMutableDictionary, bridgeOptions: FBSDKShareBridgeOptions): void; - class(): typeof NSObject; conformsToProtocol(aProtocol: any /* Protocol */): boolean; @@ -1355,7 +1088,7 @@ declare class FBSDKShareMessengerGenericTemplateContent extends NSObject impleme pageID: string; // inherited from FBSDKSharingContent - peopleIDs: NSArray; // inherited from FBSDKSharingContent + peopleIDs: NSArray; // inherited from FBSDKSharingContent placeID: string; // inherited from FBSDKSharingContent @@ -1373,8 +1106,6 @@ declare class FBSDKShareMessengerGenericTemplateContent extends NSObject impleme addParametersBridgeOptions(existingParameters: NSDictionary, bridgeOptions: FBSDKShareBridgeOptions): NSDictionary; - addToParametersBridgeOptions(parameters: NSMutableDictionary, bridgeOptions: FBSDKShareBridgeOptions): void; - class(): typeof NSObject; conformsToProtocol(aProtocol: any /* Protocol */): boolean; @@ -1506,7 +1237,7 @@ declare class FBSDKShareMessengerMediaTemplateContent extends NSObject implement pageID: string; // inherited from FBSDKSharingContent - peopleIDs: NSArray; // inherited from FBSDKSharingContent + peopleIDs: NSArray; // inherited from FBSDKSharingContent placeID: string; // inherited from FBSDKSharingContent @@ -1528,8 +1259,6 @@ declare class FBSDKShareMessengerMediaTemplateContent extends NSObject implement addParametersBridgeOptions(existingParameters: NSDictionary, bridgeOptions: FBSDKShareBridgeOptions): NSDictionary; - addToParametersBridgeOptions(parameters: NSMutableDictionary, bridgeOptions: FBSDKShareBridgeOptions): void; - class(): typeof NSObject; conformsToProtocol(aProtocol: any /* Protocol */): boolean; @@ -1598,7 +1327,7 @@ declare class FBSDKShareMessengerOpenGraphMusicTemplateContent extends NSObject pageID: string; // inherited from FBSDKSharingContent - peopleIDs: NSArray; // inherited from FBSDKSharingContent + peopleIDs: NSArray; // inherited from FBSDKSharingContent placeID: string; // inherited from FBSDKSharingContent @@ -1616,8 +1345,6 @@ declare class FBSDKShareMessengerOpenGraphMusicTemplateContent extends NSObject addParametersBridgeOptions(existingParameters: NSDictionary, bridgeOptions: FBSDKShareBridgeOptions): NSDictionary; - addToParametersBridgeOptions(parameters: NSMutableDictionary, bridgeOptions: FBSDKShareBridgeOptions): void; - class(): typeof NSObject; conformsToProtocol(aProtocol: any /* Protocol */): boolean; @@ -1753,6 +1480,8 @@ declare class FBSDKShareOpenGraphAction extends FBSDKShareOpenGraphValueContaine static readonly supportsSecureCoding: boolean; // inherited from NSSecureCoding + constructor(o: { actionType: string; }); + constructor(o: { coder: NSCoder; }); // inherited from NSCoding class(): typeof NSObject; @@ -1765,6 +1494,8 @@ declare class FBSDKShareOpenGraphAction extends FBSDKShareOpenGraphValueContaine encodeWithCoder(aCoder: NSCoder): void; + initWithActionType(actionType: string): this; + initWithCoder(aDecoder: NSCoder): this; isEqual(object: any): boolean; @@ -1812,7 +1543,7 @@ declare class FBSDKShareOpenGraphContent extends NSObject implements FBSDKSharin pageID: string; // inherited from FBSDKSharingContent - peopleIDs: NSArray; // inherited from FBSDKSharingContent + peopleIDs: NSArray; // inherited from FBSDKSharingContent placeID: string; // inherited from FBSDKSharingContent @@ -1830,8 +1561,6 @@ declare class FBSDKShareOpenGraphContent extends NSObject implements FBSDKSharin addParametersBridgeOptions(existingParameters: NSDictionary, bridgeOptions: FBSDKShareBridgeOptions): NSDictionary; - addToParametersBridgeOptions(parameters: NSMutableDictionary, bridgeOptions: FBSDKShareBridgeOptions): void; - class(): typeof NSObject; conformsToProtocol(aProtocol: any /* Protocol */): boolean; @@ -1873,7 +1602,7 @@ declare class FBSDKShareOpenGraphObject extends FBSDKShareOpenGraphValueContaine static new(): FBSDKShareOpenGraphObject; // inherited from NSObject - static objectWithProperties(properties: NSDictionary): FBSDKShareOpenGraphObject; + static objectWithProperties(properties: NSDictionary): FBSDKShareOpenGraphObject; readonly debugDescription: string; // inherited from NSObjectProtocol @@ -1930,6 +1659,8 @@ declare class FBSDKShareOpenGraphValueContainer extends NSObject implements FBSD static new(): FBSDKShareOpenGraphValueContainer; // inherited from NSObject + readonly allProperties: NSDictionary; // inherited from FBSDKShareOpenGraphValueContaining + readonly debugDescription: string; // inherited from NSObjectProtocol readonly description: string; // inherited from NSObjectProtocol @@ -1938,6 +1669,10 @@ declare class FBSDKShareOpenGraphValueContainer extends NSObject implements FBSD readonly isProxy: boolean; // inherited from NSObjectProtocol + readonly keyEnumerator: NSEnumerator; // inherited from FBSDKShareOpenGraphValueContaining + + readonly objectEnumerator: NSEnumerator; // inherited from FBSDKShareOpenGraphValueContaining + readonly superclass: typeof NSObject; // inherited from NSObjectProtocol readonly // inherited from NSObjectProtocol @@ -1966,17 +1701,13 @@ declare class FBSDKShareOpenGraphValueContainer extends NSObject implements FBSD isMemberOfClass(aClass: typeof NSObject): boolean; - keyEnumerator(): NSEnumerator; - numberForKey(key: string): number; - objectEnumerator(): NSEnumerator; - objectForKey(key: string): FBSDKShareOpenGraphObject; objectForKeyedSubscript(key: string): any; - parseProperties(properties: NSDictionary): void; + parseProperties(properties: NSDictionary): void; performSelector(aSelector: string): any; @@ -2011,23 +1742,25 @@ declare class FBSDKShareOpenGraphValueContainer extends NSObject implements FBSD interface FBSDKShareOpenGraphValueContaining extends NSObjectProtocol, NSSecureCoding { + allProperties: NSDictionary; + + keyEnumerator: NSEnumerator; + + objectEnumerator: NSEnumerator; + URLForKey(key: string): NSURL; arrayForKey(key: string): NSArray; enumerateKeysAndObjectsUsingBlock(block: (p1: string, p2: any, p3: interop.Pointer | interop.Reference) => void): void; - keyEnumerator(): NSEnumerator; - numberForKey(key: string): number; - objectEnumerator(): NSEnumerator; - objectForKey(key: string): FBSDKShareOpenGraphObject; objectForKeyedSubscript(key: string): any; - parseProperties(properties: NSDictionary): void; + parseProperties(properties: NSDictionary): void; photoForKey(key: string): FBSDKSharePhoto; @@ -2052,7 +1785,7 @@ declare var FBSDKShareOpenGraphValueContaining: { prototype: FBSDKShareOpenGraphValueContaining; }; -declare class FBSDKSharePhoto extends NSObject implements FBSDKCopying, FBSDKSharingValidation, NSSecureCoding { +declare class FBSDKSharePhoto extends NSObject implements FBSDKCopying, FBSDKShareMedia, FBSDKSharingValidation, NSSecureCoding { static alloc(): FBSDKSharePhoto; // inherited from NSObject @@ -2131,7 +1864,7 @@ declare class FBSDKSharePhotoContent extends NSObject implements FBSDKSharingCon static new(): FBSDKSharePhotoContent; // inherited from NSObject - photos: NSArray; + photos: NSArray; contentURL: NSURL; // inherited from FBSDKSharingContent @@ -2147,7 +1880,7 @@ declare class FBSDKSharePhotoContent extends NSObject implements FBSDKSharingCon pageID: string; // inherited from FBSDKSharingContent - peopleIDs: NSArray; // inherited from FBSDKSharingContent + peopleIDs: NSArray; // inherited from FBSDKSharingContent placeID: string; // inherited from FBSDKSharingContent @@ -2165,8 +1898,6 @@ declare class FBSDKSharePhotoContent extends NSObject implements FBSDKSharingCon addParametersBridgeOptions(existingParameters: NSDictionary, bridgeOptions: FBSDKShareBridgeOptions): NSDictionary; - addToParametersBridgeOptions(parameters: NSMutableDictionary, bridgeOptions: FBSDKShareBridgeOptions): void; - class(): typeof NSObject; conformsToProtocol(aProtocol: any /* Protocol */): boolean; @@ -2202,7 +1933,7 @@ declare class FBSDKSharePhotoContent extends NSObject implements FBSDKSharingCon validateWithOptionsError(bridgeOptions: FBSDKShareBridgeOptions): boolean; } -declare class FBSDKShareVideo extends NSObject implements FBSDKCopying, FBSDKSharingValidation, NSSecureCoding { +declare class FBSDKShareVideo extends NSObject implements FBSDKCopying, FBSDKShareMedia, FBSDKSharingValidation, NSSecureCoding { static alloc(): FBSDKShareVideo; // inherited from NSObject @@ -2285,8 +2016,6 @@ declare class FBSDKShareVideoContent extends NSObject implements FBSDKSharingCon static new(): FBSDKShareVideoContent; // inherited from NSObject - previewPhoto: FBSDKSharePhoto; - video: FBSDKShareVideo; contentURL: NSURL; // inherited from FBSDKSharingContent @@ -2303,7 +2032,7 @@ declare class FBSDKShareVideoContent extends NSObject implements FBSDKSharingCon pageID: string; // inherited from FBSDKSharingContent - peopleIDs: NSArray; // inherited from FBSDKSharingContent + peopleIDs: NSArray; // inherited from FBSDKSharingContent placeID: string; // inherited from FBSDKSharingContent @@ -2321,8 +2050,6 @@ declare class FBSDKShareVideoContent extends NSObject implements FBSDKSharingCon addParametersBridgeOptions(existingParameters: NSDictionary, bridgeOptions: FBSDKShareBridgeOptions): NSDictionary; - addToParametersBridgeOptions(parameters: NSMutableDictionary, bridgeOptions: FBSDKShareBridgeOptions): void; - class(): typeof NSObject; conformsToProtocol(aProtocol: any /* Protocol */): boolean; @@ -2390,7 +2117,7 @@ interface FBSDKSharingContent extends FBSDKCopying, FBSDKSharingValidation, NSSe pageID: string; - peopleIDs: NSArray; + peopleIDs: NSArray; placeID: string; @@ -2399,8 +2126,6 @@ interface FBSDKSharingContent extends FBSDKCopying, FBSDKSharingValidation, NSSe shareUUID: string; addParametersBridgeOptions(existingParameters: NSDictionary, bridgeOptions: FBSDKShareBridgeOptions): NSDictionary; - - addToParametersBridgeOptions(parameters: NSMutableDictionary, bridgeOptions: FBSDKShareBridgeOptions): void; } declare var FBSDKSharingContent: { @@ -2411,7 +2136,7 @@ interface FBSDKSharingDelegate extends NSObjectProtocol { sharerDidCancel(sharer: FBSDKSharing): void; - sharerDidCompleteWithResults(sharer: FBSDKSharing, results: NSDictionary): void; + sharerDidCompleteWithResults(sharer: FBSDKSharing, results: NSDictionary): void; sharerDidFailWithError(sharer: FBSDKSharing, error: NSError): void; } @@ -2451,12 +2176,6 @@ declare var FBSDKSharingValidation: { declare function NSStringFromFBSDKAppGroupPrivacy(privacy: FBSDKAppGroupPrivacy): string; -declare function NSStringFromFBSDKLikeControlAuxiliaryPosition(auxiliaryPosition: FBSDKLikeControlAuxiliaryPosition): string; - -declare function NSStringFromFBSDKLikeControlHorizontalAlignment(horizontalAlignment: FBSDKLikeControlHorizontalAlignment): string; - -declare function NSStringFromFBSDKLikeControlStyle(style: FBSDKLikeControlStyle): string; - declare function NSStringFromFBSDKLikeObjectType(objectType: FBSDKLikeObjectType): string; declare function NSStringFromFBSDKShareDialogMode(dialogMode: FBSDKShareDialogMode): string; From 182f348a1dd37de8cab4e13b722d85542f39387b Mon Sep 17 00:00:00 2001 From: VladimirAmiorkov Date: Thu, 16 May 2019 15:18:02 +0300 Subject: [PATCH 2/3] chore: update "custom login" test to latest native framework changes --- demo/e2e/test.e2e.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/demo/e2e/test.e2e.ts b/demo/e2e/test.e2e.ts index fc04eda..726d008 100644 --- a/demo/e2e/test.e2e.ts +++ b/demo/e2e/test.e2e.ts @@ -41,7 +41,7 @@ describe("Facebook tests", async function () { console.log("Driver successfully quit"); }); - afterEach(async function (){ + afterEach(async function () { if (this.currentTest.state && this.currentTest.state === "failed") { let png = await driver.logScreenshot(this.currentTest.title); fs.copyFile(png, './mochawesome-report/' + this.currentTest.title + '.png', function (err) { @@ -52,13 +52,14 @@ describe("Facebook tests", async function () { }); addContext(this, './' + this.currentTest.title + '.png'); } - }) + }); it("should log in via custom button", async function () { + let userNameLabelElement; if (isAndroid) { - var userNameLabelElement = "[@text='Nativescript User']"; + userNameLabelElement = "[@text='Nativescript User']"; } else { - var userNameLabelElement = "[@name='Nativescript User']"; + userNameLabelElement = "[@name='Nativescript User']"; } const facebookButton = await driver.findElementByText("Custom", SearchOptions.contains); @@ -81,6 +82,9 @@ describe("Facebook tests", async function () { await driver.wait(1000); await allFields[0].sendKeys(USERNAME); } else { + const continueBtn = await driver.findElementByText("Continue"); + await continueBtn.click(); + const passField = await driver.findElementByClassName(driver.locators.getElementByName("securetextfield")); await passField.click(); await passField.sendKeys(PASSWORD); From 8a818b67971624f21ff58d0470ce7f532e16514f Mon Sep 17 00:00:00 2001 From: VladimirAmiorkov Date: Mon, 10 Jun 2019 10:27:31 +0300 Subject: [PATCH 3/3] chore: update e2e test in Vue demo --- demo-vue/e2e/test.e2e.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/demo-vue/e2e/test.e2e.ts b/demo-vue/e2e/test.e2e.ts index d959a97..ccafc0b 100644 --- a/demo-vue/e2e/test.e2e.ts +++ b/demo-vue/e2e/test.e2e.ts @@ -77,6 +77,9 @@ describe("Facebook tests", async function () { await driver.wait(1000); await allFields[0].sendKeys(USERNAME); } else { + const continueBtn = await driver.findElementByText("Continue"); + await continueBtn.click(); + const passField = await driver.findElementByClassName(driver.locators.getElementByName("securetextfield")); await passField.click(); await passField.sendKeys(PASSWORD);