From 7a966ac77eb81be11380d7de7683b14c836ca861 Mon Sep 17 00:00:00 2001 From: Alex Soto Date: Sat, 27 Feb 2021 19:42:38 -0500 Subject: [PATCH 1/4] Facebook 9.0.1 Baseline Co-authored-by: thisisthekap --- Facebook.iOS/build.cake | 2 - Facebook.iOS/components.cake | 81 +- Facebook.iOS/docs/AccountKit/Details.md | 51 - .../docs/AccountKit/GettingStarted.md | 585 ----- Facebook.iOS/docs/AudienceNetwork/Details.md | 16 - .../docs/AudienceNetwork/GettingStarted.md | 881 -------- Facebook.iOS/docs/MarketingKit/Details.md | 111 - .../docs/MarketingKit/GettingStarted.md | 217 -- .../docs/MessengerShareKit/Details.md | 111 - .../docs/MessengerShareKit/GettingStarted.md | 217 -- Facebook.iOS/docs/Notifications/Details.md | 111 - .../docs/Notifications/GettingStarted.md | 217 -- Facebook.iOS/docs/PlacesKit/Details.md | 111 - Facebook.iOS/docs/PlacesKit/GettingStarted.md | 217 -- .../samples/FBAccountKitSample/AppDelegate.cs | 59 - .../AppIcon.appiconset/Contents.json | 202 -- .../Assets.xcassets/Contents.json | 6 - .../AuthenticatedController.cs | 67 - .../AuthenticatedController.designer.cs | 51 - .../AuthenticatedController.xib | 18 - .../FBAccountKitSample/Entitlements.plist | 6 - .../FBAccountKitSample.csproj | 139 -- .../samples/FBAccountKitSample/Info.plist | 50 - .../LaunchScreen.storyboard | 27 - .../samples/FBAccountKitSample/Main.cs | 15 - .../FBAccountKitSample/Main.storyboard | 137 -- .../FBAccountKitSample/ViewController.cs | 120 -- .../ViewController.designer.cs | 45 - .../FBAudienceNetworkSample/AdPlacementIds.cs | 19 - .../AdsViewController.cs | 334 --- .../AdsViewController.designer.cs | 40 - .../FBAudienceNetworkSample/AppDelegate.cs | 42 - .../LaunchImage.launchimage/Contents.json | 17 - .../FBAudienceNetworkSample/CustomNativeAd.cs | 19 - .../Entitlements.plist | 6 - .../FBAudienceNetworkSample.csproj | 144 -- .../FBAudienceNetworkSample/Info.plist | 67 - .../LaunchScreen.storyboard | 27 - .../samples/FBAudienceNetworkSample/Main.cs | 26 - .../MainStoryboard.storyboard | 225 -- .../NativeAdTableViewCell.cs | 41 - .../NativeAdTableViewCell.designer.cs | 100 - .../NativeAdTemplateTableViewCell.cs | 19 - .../NativeAdTemplateTableViewCell.designer.cs | 27 - .../FacebookiOSSample.csproj | 4 - Facebook.iOS/samples/Samples.sln | 133 +- .../source/AccountKit/AccountKit.csproj | 76 - .../source/AccountKit/ApiDefinition.cs | 582 ----- Facebook.iOS/source/AccountKit/Enums.cs | 124 -- Facebook.iOS/source/AccountKit/License.md | 13 - Facebook.iOS/source/AccountKit/extensions.cs | 17 - .../source/AudienceNetwork/ApiDefinition.cs | 1875 ----------------- .../AudienceNetwork/AudienceNetwork.csproj | 73 - Facebook.iOS/source/AudienceNetwork/Enums.cs | 303 --- .../source/AudienceNetwork/License.md | 15 - .../source/AudienceNetwork/Structs.cs | 28 - .../source/AudienceNetwork/extensions.cs | 120 -- Facebook.iOS/source/CoreKit/CoreKit.csproj | 4 +- .../source/FacebookSdks/FacebookSdks.csproj | 7 +- Facebook.iOS/source/LoginKit/LoginKit.csproj | 4 +- .../source/MarketingKit/ApiDefinition.cs | 13 - Facebook.iOS/source/MarketingKit/Enums.cs | 12 - .../source/MarketingKit/Extensions.cs | 8 - Facebook.iOS/source/MarketingKit/License.md | 13 - Facebook.iOS/source/MarketingKit/Loader.cs | 25 - .../source/MarketingKit/MarketingKit.csproj | 72 - .../source/MessengerShareKit/ApiDefinition.cs | 233 -- .../source/MessengerShareKit/Enums.cs | 28 - .../source/MessengerShareKit/License.md | 15 - .../source/MessengerShareKit/Loader.cs | 24 - .../MessengerShareKit.csproj | 69 - .../source/Notifications/ApiDefinition.cs | 88 - Facebook.iOS/source/Notifications/License.md | 15 - Facebook.iOS/source/Notifications/Loader.cs | 24 - .../source/Notifications/Notifications.csproj | 69 - Facebook.iOS/source/Notifications/Structs.cs | 11 - .../source/PlacesKit/ApiDefinition.cs | 401 ---- Facebook.iOS/source/PlacesKit/Enums.cs | 212 -- Facebook.iOS/source/PlacesKit/License.md | 15 - Facebook.iOS/source/PlacesKit/Loader.cs | 25 - .../source/PlacesKit/PlacesKit.csproj | 71 - Facebook.iOS/source/ShareKit/ShareKit.csproj | 4 +- Facebook.iOS/source/Sources.sln | 30 +- 83 files changed, 66 insertions(+), 9812 deletions(-) delete mode 100644 Facebook.iOS/docs/AccountKit/Details.md delete mode 100644 Facebook.iOS/docs/AccountKit/GettingStarted.md delete mode 100644 Facebook.iOS/docs/AudienceNetwork/Details.md delete mode 100644 Facebook.iOS/docs/AudienceNetwork/GettingStarted.md delete mode 100644 Facebook.iOS/docs/MarketingKit/Details.md delete mode 100644 Facebook.iOS/docs/MarketingKit/GettingStarted.md delete mode 100644 Facebook.iOS/docs/MessengerShareKit/Details.md delete mode 100644 Facebook.iOS/docs/MessengerShareKit/GettingStarted.md delete mode 100644 Facebook.iOS/docs/Notifications/Details.md delete mode 100644 Facebook.iOS/docs/Notifications/GettingStarted.md delete mode 100644 Facebook.iOS/docs/PlacesKit/Details.md delete mode 100644 Facebook.iOS/docs/PlacesKit/GettingStarted.md delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/AppDelegate.cs delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/Assets.xcassets/Contents.json delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/AuthenticatedController.cs delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/AuthenticatedController.designer.cs delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/AuthenticatedController.xib delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/Entitlements.plist delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/FBAccountKitSample.csproj delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/Info.plist delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/LaunchScreen.storyboard delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/Main.cs delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/Main.storyboard delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/ViewController.cs delete mode 100644 Facebook.iOS/samples/FBAccountKitSample/ViewController.designer.cs delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/AdPlacementIds.cs delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.cs delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.designer.cs delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/AppDelegate.cs delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/Assets.xcassets/LaunchImage.launchimage/Contents.json delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/CustomNativeAd.cs delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/Entitlements.plist delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/FBAudienceNetworkSample.csproj delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/Info.plist delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/LaunchScreen.storyboard delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/Main.cs delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/MainStoryboard.storyboard delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.cs delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.designer.cs delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.cs delete mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.designer.cs delete mode 100644 Facebook.iOS/source/AccountKit/AccountKit.csproj delete mode 100644 Facebook.iOS/source/AccountKit/ApiDefinition.cs delete mode 100644 Facebook.iOS/source/AccountKit/Enums.cs delete mode 100644 Facebook.iOS/source/AccountKit/License.md delete mode 100644 Facebook.iOS/source/AccountKit/extensions.cs delete mode 100644 Facebook.iOS/source/AudienceNetwork/ApiDefinition.cs delete mode 100644 Facebook.iOS/source/AudienceNetwork/AudienceNetwork.csproj delete mode 100644 Facebook.iOS/source/AudienceNetwork/Enums.cs delete mode 100644 Facebook.iOS/source/AudienceNetwork/License.md delete mode 100644 Facebook.iOS/source/AudienceNetwork/Structs.cs delete mode 100644 Facebook.iOS/source/AudienceNetwork/extensions.cs delete mode 100644 Facebook.iOS/source/MarketingKit/ApiDefinition.cs delete mode 100644 Facebook.iOS/source/MarketingKit/Enums.cs delete mode 100644 Facebook.iOS/source/MarketingKit/Extensions.cs delete mode 100644 Facebook.iOS/source/MarketingKit/License.md delete mode 100644 Facebook.iOS/source/MarketingKit/Loader.cs delete mode 100644 Facebook.iOS/source/MarketingKit/MarketingKit.csproj delete mode 100644 Facebook.iOS/source/MessengerShareKit/ApiDefinition.cs delete mode 100644 Facebook.iOS/source/MessengerShareKit/Enums.cs delete mode 100644 Facebook.iOS/source/MessengerShareKit/License.md delete mode 100644 Facebook.iOS/source/MessengerShareKit/Loader.cs delete mode 100644 Facebook.iOS/source/MessengerShareKit/MessengerShareKit.csproj delete mode 100644 Facebook.iOS/source/Notifications/ApiDefinition.cs delete mode 100644 Facebook.iOS/source/Notifications/License.md delete mode 100644 Facebook.iOS/source/Notifications/Loader.cs delete mode 100644 Facebook.iOS/source/Notifications/Notifications.csproj delete mode 100644 Facebook.iOS/source/Notifications/Structs.cs delete mode 100644 Facebook.iOS/source/PlacesKit/ApiDefinition.cs delete mode 100644 Facebook.iOS/source/PlacesKit/Enums.cs delete mode 100644 Facebook.iOS/source/PlacesKit/License.md delete mode 100644 Facebook.iOS/source/PlacesKit/Loader.cs delete mode 100644 Facebook.iOS/source/PlacesKit/PlacesKit.csproj diff --git a/Facebook.iOS/build.cake b/Facebook.iOS/build.cake index 1b33f765..a775747f 100644 --- a/Facebook.iOS/build.cake +++ b/Facebook.iOS/build.cake @@ -123,8 +123,6 @@ Task ("externals") // Call here custom methods created at custom_externals_download.cake file // to download frameworks and/or bundles for the artifact - if (ARTIFACTS_TO_BUILD.Contains (AUDIENCE_NETWORK_ARTIFACT)) - DownloadAudienceNetwork (AUDIENCE_NETWORK_ARTIFACT); }); Task ("ci-setup") diff --git a/Facebook.iOS/components.cake b/Facebook.iOS/components.cake index c9e1b244..3864207e 100644 --- a/Facebook.iOS/components.cake +++ b/Facebook.iOS/components.cake @@ -1,55 +1,44 @@ -var FACEBOOK_SDK_VERSION = "7.1.1"; +var FACEBOOK_SDK_VERSION = "9.0.1"; +var NUGET_VERSION = "9.0.1.5"; -var ACCOUNT_KIT_VERSION = "5.4.0"; -var AUDIENCE_NETWORK_VERSION = "5.10.1"; -var CORE_KIT_VERSION = FACEBOOK_SDK_VERSION; -var FACEBOOK_SDKS_VERSION = FACEBOOK_SDK_VERSION; -var LOGIN_KIT_VERSION = FACEBOOK_SDK_VERSION; -var MARKETING_KIT_VERSION = "5.11.1"; -var PLACES_KIT_VERSION = "5.12.0"; -var SHARE_KIT_VERSION = FACEBOOK_SDK_VERSION; +var CORE_KIT_VERSION = FACEBOOK_SDK_VERSION; +var FACEBOOK_SDKS_VERSION = FACEBOOK_SDK_VERSION; +var LOGIN_KIT_VERSION = FACEBOOK_SDK_VERSION; +var SHARE_KIT_VERSION = FACEBOOK_SDK_VERSION; +var GAMINGSERVICES_KIT_VERSION = FACEBOOK_SDK_VERSION; + +var CORE_KIT_NUGET_VERSION = NUGET_VERSION; +var FACEBOOK_SDKS_NUGET_VERSION = NUGET_VERSION; +var LOGIN_KIT_NUGET_VERSION = NUGET_VERSION; +var SHARE_KIT_NUGET_VERSION = NUGET_VERSION; +var GAMINGSERVICES_KIT_NUGET_VERSION = NUGET_VERSION; // Artifacts available to be built. -Artifact ACCOUNT_KIT_ARTIFACT = new Artifact ("AccountKit", ACCOUNT_KIT_VERSION, "8.0"); -Artifact AUDIENCE_NETWORK_ARTIFACT = new Artifact ("AudienceNetwork", AUDIENCE_NETWORK_VERSION, "9.0"); -Artifact CORE_KIT_ARTIFACT = new Artifact ("CoreKit", CORE_KIT_VERSION, "8.0"); -Artifact FACEBOOK_SDKS_ARTIFACT = new Artifact ("FacebookSdks", FACEBOOK_SDKS_VERSION, "8.0"); -Artifact LOGIN_KIT_ARTIFACT = new Artifact ("LoginKit", LOGIN_KIT_VERSION, "8.0"); -Artifact MARKETING_KIT_ARTIFACT = new Artifact ("MarketingKit", MARKETING_KIT_VERSION, "8.0"); -Artifact PLACES_KIT_ARTIFACT = new Artifact ("PlacesKit", PLACES_KIT_VERSION, "8.0"); -Artifact SHARE_KIT_ARTIFACT = new Artifact ("ShareKit", SHARE_KIT_VERSION, "8.0"); +Artifact CORE_KIT_ARTIFACT = new Artifact ("CoreKit", CORE_KIT_NUGET_VERSION, "9.0"); +Artifact FACEBOOK_SDKS_ARTIFACT = new Artifact ("FacebookSdks", FACEBOOK_SDKS_NUGET_VERSION, "9.0"); +Artifact LOGIN_KIT_ARTIFACT = new Artifact ("LoginKit", LOGIN_KIT_NUGET_VERSION, "9.0"); +Artifact SHARE_KIT_ARTIFACT = new Artifact ("ShareKit", SHARE_KIT_NUGET_VERSION, "9.0"); +Artifact GAMINGSERVICES_KIT_ARTIFACT = new Artifact ("GamingServicesKit", GAMINGSERVICES_KIT_NUGET_VERSION, "9.0"); var ARTIFACTS = new Dictionary { - { "AccountKit", ACCOUNT_KIT_ARTIFACT }, - { "AudienceNetwork", AUDIENCE_NETWORK_ARTIFACT }, { "CoreKit", CORE_KIT_ARTIFACT }, { "FacebookSdks", FACEBOOK_SDKS_ARTIFACT }, { "LoginKit", LOGIN_KIT_ARTIFACT }, - { "MarketingKit", MARKETING_KIT_ARTIFACT }, - { "PlacesKit", PLACES_KIT_ARTIFACT }, { "ShareKit", SHARE_KIT_ARTIFACT }, + { "GamingServicesKit", GAMINGSERVICES_KIT_ARTIFACT }, }; void SetArtifactsDependencies () { - ACCOUNT_KIT_ARTIFACT.Dependencies = null; - AUDIENCE_NETWORK_ARTIFACT.Dependencies = null; - CORE_KIT_ARTIFACT.Dependencies = null; - FACEBOOK_SDKS_ARTIFACT.Dependencies = new [] { CORE_KIT_ARTIFACT, LOGIN_KIT_ARTIFACT, SHARE_KIT_ARTIFACT }; - LOGIN_KIT_ARTIFACT.Dependencies = new [] { CORE_KIT_ARTIFACT }; - MARKETING_KIT_ARTIFACT.Dependencies = new [] { CORE_KIT_ARTIFACT }; - PLACES_KIT_ARTIFACT.Dependencies = new [] { CORE_KIT_ARTIFACT }; - SHARE_KIT_ARTIFACT.Dependencies = new [] { CORE_KIT_ARTIFACT }; + CORE_KIT_ARTIFACT.Dependencies = null; + FACEBOOK_SDKS_ARTIFACT.Dependencies = new [] { CORE_KIT_ARTIFACT, LOGIN_KIT_ARTIFACT, SHARE_KIT_ARTIFACT, GAMINGSERVICES_KIT_ARTIFACT }; + LOGIN_KIT_ARTIFACT.Dependencies = new [] { CORE_KIT_ARTIFACT }; + SHARE_KIT_ARTIFACT.Dependencies = new [] { CORE_KIT_ARTIFACT }; + GAMINGSERVICES_KIT_ARTIFACT.Dependencies = new [] { CORE_KIT_ARTIFACT, SHARE_KIT_ARTIFACT }; } void SetArtifactsPodSpecs () { - ACCOUNT_KIT_ARTIFACT.PodSpecs = new [] { - PodSpec.Create ("AccountKit", ACCOUNT_KIT_VERSION) - }; - AUDIENCE_NETWORK_ARTIFACT.PodSpecs = new [] { - PodSpec.Create ("FBAudienceNetwork", AUDIENCE_NETWORK_VERSION, frameworkSource: FrameworkSource.Custom) - }; CORE_KIT_ARTIFACT.PodSpecs = new [] { PodSpec.Create ("FBSDKCoreKit", CORE_KIT_VERSION) }; @@ -59,15 +48,12 @@ void SetArtifactsPodSpecs () LOGIN_KIT_ARTIFACT.PodSpecs = new [] { PodSpec.Create ("FBSDKLoginKit", new Repository ("https://github.com/facebook/facebook-objc-sdk.git", tag: $"v{LOGIN_KIT_VERSION}")) }; - MARKETING_KIT_ARTIFACT.PodSpecs = new [] { - PodSpec.Create ("FBSDKMarketingKit", MARKETING_KIT_VERSION, canBeBuild: false) - }; - PLACES_KIT_ARTIFACT.PodSpecs = new [] { - PodSpec.Create ("FBSDKPlacesKit", new Repository ("https://github.com/facebook/facebook-objc-sdk.git", tag: $"v{PLACES_KIT_VERSION}")) - }; SHARE_KIT_ARTIFACT.PodSpecs = new [] { PodSpec.Create ("FBSDKShareKit", new Repository ("https://github.com/facebook/facebook-objc-sdk.git", tag: $"v{SHARE_KIT_VERSION}")) }; + GAMINGSERVICES_KIT_ARTIFACT.PodSpecs = new [] { + PodSpec.Create ("FBSDKGamingServicesKit", new Repository ("https://github.com/facebook/facebook-objc-sdk.git", tag: $"v{SHARE_KIT_VERSION}")) + }; } void SetArtifactsExtraPodfileLines () @@ -76,12 +62,9 @@ void SetArtifactsExtraPodfileLines () void SetArtifactsSamples () { - ACCOUNT_KIT_ARTIFACT.Samples = new [] { "FBAccountKitSample" }; - AUDIENCE_NETWORK_ARTIFACT.Samples = new [] { "FBAudienceNetworkSample" }; - CORE_KIT_ARTIFACT.Samples = null; - FACEBOOK_SDKS_ARTIFACT.Samples = new [] { "HelloFacebook", "FacebookiOSSample" }; - LOGIN_KIT_ARTIFACT.Samples = null; - MARKETING_KIT_ARTIFACT.Samples = null; - PLACES_KIT_ARTIFACT.Samples = null; - SHARE_KIT_ARTIFACT.Samples = null; + CORE_KIT_ARTIFACT.Samples = null; + FACEBOOK_SDKS_ARTIFACT.Samples = new [] { "HelloFacebook", "FacebookiOSSample" }; + LOGIN_KIT_ARTIFACT.Samples = null; + SHARE_KIT_ARTIFACT.Samples = null; + GAMINGSERVICES_KIT_ARTIFACT.Samples = null; } diff --git a/Facebook.iOS/docs/AccountKit/Details.md b/Facebook.iOS/docs/AccountKit/Details.md deleted file mode 100644 index dd5e4b65..00000000 --- a/Facebook.iOS/docs/AccountKit/Details.md +++ /dev/null @@ -1,51 +0,0 @@ -# Facebook Account Kit for iOS - -Account Kit helps people quickly and easily register and log into your app using their phone number or email address as passwordless credentials. Account Kit is powered by Facebook's email and SMS sending infrastructure for reliable scalable performance with global reach. Because it uses email and phone number authentication, Account Kit doesn't require a Facebook account and is the ideal alternative to a social login. - -Account Kit is built for the mobile world, providing long-lived sessions, easy account management, and no passwords to remember. When a person initiates a login with their email address, Account Kit sends a one-time link to the person's email address. The SDK will detect when an email address is verified. When a person initiates a login with their phone number, Account Kit either sends an SMS confirmation code to that number for validation or verifies the number directly (see [instant verification](#instant-verification)). - -The login flows for Account Kit combine account registration and account login. There is no need to check if an account exists already or to create a separate flow to register new users. After a successful login or registration, Account Kit provides your app with authentication credentials for the person logging in. - -The user interface for the login is provided by the SDK. Provides customizable view controllers to manage the login flow for you. Simply present the view controller to get started. - -Account Kit supports SMS-based authentication for hundreds of country codes. For a list of the country codes that Account Kit supports for SMS-based authentication, see [Supported SMS Country Codes][1]. There is no charge for SMS messaging through August 2018. After that, apps that exceed 100,000 SMS messages per month may be charged at standard SMS rates. For more information see ["Is there a charge for using SMS with Account Kit"][2] in the FAQ. - -Account Kit also supports localization of the interface, SMS messages, and authentication emails into dozens of languages. For languages supported for localization, see [Supported Languages][3]. - -## How Account Kit Works - -Account Kit creates a database just for your app. You can access the data at any time through a REST API. As people log into your app, this database is populated with a list of phone numbers or email addresses and Account IDs that can be used within your app. These Account IDs are unique to your app. If you also use Facebook Login for your app, you can be sure that there will never be a conflict with Facebook's app-scoped IDs. - -Account Kit has two login flows, depending on whether people choose phone number verification or email verification. - -### Phone Number Verification Flow - -1. Call the Account Kit API with a phone number to initiate a login or registration. -2. Account Kit servers send an SMS with a confirmation code to continue the login. If people fail to receive the SMS code, Account Kit offers two backups that people can choose from: - * Phone call — People can choose to receive a phone call with the SMS code. For a list of the languages into which the call can be localized, see the [Supported Langages for Phone Calls][4] section of Supported Languages. - * Facebook notification — If the phone number is linked to a Facebook account, people can choose to have a notification containing the SMS sent to that account. - - Account Kit may also verify the number directly without sending an SMS code. See Instant Verification. -3. The SDK verifies the SMS confirmation code. -4. If your app has enabled Client Access Token Flow, your app will receive an access token containing an account ID in response to a successful login. If your app has not enabled Client Access Token Flow, your client app will receive an authentication code that the application's server may use to securely request an access token. - -For more information on Client Access Token Flow, see [Access Tokens and Authorization Codes][5]. - -### Email Verification Flow - -1. Call the Account Kit API with an email address to initiate a login or registration. -2. Account Kit servers send a confirmation email to the email address. -3. The SDK monitors the status of the confirmation email. -4. If your app has enabled Client Access Token Flow, your app will receive an access token containing an account ID in response to a successful login. If your app has not enabled Client Access Token Flow, your client app will receive an authentication code that the application's server may use to securely request an access token. - -For more information on Client Access Token Flow, see [Access Tokens and Authorization Codes][5]. - -## Account Kit Settings Page - -People using Account Kit to log into apps have access to a settings page where they can block notifications and delete their accounts from apps. This is important for developers because if someone deletes their account from your app and then later uses Account Kit with the same credentials to log into your app, their account ID will be different. - -[1]: https://developers.facebook.com/docs/accountkit/countrycodes -[2]: https://developers.facebook.com/docs/accountkit/faq/#faq_184327531988271 -[3]: https://developers.facebook.com/docs/accountkit/languages -[4]: https://developers.facebook.com/docs/accountkit/languages/#call -[5]: https://developers.facebook.com/docs/accountkit/accesstokens diff --git a/Facebook.iOS/docs/AccountKit/GettingStarted.md b/Facebook.iOS/docs/AccountKit/GettingStarted.md deleted file mode 100644 index e14d6aef..00000000 --- a/Facebook.iOS/docs/AccountKit/GettingStarted.md +++ /dev/null @@ -1,585 +0,0 @@ -# Facebook Account Kit for iOS - -## Table of content - -- [Facebook Account Kit for iOS](#facebook-account-kit-for-ios) - - [Table of content](#table-of-content) - - [1. Select an App or Create a New App](#1-select-an-app-or-create-a-new-app) - - [2. Choose Your App Settings](#2-choose-your-app-settings) - - [3. Set up Your Developer Environment](#3-set-up-your-developer-environment) - - [Configure the SDK](#configure-the-sdk) - - [Initialize the SDK](#initialize-the-sdk) - - [4. Configure Login View Controller](#4-configure-login-view-controller) - - [UI Theming](#ui-theming) - - [5. Handle Different Login States](#5-handle-different-login-states) - - [6. Initiate a Login Flow for SMS](#6-initiate-a-login-flow-for-sms) - - [7. Initiate a Login Flow for Email](#7-initiate-a-login-flow-for-email) - - [8. Handle Login Callback](#8-handle-login-callback) - - [9. Access Account Information](#9-access-account-information) - - [10. Provide the Logout Flow](#10-provide-the-logout-flow) -- [Customizing the Account Kit UI for iOS](#customizing-the-account-kit-ui-for-ios) - - [Basic UI](#basic-ui) - - [Classic Skin](#classic-skin) - - [Translucent Skin](#translucent-skin) - - [Contemporary Skin](#contemporary-skin) - - [Advanced UI](#advanced-ui) - - [Using the Advanced UI Manager](#using-the-advanced-ui-manager) - - [Localization](#localization) -- [Configuring Country Code Availability for SMS](#configuring-country-code-availability-for-sms) - - [Whitelisting Country Codes](#whitelisting-country-codes) - - [Blacklisting Country Codes](#blacklisting-country-codes) - - [Default Country Code](#default-country-code) - -## 1. Select an App or Create a New App - -Select an [app or create a new one][1]. Then, click on the **+** icon next to the **PRODUCTS** label to add **Account Kit**. - -## 2. Choose Your App Settings - -Choose whether to allow email and SMS login, and choose security settings for your app. For more information on choosing your access token setting, see [Access Tokens][2], and for information on choosing your app secret setting, see [Using the Graph API][3]. - -## 3. Set up Your Developer Environment - -### Configure the SDK - -Add both your **Facebook App ID** and **Account Kit Client Token** to your **Info.plist** file as strings. Make sure you have enabled Account Kit in the App Dashboard. You'll find the Account Kit client token in the Account Kit section of the App Dashboard. The application name will be used in the UI on the login screen. - -```xml - - - FacebookAppID - {your-app-id} - AccountKitClientToken - {your-account-kit-client-token} - CFBundleURLTypes - - - CFBundleURLSchemes - - ak{your-app-id} - - - - ... - - -``` - -If you wish to disable App Events for your Account Kit application, add the following entry to your **Info.plist** file inside the tag: - -```xml -AccountKitFacebookAppEventsEnabled -0 -``` - -By default, this flag is set to `1`. See [App Events and Analytics][4] for more information. - -### Initialize the SDK - -In your initial view controllers, add the `Facebook.AccountKit` namespace and declare an `accountKit` variable to manage all Account Kit interactions. Declare the view controller to be an implementer of `IViewControllerDelegate`. - -```csharp -using Facebook.AccountKit; - -public partial class LoginViewController : UIViewController, IViewControllerDelegate -{ - AccountKit accountKit; - UIViewController pendingLoginViewController; -} -``` - -When your initial view controller is loaded, check and initialize your `accountKit` variable. Be sure the response type you use to initialize Account Kit matches the one selected in your app's dashboard in the Facebook developer portal, either `ResponseType.AccessToken` or `ResponseType.AuthorizationCode`. - -```csharp -public override void ViewDidLoad () -{ - base.ViewDidLoad (); - - // initialize Account Kit - if (accountKit == null) - // may also specify AKFResponseTypeAccessToken - accountKit = new AccountKit (ResponseType.AccessToken); //Or use Code - - // view controller for resuming login - pendingLoginViewController = accountKit.GetViewControllerForLoginResume (); -} -``` - -## 4. Configure Login View Controller - -You can configure your login view controller with the following parameters: - -| Parameter | Description | -|------------------------|-------------| -| `Delegate` | `IViewControllerDelegate`: Pass in the delegate handling the login callback. | -| `EnableSendToFacebook` | `BOOL`: Set to `true` to allow receiving Facebook notifications (if available) as a backup method of verification. | -| `EnableGetACall` | `BOOL`: Set to `true` to allow receiving phone calls as backup verification method. | -| `UiManager` | `IUIManager`: Pass in either an instance of `SkinManager` or a class implementing `IAdvancedUIManager` if you would like to use the Advanced UI. Otherwise you can pass in `null`. For more information, see [Customizing the UI](#customizing-the-account-kit-ui-for-ios). | - -The delegate for your `LoginViewController` must implement the `IViewControllerDelegate` protocol. All of the protocol methods are optional, but you should at least handle successful login callbacks for the login flows (SMS or Email) that you use in your app. Set up your main view controller to receive login callbacks: - -```csharp -using Facebook.AccountKit; - -public partial class LoginViewController : UIViewController, IViewControllerDelegate -{ - ... -} -``` - -Prepare the Account Kit login view controller by setting a delegate as shown in the following code block. - -```csharp -void PrepareLoginViewController (IViewController loginViewController) -{ - loginViewController.Delegate = this; - // Optionally, you may set up backup verification methods. - loginViewController.EnableSendToFacebook = true; - loginViewController.EnableGetACall = true; -} -``` - -### UI Theming - -(optional) You can create a classic skin UI with blue color using the following code: - -```csharp -loginViewController.UiManager = new SkinManager (SkinType.Classic, UIColor.Blue); -``` - -You may apply a theme or use the _Advanced UI Manager_ if you want to customize the user interface. For more information, see [Customizing the UI](#customizing-the-account-kit-ui-for-ios). - -## 5. Handle Different Login States - -When your initial view controller appears, you should bypass the login view controller if the user is already logged in. It will also resume pending logins if any are present. - -Your view controller needs to maintain a handle to an `AccountKit` object at all times. You can declare this using the following code: - -```csharp -public partial class ViewController : UIViewController, IViewControllerDelegate -{ - AccountKit accountKit; -} -``` - -To initialize Account Kit, we recommend doing this in the `ViewDidLoad` event of your view controller. The following code initializes Account Kit to use the token access flow: - -```csharp -public override void ViewDidLoad () -{ - base.ViewDidLoad (); - accountKit = new AccountKit (ResponseType.AccessToken); -} -``` - -If your app receives the user's access token directly (because the **Enable Client Access Token Flow** switch in your app's dashboard is ON), then you should check for a valid, existing token using `accountKit.CurrentUserToken`. - -```csharp -public override void ViewWillAppear (bool animated) -{ - base.ViewWillAppear (animated); - if (accountKit.CurrentAccessToken != null) { - // if the user is already logged in, go to the main screen - ProceedToMainScreen (); - } else { - // Show the login screen - ShowLoginControls (); - } -} -``` - -If your app receives an authorization code that it will pass to the server (because the **Enable Client Access Token Flow** switch in your app's dashboard is OFF), it is up to you to have your server communicate the correct login status to your client application and return that. - -For more information on access tokens and authorization codes, see [Access Tokens and Authorization Codes][2]. - -### 6. Initiate a Login Flow for SMS - -In your initial view controller, create a phone login handler to invoke when the login button is clicked by the user. There are two important parameters shown in the code below: - -| Parameter | Description | -|---------------|-------------| -| phoneNumber | `PhoneNumber` Pass this to pre-fill the phone number field in the phone login flow. Use `null` to skip pre-filling. | -| state | `string` This should be a random, non-guessable value. Any value passed via this parameter will be returned with the login response; compare the value in the response with this value to verify that the response you received was for the request you issued. | - -```csharp -void LoginWithPhone (NSObject sender) -{ - PhoneNumber phoneNumber = null; - var state = new NSUuid ().AsString (); - var viewController = accountKit.GetViewControllerForPhoneLogin (phoneNumber, state); - PrepareLoginViewController (viewController.AsIViewControllerProtocol ()); // see above - PresentViewController (viewController, true, null); -} -``` - -## 7. Initiate a Login Flow for Email - -In your initial view controller, create an email login handler to invoke when the login button is clicked by the user. There are two important parameters shown in the code below: - -| Parameter | Description | -|-----------|-------------| -| `email` | `string` Pass this to pre-fill the email address field in the email login flow. Use `null` to skip pre-filling. | -| `state` | `string` This should be a random, non-guessable value. Any value passed via this parameter will be returned with the login response; compare the value in the response with this value to verify that the response you received was for the request you issued. | - -```csharp -void LoginWithEmail (NSObject sender) -{ - string email = null; - var state = new NSUuid ().AsString (); - var viewController = accountKit.GetViewControllerForEmailLogin (email, state); - PrepareLoginViewController (viewController.AsIViewControllerProtocol ()); // see above - PresentViewController (viewController, true, null); -} -``` - -## 8. Handle Login Callback - -How you handle a login depends on whether your app uses an access token or an authorization code. For more information, see [Access Tokens and Authorization Codes][2]. - -To handle a successful login in Access Token mode: - -```csharp -[Export ("viewController:didCompleteLoginWithAccessToken:state:")] -public void DidCompleteLogin (UIViewController viewController, IAccessToken accessToken, string state) -{ - ProceedToMainScreen (); -} -``` - -To handle a successful login in Authorization Code mode: - -```csharp -[Export("viewController:didCompleteLoginWithAuthorizationCode:state:")] -public void DidCompleteLogin (UIViewController viewController, string code, string state) -{ - // Pass the code to your own server and have your server exchange it for a user access token. - // You should wait until you receive a response from your server before proceeding to the main screen. - SendAuthorizationCodeToServer (code); - ProceedToMainScreen (); -} -``` - -You may also handle a failed or canceled login: - -```csharp -[Export ("viewController:didFailWithError:")] -public void DidFail (UIViewController viewController, NSError error) -{ - // ... implement appropriate error handling ... - Console.WriteLine($"{nameof (ViewController)} did fail with error: {error.LocalizedDescription}"); -} - -[Export ("viewControllerDidCancel:")] -public void DidCancel (UIViewController viewController) -{ - // ... handle user cancellation of the login process ... -} -``` - -## 9. Access Account Information - -Once you have successfully logged in, you can access account information. For example, to display the account ID and the login credential used in access token mode: - -```csharp -accountKit.RequestAccount (HandleRequestAccount); - -void HandleRequestAccount (IAccount account, NSError error) -{ - // account ID - LblAccountId.Text = account.AccountId; - LblTitle.Text = account.PhoneNumber != null ? "Phone Number" : "Email Address"; - LblValue.Text = account.PhoneNumber?.GetStringRepresentation () ?? account.EmailAddress; -} -``` - -To display the account ID and the login credential used in Authorization Code mode, call your server to use the Graph API with the exchanged access token stored on your server (see [Access Token Validation][5]) and have your server pass the account ID and credential back to your app. - -## 10. Provide the Logout Flow - -You can invoke the `LogOut` method to log a user out of Account Kit: - -```csharp -accountKit.LogOut(); -``` - ---- - -# Customizing the Account Kit UI for iOS - -The user interface for the login screens is provided by the SDK. You can customize this user interface to match your app. For guidelines on customizing the UI, see [Customize the UI in Best Practices][6]. - -Account Kit offers two ways to customize the the user interface: - -* [Basic UI](#basic-ui) with three skins and limited customizability -* [Advanced UI](#avanced-ui) with the ability to customize individual elements - -## Basic UI - -The basic UI offers three skins to choose from: - -* Classic -* Translucent -* Contemporary - -For each skin you can optionally add a background image. If you add a background image, you can also choose a color and the background tint opacity as a value between 55-85%. The background tint also determines the color of the disclosure text, whether the text appears in black disclosure on a white background, or white on a black background. - -The skin and the options you choose control the appearance of phone-number and email screens and all other screens in the login flow. - -### Classic Skin - -The following images of email and SMS screens show the classic skin without a background image, with a background image and a white tint, and with an image and a black tint: - -

- - - -

- -The other screens in the login flow follow the skin and options you choose. For example, the following verification screen represents the classic skin with a background image and a white tint: - - - -### Translucent Skin - -The following pictures illustrate the translucent skin without a background image, with an background image and a white tint: - -

- - -

- -### Contemporary Skin - -The following pictures illustrate the contemporary skin without a background image, with an background image and a white tint, and with an image and a black tint: - -

- - - -

- -The following code shows how to create a skin without a background image: - -```csharp -// Constructor for a skin without a background image - -// Init AccountKit -AccountKit accountKit; -accountKit = new AccountKit (ResponseType.AccessToken); - -// Set view controller: -UIViewController viewController; - -// --either-- Phone number login: -viewController = accountKit.GetViewControllerForPhoneLogin (null, null); - -// --or-- Email login: -viewController = accountKit.GetViewControllerForEmailLogin (null, null); - -// skinType can be SkinType.Classic, SkinType.Translucent, or SkinType.Contemporary -viewController.AsIViewControllerProtocol ().UiManager = new SkinManager («SkinType», «UIColor»); - -// -- or -- -// Constructor using the default theme color -viewController.AsIViewControllerProtocol ().UiManager = new SkinManager («SkinType»); -``` - -The following codes shows how to create a skin with a background image: - -```csharp -// Constructor for a skin with a background image - -// Init AccountKit -AccountKit accountKit; -accountKit = new AccountKit (ResponseType.AccessToken); - -// Set view controller: -UIViewController viewController; - -// --either-- Phone number login: -viewController = accountKit.GetViewControllerForPhoneLogin (null, null); - -// --or-- Email login: -viewController = accountKit.GetViewControllerForEmailLogin (null, null); - -// skinType can be SkinType.Classic, SkinType.Translucent, or SkinType.Contemporary -// backgroundTint is either BackgroundTint.White or BackgroundTint.Black -// tintIntensity is a number between 0.55 and 0.85 -viewController.AsIViewControllerProtocol ().UiManager = new SkinManager («SkinType», «UIColor», «UIImage», «BackgroundTint», «nfloat»); -``` - -## Advanced UI - -The advanced UI gives you the ability to customize many elements of the interface independently. With the advance UI, you can customize the following elements: - - - -> ![note_icon] **_Note_**: _Please don't obscure any elements of the Account Kit user interface when you adjust the text and background colors. This is required by our platform policy._ - -The following table provides the full set of customizable options. - -| Property Name | Description | -|-----------------------|---------------------------------------------------------------------| -| BackgroundColor | Color for the background of the UI if an image is not used | -| ButtonBackgroundColor | Color for the background of the buttons | -| ButtonBorderColor | Color for the borders of buttons | -| ButtonTextColor | Color for the text on buttons | -| IconColor | Color for icons | -| InputBackgroundColor | Color for the background of the input boxes. | -| InputBorderColor | Color of the input boxes' border | -| InputTextColor | Text color of the input text for Phone Number and Confirmation Code | -| StatusBarStyle | Style for the status bar at the top | -| TextColor | Color for text | - -> ![note_icon] **_Note_**: If you specify a `BackgroundImage`, make sure your `BackgroundColor` is at least partly transparent (`Alpha` < 1.0), or your background image will not be visible. - -## Using the Advanced UI Manager - -Account Kit offers deeper customization of the login UI by allowing you to define an **Advanced UI** manager. You do this by creating a class that implements the `IAdvancedUIManager` interface and implementing individual methods to return custom views to be inserted in the login UI. For each view you want to customize, you must provide customizations appropriate to the current state of the login flow. - -Create a new interface in `MyUIManager` class. - -```csharp -using Facebook.AccountKit; - -public class MyUIManager : NSObject, IUIManager { - public ButtonType ConfirmButtonType { get; private set; } - public ButtonType EntryButtonType { get; private set; } - public Theme Theme { get; set; } -} -``` - -The `IUIManager` protocol lets you define the following customization points. This is how the protocol is defined: - -```csharp -public interface IActionController : INativeObject, IDisposable -{ - void Back (); - void Cancel (); -} - -public static class IUIManager_Extensions -{ - public static UIView GetActionBarView (this IUIManager This, LoginFlowState state); - public static UIView GetBodyView (this IUIManager This, LoginFlowState state); - public static ButtonType GetButtonType (this IUIManager This, LoginFlowState state); - public static UIView GetFooterView (this IUIManager This, LoginFlowState state); - public static UIView GetHeaderView (this IUIManager This, LoginFlowState state); - public static TextPosition GetTextPosition (this IUIManager This, LoginFlowState state); - public static Theme GetTheme (this IUIManager This); - public static void SetActionController (this IUIManager This, IActionController actionController); - public static void SetError (this IUIManager This, NSError error); -} -``` - -Each UIView returned by these methods corresponds to a section on the UI: - - - -If you do not wish to customize a section of the UI, simply either do not implement the method, or return `null` to fall back to the default view for that portion of the screen. - -The `IActionController` is the means to communicate back to Account Kit whether we want to go back to the previous screen or cancel the login flow. You'll need to maintain a handle to this action controlled inside your UI manager if you wish to perform these actions. - -The following code shows how to implement an advanced UI manager: - -```csharp -public class MyUIManager : NSObject, IUIManager { - public ButtonType ConfirmButtonType { get; private set; } - public ButtonType EntryButtonType { get; private set; } - public Theme Theme { get; set; } - - IActionController actionController; - - [Export ("setActionController:")] - void SetActionController (IActionController actionController) - { - this.actionController = actionController; - } - - [Export ("buttonTypeForState:")] - ButtonType GetButtonType (LoginFlowState state) - { - switch (state) { - case LoginFlowState.CodeInput: - return ConfirmButtonType; - case LoginFlowState.PhoneNumberInput: - case LoginFlowState.EmailInput: - return EntryButtonType; - default: - return ButtonType.Default; - } - } -} -``` - -This example changes the text on the "submit" button of the email or phone number input to be `EntryButtonType` and for the code verification screen to be `ConfirmButtonType`, and leaves all the other buttons to be the default value for Account Kit. - -### Localization - -Localization support is also provided by the SDK. The [supported languages][7] are packaged with the SDK. You don't need anything else to display text in the appropriate locale. - ---- - -# Configuring Country Code Availability for SMS - -By default, the Account Kit SDK allows users to enter a phone number for any country code supported by Account Kit. For the list of supported country codes, see [SMS Country Codes][8]. You can customize availability by setting either a country code whitelist or a country code blacklist in the `LoginViewController`. The following table shows the possible combinations of lists and the results: - -| Lists | Result | -|---------------------------|--------| -| No whitelist or blacklist | All country codes supported by Account Kit are available. | -| Whilelist | Only country codes in the whitelist are available. | -| Blacklist | All country codes supported by Account Kit except those in the blacklist are available. | -| Whitelist and blacklist | Only the country codes in the whitelist that are not also in the blacklist are available. Note that the blacklist takes priority for codes that are in both lists. | - -## Whitelisting Country Codes - -Whitelisting a set of countries restricts the country code selector to only those countries in the whitelist. Specify a whitelist array in `loginViewController.WhitelistedCountryCodes`. - -The value is an array of 2-letter country codes as defined by **ISO 3166-1 Alpha 2**. The following example restricts availability to just the **US +1** and the **Netherlands +31**: - -```csharp -void PrepareLoginViewController (IViewController controller) -{ - ... - loginViewController.WhitelistedCountryCodes = new [] { "US", "NL" }; - ... -} -``` - -## Blacklisting Country Codes - -Blacklisting a set of countries allows a user to use all of Account Kit's supported countries except those defined in the blacklist. Set a blacklist in `loginViewController.BlacklistedCountryCodes`. - -Just like the whitelist, the value is an array of short country codes as defined by **ISO 3166-1 Alpha 2**. The following example allows access everywhere that Account Kit is supported, except **ID +62**: - -```csharp -void PrepareLoginViewController (IViewController controller) -{ - ... - loginViewController.BlacklistedCountryCodes = new [] { "ID" }; - ... -} -``` - -### Default Country Code - -You can configure your default country code by setting a country code in `loginViewController.DefaultCountryCode`. The following example sets the default country code to the **US +1**: - -```csharp -void PrepareLoginViewController (IViewController controller) -{ - ... - loginViewController.DefaultCountryCode = "US"; - ... -} -``` - -[1]: https://developers.facebook.com/apps/ -[2]: https://developers.facebook.com/docs/accountkit/accesstokens -[3]: https://developers.facebook.com/docs/accountkit/graphapi -[4]: https://developers.facebook.com/docs/accountkit/appeventsanalytics -[5]: https://developers.facebook.com/docs/accountkit/graphapi#at-validation -[6]: https://developers.facebook.com/docs/accountkit/bestpractices/#customizeui -[7]: https://developers.facebook.com/docs/accountkit/languages -[8]: https://developers.facebook.com/docs/accountkit/countrycodes -[note_icon]: https://cdn3.iconfinder.com/data/icons/UltimateGnome/22x22/apps/gnome-app-install-star.png \ No newline at end of file diff --git a/Facebook.iOS/docs/AudienceNetwork/Details.md b/Facebook.iOS/docs/AudienceNetwork/Details.md deleted file mode 100644 index a204fc34..00000000 --- a/Facebook.iOS/docs/AudienceNetwork/Details.md +++ /dev/null @@ -1,16 +0,0 @@ -Facebook's Audience Network allows you to monetize your iOS apps with targeted ads. Audience Network gives you a powerful way to make more money and grow your business with Facebook ads while you keep users engaged. - -## How Audience Network Helps You Monetize Your App - -* **Facebook Targeting Based on Real People:** Show highly targeted ads that match the interests of your users. -* **Better Ads, Better User Experience:** Native ads that fit your app make for a great experience. -* **More Money for You:** Earn more revenue when your users engage with ads. - -## Flexible, High-Performing Formats - -Drive better performance with ads people want to see. With Audience Network, you can deliver compelling ads to your users. You choose how they look and where they appear in the user flow: - -* **Native:** Ads that you design to fit your app, seamlessly. -* **Interstitial:** Full-screen ads that capture attention and become part of the experience. -* **Banner:** Traditional formats in a variety of placements. -* **In-Stream Video:** Show ad content during a video for high revenue potential. diff --git a/Facebook.iOS/docs/AudienceNetwork/GettingStarted.md b/Facebook.iOS/docs/AudienceNetwork/GettingStarted.md deleted file mode 100644 index 840e534e..00000000 --- a/Facebook.iOS/docs/AudienceNetwork/GettingStarted.md +++ /dev/null @@ -1,881 +0,0 @@ -# Getting Started with the Facebook Audience Network - -Facebook's Audience Network allows you to monetize your iOS app with targeted ads. Please, follow [this guide][1] to walks you through steps to get started on Audience Network. - ---- - -# Preparing Your Audience Network Integration For App Transport Security (ATS) - -[App Transport Security (ATS)][11] is a privacy feature introduced in iOS 9. It's enabled by default for new applications and enforces secure connections. This guide will review actions you should take to ensure you are prepared when using the Facebook SDK for iOS. - -## Audience Network SDK is built to be 100% compliant. - -Part of being compliant is leveraging `SFSafariViewController` for displaying content. `SFSafariViewController` by default disables ATS. You do not need to enable any exceptions in your configuration for ads to be delivered from Audience Network. - ---- - -# Adding the Native Ad API in iOS - -The Native Ad API allows you to build a customized experience for the ads you show in your app. When using the Native Ad API, instead of receiving an ad ready to be displayed, you will receive a group of ad properties such as a title, an image, a call to action, and you will have to use them to construct a custom `UIView` where the ad is shown. - -> ![information_icon] _Please consult our [guidelines for native ads][2] when designing native ads in your app._ - -Let's implement the following native ad placement. You will create the following views to our native ad. - -* **View #1:** advertiser icon -* **View #2:** ad title -* **View #3:** sponsored label -* **View #4:** advertiser choice -* **View #5:** ad media view -* **View #6:** social context -* **View #7:** ad body -* **View #8:** ad call to action button - -![adImage](https://scontent.fgdl4-1.fna.fbcdn.net/v/t39.2365-6/15119831_604335559772201_4765472987522531328_n.png?_nc_cat=0&oh=6c08c32196ca96a990c82218896875ce&oe=5C134D88) - -## Step 1: Create Native Ad Views in Storyboard - -> ![information_icon] _When designing native ads and banner ads, ensure you have followed [iOS layout guideline][3] for optimal user experience._ - -> ![information_icon] _If you want to use the Xcode designer instead of Visual Studio designer to create the Native Ad View, plaese, read the first step of this [guide][4]._ - -1. Open the **MainStoryboard.storyboard** file in Visual Studio and add a `UIView` element to the main View element and name it to `AdUIView`. In addition, add an `AdIconView` (FBAdIconView), `LblAdTitle` (UILabel), `AdCoverMediaView` (FBMediaView), `LblAdSocialContext` (UILabel), `BtnAdCallToActiona` (UIButton), `AdChoiceView` (FBAdChoicesView), `LblAdBody` (UILabel), `LblSponsored` (UILabel) under `AdUIView` as illustrated in the image below. - - - -2. Add the necessary constraints to the view. -3. Build and run the project. You should see from your device or simulator empty content as follows: - - - -Now that you have created all the UI elements to show native ads, the next step is to load the native ad and bind the contents to the UI elements. - -## Step 2: Load and Show Native Ad - -1. Now, in your View Controller file, import the `Facebook.AudienceNetwork` namespace, declare that `ViewController` implements the `INativeAdDelegate` protocol and add a nativeAd instance variable: - - ```csharp - using Facebook.AudienceNetwork; - - namespace YourApp - { - public partial class ViewController : UIViewController, INativeAdDelegate - { - NativeAd nativeAd; - } - } - ``` - -2. In `ViewDidLoad` method, add the following lines of code to load native ad content: - - ```csharp - public override void ViewDidLoad () - { - base.ViewDidLoad (); - // Perform any additional setup after loading the view, typically from a nib. - - // Instantiate a NativeAd object. - // NOTE: the placement ID will eventually identify this as your App, you can ignore it for - // now, while you are testing and replace it later when you have signed up. - // While you are using this temporary code you will only get test ads and if you release - // your code like this to the App Store your users will not receive ads (you will get a no fill error). - - nativeAd = new NativeAd ("Native_Placement_Id") { Delegate = this }; - nativeAd.LoadAd (); - } - ``` - - Replace `Native_Placement_Id` with your own placement id string. If you don't have a placement id or don't know how to get one, you can refer to the [Getting Started Guide][5]. - -3. The next step is to show ad when content is ready. You would need to implement `NativeAdDidLoad` method in `ViewController` file: - - ```csharp - [Export ("nativeAdDidLoad:")] - public void NativeAdDidLoad (NativeAd nativeAd) - { - this.nativeAd = nativeAd; - - if (this.nativeAd != null && this.nativeAd.IsAdValid) - nativeAd.UnregisterView (); - - // Wire up UIView with the native ad; only call to action button and media view will be clickable. - nativeAd.RegisterView (AdUIView, AdCoverMediaView, AdIconView, this, new UIView [] { BtnAdCallToAction, AdCoverMediaView }); - - // Render native ads onto UIView - LblAdTitle.Text = this.nativeAd.AdvertiserName; - LblAdBody.Text = this.nativeAd.BodyText; - LblAdSocialContext.Text = this.nativeAd.SocialContext; - LblSponsored.Text = this.nativeAd.SponsoredTranslation; - BtnAdCallToAction.SetTitle (this.nativeAd.CallToAction, UIControlState.Normal); - AdChoiceView.NativeAd = this.nativeAd; - AdChoiceView.Corner = UIRectCorner.TopRight; - } - ``` - - First, you will need to check if there is an existing `nativeAd` object. If there is, you will need to call `UnregisterView` method. Then you will call `nativeAd.RegisterView` method. - - What `RegisterView` mainly does is register what views will be tappable and what the delegate is to notify when a registered view is tapped. In this case, `BtnAdCallToAction` and `AdCoverMediaView` will be tappable and when the view is tapped, ViewController will be notified through `INativeAdDelegate` interface. - - ### Controlling Clickable Area - - > ![information_icon] _For a better user experience and better results, you should always consider controlling the clickable area of your ad to avoid unintentional clicks. Please refer to [Audience Network SDK Policy][6] page for more details about white space unclickable enforcement._ - - For finer control of what is clickable, you can use the `nativeAd.RegisterView (UIView, UIViewController, UIView [])` overload method to register a list of views that can be clicked. - -4. Choose your build target to be device and run the above code, you should see something like this: - - - -> ![information_icon] _When running ads in the simulator, change the setting to test mode to view test ads. Please go to [How to Use Test Mode][7] for more information._ - -## Step 3: How to Get the Aspect Ratio of the Content and Apply Natural Width and Height - -In the example above, the media content of the ad is shown in `AdCoverMediaView` and its object type is `MediaView`. From previous step, we have shown how to use `MediaView` to load media content from a given `NativeAd` object. This view takes the place of manually loading a cover image. When creating the `MediaView`, its width and height can be either determined by the auto layout constraints set in the storyboard, or they can be hard-coded. However, the width and height of the view may not be fit with the actual cover image of the ad downloaded later. To fix this, the example following shows how to get the aspect ratio of the content and apply natural width and height: - -1. In your `ViewController`, declare that `ViewController` implements the `IMediaViewDelegate` interface as follows: - - ```csharp - public partial class ViewController : UIViewController, INativeAdDelegate, IMediaViewDelegate - ``` - -2. When the native ad is loaded, set the delegate of `MediaView` object to be the controller self as follows: - - ```csharp - [Export ("nativeAdDidLoad:")] - public void NativeAdDidLoad (NativeAd nativeAd) - { - // ... - AdCoverMediaView.Delegate = this; - // ... - } - ``` - -3. Implement `MediaViewDidLoad` method in `ViewController` as follows: - - ```csharp - [Export ("mediaViewDidLoad:")] - public void MediaViewDidLoad (MediaView mediaView) - { - var currentAspect = mediaView.Frame.Width / mediaView.Frame.Height; - Console.WriteLine ($"Current aspect of media view: {currentAspect}"); - - var actualAspect = mediaView.AspectRatio; - Console.WriteLine ($"Current aspect of media view: {actualAspect}"); - } - ``` - - `mediaView.AspectRatio` returns a positive `nfloat`, or `0.0` if no ad is currently loaded. Its value is valid after media view is loaded. There are convenience methods that will set the width and height of the `MediaView` object respecting its apsect ratio of the media content loaded. You can call `ApplyNaturalWidth` or `ApplyNaturalHeight` methods to update the `MediaView` object's width or height to respect the media content's aspect ratio. - -## Step 4: Verify Impression and Click Logging - -Optionally, you can add the following functions to handle the cases where the native ad is closed or when the user clicks on it: - -```csharp -[Export ("nativeAdDidClick:")] -public void NativeAdDidClick (NativeAd nativeAd) -{ - Console.WriteLine ("Native ad was clicked."); -} - -[Export ("nativeAdDidFinishHandlingClick:")] -public void NativeAdDidFinishHandlingClick (NativeAd nativeAd) -{ - Console.WriteLine ("Native ad did finish click handling."); -} - -[Export ("nativeAdWillLogImpression:")] -public void NativeAdWillLogImpression (NativeAd nativeAd) -{ - Console.WriteLine ("Native ad impression is being captured."); -} -``` - -## Step 5: How to Debug When Ad Not Shown - -Add and implement the following function in your `ViewController` to handle ad loading failures and completions: - -```csharp -[Export ("nativeAd:didFailWithError:")] -public void NativeAdDidFail (NativeAd nativeAd, NSError error) -{ - Console.WriteLine ($"Native ad failed to load with error: {error.LocalizedDescription}"); -} -``` - -## Step 6: Load Ad without Auto Cache - -1. We strongly recommend to leave media caching on by default in all cases. However, we allow you to override the default. Please be very careful if you decide to override our default media caching. - - ```csharp - public partial class ViewController : UIViewController, INativeAdDelegate, IMediaViewDelegate { - - public override void ViewDidLoad () - { - base.ViewDidLoad (); - // Perform any additional setup after loading the view, typically from a nib. - - // Instantiate a NativeAd object. - // NOTE: the placement ID will eventually identify this as your App, you can ignore it for - // now, while you are testing and replace it later when you have signed up. - // While you are using this temporary code you will only get test ads and if you release - // your code like this to the App Store your users will not receive ads (you will get a no fill error). - - nativeAd = new NativeAd ("Native_Placement_Id") { Delegate = this }; - nativeAd.LoadAd (NativeAdsCachePolicy.None); - } - - } - ``` - -2. First, you will need to manually download all media for the native ad. - - ```csharp - [Export ("nativeAdDidLoad:")] - public void NativeAdDidLoad (NativeAd nativeAd) - { - AdCoverMediaView.Delegate = this; - nativeAd.DownloadMedia (); - this.nativeAd = nativeAd; - } - ``` - -3. Next, you should only call `RegisterView` and display ad after `MediaViewDidLoad` callback. All media has to be loaded and displayed for an eligible impression. - - ```csharp - [Export ("nativeAdDidLoad:")] - public void NativeAdDidLoad (NativeAd nativeAd) - { - if (this.nativeAd != null && this.nativeAd.IsAdValid) - this.nativeAd.UnregisterView (); - - // Wire up UIView with the native ad; only call to action button and media view will be clickable. - nativeAd.RegisterView (AdUIView, AdCoverMediaView, AdIconView, this, new UIView [] { BtnAdCallToAction, AdCoverMediaView }); - - // Render native ads onto UIView - LblAdTitle.Text = this.nativeAd.AdvertiserName; - LblAdBody.Text = this.nativeAd.BodyText; - LblAdSocialContext.Text = this.nativeAd.SocialContext; - LblSponsored.Text = this.nativeAd.SponsoredTranslation; - BtnAdCallToAction.SetTitle (this.nativeAd.CallToAction, UIControlState.Normal); - AdChoiceView.NativeAd = this.nativeAd; - AdChoiceView.Corner = UIRectCorner.TopRight; - } - ``` - ---- - -# Native Ads Template - -Publishers seeking a more hands off approach when integrating Native Ads can leverage a custom Audience Network Native Ads template. Customize a native ad's size, color, and font to match the look and feel of your app. - -## Step 1: Implementation - -In your `ViewController`, import the `Facebook.AudienceNetwork` namespace and declare that you implement the `INativeAdDelegate` interface: - -```csharp -using Facebook.AudienceNetwork; - -namespace YourApp -{ - public partial class ViewController : UIViewController, INativeAdDelegate - { - - } -} -``` - -Then, add a method in your `ViewController` that initializes a `NativeAd` and request an ad to load: - -```csharp -public override void ViewDidLoad () -{ - base.ViewDidLoad (); - // Perform any additional setup after loading the view, typically from a nib. - - nativeAd = new NativeAd ("Native_Placement_Id") { Delegate = this }; - nativeAd.LoadAd (); -} -``` - -Replace `Native_Placement_`Id with your own placement id string. If you don't have a placement id or don't know how to get one, you can refer to the [Getting Started Guide][5]. - -Now that you have added the code to load the ad, add the following functions to construct the ad once it has loaded: - -```csharp -[Export ("nativeAdDidLoad:")] -public void NativeAdDidLoad (NativeAd nativeAd) -{ - var adView = NativeAdView.From (nativeAd, NativeAdViewType.GenericHeight300); - - View.AddSubview (adView); - - var size = View.Bounds.Size; - var xOffset = size.Width / 2 - 160; - var yOffset = size.Height > size.Width ? 100 : 20; - adView.Frame = new CGRect (xOffset, yOffset, 320, 300); -} -``` - -Choose your build target to be device and run the above code, you should see something like this: - - - -Custom Ad Formats come in four templates: - -| Template View Type | Height | Width | Attributes Included | -|---------------------------------------|--------|----------------|------------------------------------------------------------------| -| **NativeAdViewType.GenericHeight100** | 100dp | Flexible width | Icon, title, context, and CTA button | -| **NativeAdViewType.GenericHeight120** | 120dp | Flexible width | Icon, title, context, description and CTA button | -| **NativeAdViewType.GenericHeight300** | 300dp | Flexible width | Image, icon, title, context, description and CTA button | -| **NativeAdViewType.GenericHeight400** | 400dp | Flexible width | Image, icon, title, subtitle context, description and CTA button | - -Native ad templates can also be used in tandem with a Horizontal Scroll View. See [here][8] for details. - -## Step 2: Further Customization - -With a native custom template, you can customize the following elements: - -* Height -* Width -* Background Color -* Title Color -* Title Font -* Description Color -* Description Font -* Button Color -* Button Title Color -* Button Title Font -* Button Border Color - -If you want to customize certain elements, then it is recommended to use a design that fits in with your app's layouts and themes. - -You will need to build `NativeAdViewAttributes` object and provide a loaded native ad to render these elements: - -```csharp -[Export ("nativeAdDidLoad:")] -public void NativeAdDidLoad (NativeAd nativeAd) -{ - var attributes = new NativeAdViewAttributes { - BackgroundColor = UIColor.FromRGBA (.9f, .9f, .9f, 1), - ButtonColor = UIColor.FromRGBA (66f / 255, 108f / 255, 173f / 255, 1), - ButtonTitleColor = UIColor.White - }; - - var adView = NativeAdView.From (nativeAd, NativeAdViewType.GenericHeight300, attributes); - - View.AddSubview (adView); - - var size = View.Bounds.Size; - var xOffset = size.Width / 2 - 160; - var yOffset = size.Height > size.Width ? 100 : 20; - adView.Frame = new CGRect (xOffset, yOffset, 320, 300); -} -``` - -The above code will render an ad that looks like this: - - - ---- - -# Adding Interstitial Ad to your iOS app - -The Audience Network allows you to monetize your iOS apps with Facebook ads. An interstitial ad is a full screen ad that you can show in your app. Follow this guide to display this type of ad unit. - -Let's implement the following interstitial ad placement. - - - -## Step 1: Load and Show Interstitial Ad View - -1. In your `ViewController`, import the `Facebook.AudienceNetwork` namespace and declare that `ViewController` implements the `IInterstitialAdDelegate` interface and add an instance variable for the interstitial ad unit: - - ```csharp - using Facebook.AudienceNetwork; - - namespace YourApp - { - public partial class ViewController : UIViewController, IInterstitialAdDelegate - { - InterstitialAd interstitialAd; - } - } - ``` - -2. Next, implement `ViewDidLoad` method and `InterstitialAdDidLoad` in `ViewController` file. - - ```csharp - public override void ViewDidLoad () - { - base.ViewDidLoad (); - // Perform any additional setup after loading the view, typically from a nib. - - interstitialAd = new InterstitialAd ("Interstitial_Placement_Id") { Delegate = this }; - // For auto play video ads, it's recommended to load the ad - // at least 30 seconds before it is shown - interstitialAd.LoadAd (); - } - - [Export ("interstitialAdDidLoad:")] - public void InterstitialAdDidLoad (InterstitialAd interstitialAd) - { - Console.WriteLine ("Ad is loaded and ready to be displayed"); - - // You can now display the full screen ad using this code: - interstitialAd.ShowAd (this); - } - ``` - -3. Replace `Interstitial_Placement_Id` with your own placement id string. If you don't have a placement id or don't know how to get one, refer to the [Getting Started Guide][5]. Choose your build target to be device and run the above code, you should see something like this: - - - -> ![information_icon] _When running ads in the simulator, change the setting to test mode to view test ads. Please go to [How to Use Test Mode][7] for more information._ - -## Step 2: Verify Impression and Click Logging - -Optionally, you can add the following functions to handle the cases when the ad is shown, clicked or closed by users: - -```csharp -[Export ("interstitialAdWillLogImpression:")] -public void InterstitialAdWillLogImpression (InterstitialAd interstitialAd) -{ - Console.WriteLine ("The user sees the add"); - // Use this function as indication for a user's impression on the ad. -} - -[Export ("interstitialAdDidClick:")] -public void InterstitialAdDidClick (InterstitialAd interstitialAd) -{ - Console.WriteLine ("The user clicked on the ad and will be taken to its destination"); - // Use this function as indication for a user's click on the ad. -} - -[Export ("interstitialAdWillClose:")] -public void InterstitialAdWillClose (InterstitialAd interstitialAd) -{ - Console.WriteLine ("The user clicked on the close button, the ad is just about to close"); - // Consider to add code here to resume your app's flow -} - -[Export ("interstitialAdDidClose:")] -public void InterstitialAdDidClose (InterstitialAd interstitialAd) -{ - Console.WriteLine ("Interstitial had been closed"); - // Consider to add code here to resume your app's flow -} -``` - -## Step 3: Debugging When Ad Is Not Shown - -Add and implement the following function in your `ViewController` to handle ad loading failures and completions: - -```csharp -[Export ("interstitialAd:didFailWithError:")] -public void IntersitialDidFail (InterstitialAd interstitialAd, NSError error) -{ - Console.WriteLine ("Ad failed to load"); -} -``` - -> ![information_icon] When there is no ad to show, the `IntersitialDidFail` method will be called with `error.Code` set to `1001`. If you use your own custom reporting or mediation layer you might want to check the code value and detect this case. You can fallback to another ad network in this case, but do not re-request an ad immediately after. - ---- - -# Adding Ad Banners to your iOS app - -The Audience Network allows you to monetize your iOS apps with Facebook ads. This guide explains how to create an iOS app that shows banner ads. - -Let's implement the following banner ad placement. - - - -## Step 1: Load and Show Banner Ad View - -> ![information_icon] _When designing native ads and banner ads, ensure you have followed [iOS layout guideline][3] for optimal user experience._ - -1. In your `ViewController` import the `Facebook.AudienceNetwork` namespace and declare that `ViewController` implements the `IAdViewDelegate` interface: - - ```csharp - using Facebook.AudienceNetwork; - - namespace YourApp - { - public partial class ViewController : UIViewController, IAdViewDelegate - { - - } - } - ``` - -2. Next, implement `ViewDidLoad` and add the code below to create a new instance of `AdView` and add it to the view. `AdView` is a subclass of `UIView`. You can add it to your view hierarchy just like any other view: - - ```csharp - public override void ViewDidLoad () - { - base.ViewDidLoad (); - // Perform any additional setup after loading the view, typically from a nib. - - var adView = new AdView ("Banner_Placement_Id", AdSizes.BannerHeight50, this) { Delegate = this }; - adView.Frame = new CGRect (0, 20, adView.Bounds.Width, adView.Bounds.Height); - adView.LoadAd (); - View.AddSubview (adView); - } - ``` - - Audience Network supports three ad sizes to be used in your `AdView`. The Banner unit's width is flexible with a minimum of 320px, and only the height is defined. - - | Ad Format | AdSize Reference | Size | Recommendation | - |------------------|--------------------------------|---------|-------------------------------------------------------------------------| - | Standard Banner | **AdSizes.BannerHeight50** | 320x50 | This banner is best suited to phones | - | Large Banner | **AdSizes.BannerHeight90** | 320x90 | This banner is best suited to tablets and larger devices | - | Medium Rectangle | **AdSizes.RectangleHeight250** | 300x250 | This format is best suited for scrollable feeds or end-of-level screens | - -3. Replace `Banner_Placement_Id` with your own placement id string. If you don't have a placement id or don't know how to get one, refer to the [Getting Started Guide][5]. Choose your build target to be device and run the above code, you should see something like this: - - - - > ![information_icon] _When running ads in the simulator, change the setting to test mode to view test ads. Please go to [How to Use Test Mode][7] for more information._ - -## Step 2: Verify Impression and Click Logging - -Optionally, you can add the following functions to handle the cases where the banner ad is closed or when the user clicks on it: - -```csharp -[Export ("adViewDidClick:")] -public void AdViewDidClick (AdView adView) -{ - Console.WriteLine ("Banner ad was clicked."); -} - -[Export ("adViewDidFinishHandlingClick:")] -public void AdViewDidFinishHandlingClick (AdView adView) -{ - Console.WriteLine ("Banner ad did finish click handling."); -} - -[Export ("adViewWillLogImpression:")] -public void AdViewWillLogImpression (AdView adView) -{ - Console.WriteLine ("Banner ad impression is being captured."); -} -``` - -## Step 3: How to Debug When Ad Not Shown - -Add and implement the following two functions in your View Controller implementation file to handle ad loading failures and completions: - -```csharp -[Export ("adViewDidLoad:")] -public void AdViewDidLoad (AdView adView) -{ - Console.WriteLine ("Ad was loaded and ready to be displayed"); -} - -[Export ("adView:didFailWithError:")] -public void AdViewDidFail (AdView adView, NSError error) -{ - Console.WriteLine ("Ad failed to load"); -} -``` - -> ![information_icon] _When there is no ad to show, the `AdViewDidFail` method will be called with `error.Code` set to `1001`. If you use your own custom reporting or mediation layer, you may want to check the code value and detect this case. You can fallback to another ad network in this case, but do not re-request an ad immediately after._ - ---- - -# Adding In-stream Video Ads to your iOS app - -Video publishers can now use Audience Network's In-stream solution to deliver video ads to their global audience across mobile and desktop environments in pre-roll and mid-roll settings. Follow this guide to display this type of ad unit for iOS-based video content. - -## Requirements - -Please refer to the "In-Stream Video Requirements" section of the [Design Guidelines for Audience Network Ads][9]. - -## Implementation - -This guide will walk you through implementing in-stream video ads on iOS following these steps: - -## Step 1: Apply for Audience Network In-stream Video - -Go to your app dashboard and from the Audience Network menu on the left side of the screen, select Apps and Websites. Then, go to the "Apply for in-stream video ads" section. Please review the Requirements and, if applicable, click on the Apply button and follow the on screen instructions. - -## Step 2: Create Placements - -Audience Network offers 4 types of ad units: banner, interstitial (app only), native ads, and In-stream Video. You will see In-stream Video as a Display Format type after you have been approved for In-stream Video. Each ad unit in your app or website is identified using a unique placement ID. Follow this [step][10] to learn how to create this identifier. - -## Step 3: Load and Show In-stream Video Ad - -Now, in your `ViewController` import the `Facebook.AudienceNetwork` namespace, declare that you implement the `IInstreamAdViewDelegate` protocol and add an instance variable for the interstitial ad unit: - -```csharp -using Facebook.AudienceNetwork; - -namespace YourApp -{ - public partial class ViewController : UIViewController, IInstreamAdViewDelegate - { - InstreamAdView adView; - } -} -``` - -Initialize and load an in-stream ad view when it's time to show an ad. This can also be done ahead of time, to pre-cache an ad. In place of `Instream_Placement_Id`, use the id of the in-stream video placement you created earlier. - -```csharp -void LoadInstreamAd () -{ - adView = new InstreamAdView ("Instream_Placement_Id") { Delegate = this }; - adView.LoadAd (); -} -``` - -Now that you have added the code to load the ad add the necessary delegate implementation to display the ad, and handle failures: - -> ![information_icon] _When there is no ad to show, the adView:didFailWithError: will be called with error.code set to 1001. You should detect this and return to the content._ - -```csharp -public void AdViewDidLoad (InstreamAdView adView) -{ - Console.WriteLine ("Ad is loaded and ready to be displayed"); - - // The ad can now be added to the layout and shown - this.adView.Frame = View.Bounds; - this.adView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; - View.AddSubview (adView); - this.adView.ShowAd (this); -} - -public void AdViewDidEnd (InstreamAdView adView) -{ - Console.WriteLine ("Ad ended"); - this.adView.RemoveFromSuperview (); - this.adView.Dispose (); - this.adView = null; - - // The app should now proceed to content -} - -public void AdViewDidFail (InstreamAdView adView, NSError error) -{ - Console.WriteLine ($"Ad failed: {error.LocalizedDescription}"); - this.adView.RemoveFromSuperview (); - this.adView.Dispose (); - this.adView = null; - - // The app should now proceed to content -} -``` - -Once you run the above code and present the in-stream ad, you should see something like this: - - - -## Step 4: Handle Impressions and Clicks - -Optionally, you can add the following functions to handle ad clicks and impressions: - -```csharp -[Export ("adViewDidClick:")] -public void AdViewDidClick (InstreamAdView adView) -{ - Console.WriteLine ("Ad clicked"); - // Called when the user clicks on the "Learn More" button. -} - -[Export ("adViewWillLogImpression:")] -public void AdViewWillLogImpression (InstreamAdView adView) -{ - Console.WriteLine ("Ad impression"); - // Called when the ad logs an impression -} -``` - -> ![information_icon] _When running ads in the simulator, change the setting to test mode to view test ads. Please go to [How to Use Test Mode][7] for more information._ - ---- - -# Rewarded Video for iOS - -Rewarded video ads are a full screen experience where users opt-in to view a video ad in exchange for something of value, such as virtual currency, in-app items, exclusive content, and more. The ad experience is 15-30 second non-skippable and contains an end card with a call to action. Upon completion of the full video, you will receive a callback to grant the suggested reward to the user. - -> ![information_icon] _Please note, Rewarded Video is only supported for iOS 8 and above._ - -## Implementation - -Now, in your `ViewController` import the `Facebook.AudienceNetwork` namespace, declare that you implement the `IRewardedVideoAdDelegate` interface and add an instance variable for the rewarded video ad unit: - -```csharp -using Facebook.AudienceNetwork; - -namespace YourApp -{ - public partial class ViewController : UIViewController, IRewardedVideoAdDelegate - { - RewardedVideoAd rewardedVideoAd; - } -} -``` - -Add a function in your `ViewController` that initializes the rewarded video object and caches the video creative ahead of the time you want to show it. - -```csharp -public override void ViewDidLoad () -{ - base.ViewDidLoad (); - // Perform any additional setup after loading the view, typically from a nib. - - LoadRewardedVideoAd (); -} - -void LoadRewardedVideoAd () -{ - rewardedVideoAd = new RewardedVideoAd ("Rewarded_Video_Placement_Id") { Delegate = this }; - rewardedVideoAd.LoadAd (); -} -``` - -Replace `Rewarded_Video_Placement_Id` with your own placement id string. If you don't have a placement id or don't know how to get one, you can refer to the [Getting Started Guide][5]. - -Now that you have added the code to load the ad, you can add functions which will handle various events. For example: - -* `RewardedVideoAdDidLoad` ensures your app is aware when the ad is cached and ready to be displayed -* `RewardedVideoAdComplete` lets you know when to deliver your reward to the user after a completed video view - -```csharp -[Export ("rewardedVideoAdDidLoad:")] -public void RewardedVideoAdDidLoad (RewardedVideoAd rewardedVideoAd) -{ - Console.WriteLine ("Video ad is loaded and ready to be displayed"); -} - -[Export ("rewardedVideoAd:didFailWithError:")] -public void RewardedVideoAdDidFail (RewardedVideoAd rewardedVideoAd, NSError error) -{ - Console.WriteLine ($"Rewarded video ad failed to load: {error.LocalizedDescription}"); -} - -[Export ("rewardedVideoAdDidClick:")] -public void RewardedVideoAdDidClick (RewardedVideoAd rewardedVideoAd) -{ - Console.WriteLine ("Video ad clicked"); -} - -[Export ("rewardedVideoAdComplete:")] -public void RewardedVideoAdComplete (RewardedVideoAd rewardedVideoAd) -{ - Console.WriteLine ("Rewarded Video ad complete - this is called after a full video view, before the ad end card is shown.You can use this event to initialize your reward"); -} - -[Export ("rewardedVideoAdDidClose:")] -public void RewardedVideoAdDidClose (RewardedVideoAd rewardedVideoAd) -{ - Console.WriteLine ("Rewarded Video ad closed - this can be triggered by closing the application, or closing the video end card"); -} -``` - -Finally, when you are ready to show the rewarded video ad you can call the following code within your own reward function. - -```csharp -void ShowRewardedVideoAd () -{ - rewardedVideoAd.ShowAd (this); -} -``` - -The method to show a rewarded video ad includes an animated BOOLEAN flag which allows you to animate the presentation. By default it is set to `true`, but this can be overridden with the following. - -```csharp -rewardedVideoAd.ShowAd (this, false); -``` - -> ![information_icon] _When running ads in the simulator, change the setting to test mode to view test ads. Please go to [How to Use Test Mode][7] for more information._ - -Optionally, you can add the following additional functions to handle the cases where the rewarded video ad will close or when the rewarded video impression is being captured: - -```csharp -[Export ("rewardedVideoAdWillClose:")] -public void RewardedVideoAdWillClose (RewardedVideoAd rewardedVideoAd) -{ - Console.WriteLine ("The user clicked on the close button, the ad is just about to close"); -} - -[Export ("rewardedVideoAdWillLogImpression:")] -public void RewardedVideoAdWillLogImpression (RewardedVideoAd rewardedVideoAd) -{ - Console.WriteLine ("Rewarded Video impression is being captured"); -} -``` - -## Server Side Reward Validation - -### Overview - -If you manage your user rewards server-side, then Facebook offers a solution for carrying this out securely by using a validation technique. Our server will communicate with a specified endpoint to validate each ad impression and validate whether a reward should be granted. - -1. Audience Network SDK requests a rewarded video ad with the following parameters: - 1. Audience Network Placement ID - 2. Unique User ID - an attribute you use to identify a unique user. For example, a numeric identifier - 3. Reward Value - the value of the reward you would like to grant the user. For example, 100Coins specified end point, together with the [App Secret][12]. - -2. Upon receipt, the server validates the request and responds as follows: - 1. **200 response:** request is valid and the reward should be delivered - 2. **Non 200 response:** request is not valid, and the reward should not be delivered. - -3. Once the video is complete, the end card is presented and one of the following events will fire. - 1. onRewardServerSuccess - triggered only if a 200 response was received during step 3. - 2. onRewardServerFailed - triggered if a non 200 response was received during step 3. - -> ![information_icon] _An example of the URL which will hit your publisher end point, from Facebook's server._ -> -> https://www.your_end_point.com/?**token**=APP_SECRET&**puid**=USER_ID&**pc**=REWARD_ID&**ptid**=UNIQUE_TRANSACTION_ID - -> ![information_icon] Please provide your publisher end point to your Facebook representative in order to enable this feature. - - - -### SDK Implementation - -It is possible to set the Reward Data (`USER_ID` and `CURRENCY`) on initialization. This is demonstrated in the code snippet below: - -```csharp -void LoadRewardedVideoAd () -{ - //Set the rewarded ad data - rewardedVideoAd = new RewardedVideoAd ("Rewarded_Video_Placement_Id", "USER_ID", "CURRENCY") { Delegate = this }; - rewardedVideoAd.LoadAd (); -} -``` - -In addition to the functions noted above in the `IRewardedVideoAdDelegate`, the following events should be used to hande the granting of rewards in your app. The following can be used alongise the events monetioned above: - -```csharp -[Export ("rewardedVideoAdServerRewardDidSucceed:")] -void RewardedVideoAdServerRewardDidSuccess (RewardedVideoAd rewardedVideoAd) -{ - Console.WriteLine ("Rewarded video ad validated by server"); -} - -[Export ("rewardedVideoAdServerRewardDidFail:")] -void RewardedVideoAdServerRewardDidFail (RewardedVideoAd rewardedVideoAd) -{ - Console.WriteLine ("Rewarded video ad not validated, or no response from server"); -} -``` - -> ![information_icon] _Please note: the server validation callbacks will only occur after the end card has been dismissed by a user. You should not deallocate the rewarded video object until after one of these callbacks._ - ---- - -[1]: https://developers.facebook.com/docs/audience-network/getting-started -[2]: https://developers.facebook.com/docs/audience-network/guidelines/native-ads#native -[3]: https://developers.facebook.com/docs/audience-network/ios-layout-guideline -[4]: https://developers.facebook.com/docs/audience-network/ios-native#ui -[5]: https://developers.facebook.com/docs/audience-network/getting-started#placement_ids -[6]: https://developers.facebook.com/docs/audience-network/policy -[7]: https://developers.facebook.com/docs/audience-network/testing#testing-testAd -[8]: https://developers.facebook.com/docs/audience-network/ios/nativescroll -[9]: https://developers.facebook.com/docs/audience-network/guidelines/native-ads/ -[10]: https://developers.facebook.com/docs/audience-network/ios/instream-video#step2 -[11]: https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html -[12]: https://developers.facebook.com/docs/facebook-login/security#appsecret -[information_icon]: https://cdn1.iconfinder.com/data/icons/hawcons/32/699299-icon-29-information-20.png diff --git a/Facebook.iOS/docs/MarketingKit/Details.md b/Facebook.iOS/docs/MarketingKit/Details.md deleted file mode 100644 index 6c91dfb7..00000000 --- a/Facebook.iOS/docs/MarketingKit/Details.md +++ /dev/null @@ -1,111 +0,0 @@ -**(Requires iOS 7 or later.)** - -Integrate with Facebook for your iOS app. Build engaging social apps, enable easy login and get more installs: - -* **Share:** You can share, send a message, or like content in your app. Also, share Custom Stories with Open Graph. -* **Login:** You can sign in to your app with their Facebook Login. -* **App Events:** Understand people's actions in your app and measure the effectiveness of your Mobile App Ads. -* **Graph API:** Get data in and out of Facebook's social graph. Query data, post stories, upload photos and do other tasks. -* **App Links:** Link to a context in your app. - -### AppDelegate.cs - -```csharp - -using Facebook.CoreKit; -//... - -// Replace here you own Facebook App Id and App Name, if you don't have one go to -// https://developers.facebook.com/apps -string appId = "Your-Id-Here"; -string appName = "Your_App_Display_Name"; - -public override bool FinishedLaunching (UIApplication app, NSDictionary options) -{ - Settings.AppID = appId; - Settings.DisplayName = appName; - // ... - - // This method verifies if you have been logged into the app before, and keep you logged in after you reopen or kill your app. - return ApplicationDelegate.SharedInstance.FinishedLaunching (application, launchOptions); -} - -public override bool OpenUrl (UIApplication application, NSUrl url, string sourceApplication, NSObject annotation) -{ - // We need to handle URLs by passing them to their own OpenUrl in order to make the SSO authentication works. - return ApplicationDelegate.SharedInstance.OpenUrl (application, url, sourceApplication, annotation); -} - -``` - -### YourViewController.cs - -```csharp - -using Facebook.LoginKit; -using Facebook.CoreKit; -//... - -// To see the full list of permissions, visit the following link: -// https://developers.facebook.com/docs/facebook-login/permissions/v2.3 - -// This permission is set by default, even if you don't add it, but FB recommends to add it anyway -List readPermissions = new List { "public_profile" }; - -LoginButton loginView; -ProfilePictureView pictureView; - -public override void ViewDidLoad () -{ - base.ViewDidLoad (); - - loginButton = new LoginButton (new CGRect (48, 0, 218, 46)) { - LoginBehavior = LoginBehavior.Native, - ReadPermissions = readPermissions.ToArray () - }; - - // Handle actions once the user is logged in - loginView.Completed += (sender, e) => { - if (e.Error != null) { - // Handle if there was an error - } - - if (e.Result.IsCancelled) { - // Handle if the user cancelled the login request - } - - // Handle your successful login - }; - - // Handle actions once the user is logged out - loginView.LoggedOut += (sender, e) => { - // Handle your logout - }; - - // The user image profile is set automatically once is logged in - pictureView = new ProfilePictureView (new CGRect (50, 50, 220, 220)); - - // Add views to main view - View.AddSubview (loginView); - View.AddSubview (pictureView); -} - -``` - -### Info.plist - -In you Info.plist file of your project, go to the `Advanced` tab and add a `URL Type`. On the `URL Schemes` input write `fbYour-Id-Here`, replacing `Your-Id-Here` with your app Id. - -### Controlling the login dialogs - -The Facebook SDK automatically selects the optimal login dialog flow based on the account settings and capabilities of a person's device. - -If you want to use your System Account of Settings, just change the FB Login's behavior: - -```csharp - -loginView.LoginBehavior = LoginBehavior.SystemAccount; - -``` - -*Screenshot generated with [PlaceIt](http://placeit.breezi.com/).* \ No newline at end of file diff --git a/Facebook.iOS/docs/MarketingKit/GettingStarted.md b/Facebook.iOS/docs/MarketingKit/GettingStarted.md deleted file mode 100644 index 584ac292..00000000 --- a/Facebook.iOS/docs/MarketingKit/GettingStarted.md +++ /dev/null @@ -1,217 +0,0 @@ -The Facebook SDK for iOS makes it easier and faster to develop Facebook integrated iOS apps. - -## Integration with iOS 9 - -### Whitelist Facebook Servers for Network Requests - -If you compile your app with iOS SDK 9.0, you will be affected by [App Transport Security][1]. Currently, you will need to whitelist Facebook domains in your app by adding the following to your application's Info.plist: - -``` -NSAppTransportSecurity - - NSExceptionDomains - - facebook.com - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - fbcdn.net - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - akamaihd.net - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - - -``` - -### Whitelist Facebook Apps - -If you use any of the Facebook dialogs (e.g., Login, Share, App Invites, etc.) that can perform an app switch to Facebook apps, you will need to update your application's plist to handle the changes to `CanOpenUrl` described in https://developer.apple.com/videos/wwdc/2015/?id=703 - -If you're recompiling with iOS SDK 9.0, add the following to your application's plist *if you're using a version of the SDK v4.5 or older*: - -``` -LSApplicationQueriesSchemes - - fbapi - fbapi20130214 - fbapi20130410 - fbapi20130702 - fbapi20131010 - fbapi20131219 - fbapi20140410 - fbapi20140116 - fbapi20150313 - fbapi20150629 - fbauth - fbauth2 - fb-messenger-api20140430 - -``` - -If you're using `Facebook.MessengerShareKit` from versions older than the v4.6 release, also add: - -``` -fb-messenger-platform-20150128 -fb-messenger-platform-20150218 -fb-messenger-platform-20150305 -``` - -If you're using v4.6.0 of the SDK, you only need to add: - -``` -LSApplicationQueriesSchemes - - fbapi - fb-messenger-api - fbauth2 - fbshareextension - -``` - -This will allow the Facebook SDK integration to properly identify installed Facebook apps to perform an app switch. If you are not recompiling with iOS SDK 9.0, your app is limited to 50 distinct schemes (calls to `CanOpenURL` afterwards return *false*). - -## Sample - -### AppDelegate.cs - -```csharp -using Facebook.CoreKit; -//... - -// Replace here you own Facebook App Id and App Name, if you don't have one go to -// https://developers.facebook.com/apps -string appId = "Your-Id-Here"; -string appName = "Your_App_Display_Name"; - -public override bool FinishedLaunching (UIApplication app, NSDictionary options) -{ - // This is false by default, - // If you set true, you can handle the user profile info once is logged into FB with the Profile.Notifications.ObserveDidChange notification, - // If you set false, you need to get the user Profile info by hand with a GraphRequest - Profile.EnableUpdatesOnAccessTokenChange (true); - Settings.AppID = appId; - Settings.DisplayName = appName; - //... - - // This method verifies if you have been logged into the app before, and keep you logged in after you reopen or kill your app. - return ApplicationDelegate.SharedInstance.FinishedLaunching (application, launchOptions); -} - -public override bool OpenUrl (UIApplication application, NSUrl url, string sourceApplication, NSObject annotation) -{ - // We need to handle URLs by passing them to their own OpenUrl in order to make the SSO authentication works. - return ApplicationDelegate.SharedInstance.OpenUrl (application, url, sourceApplication, annotation); -} - -``` - -### YourViewController.cs - -```csharp -using Facebook.LoginKit; -using Facebook.CoreKit; -//... - -// To see the full list of permissions, visit the following link: -// https://developers.facebook.com/docs/facebook-login/permissions/v2.3 - -// This permission is set by default, even if you don't add it, but FB recommends to add it anyway -List readPermissions = new List { "public_profile" }; - -LoginButton loginView; -ProfilePictureView pictureView; -UILabel nameLabel; - -public override void ViewDidLoad () -{ - base.ViewDidLoad (); - - // If was send true to Profile.EnableUpdatesOnAccessTokenChange method - // this notification will be called after the user is logged in and - // after the AccessToken is gotten - Profile.Notifications.ObserveDidChange ((sender, e) => { - - if (e.NewProfile == null) - return; - - nameLabel.Text = e.NewProfile.Name; - }); - - // Set the Read and Publish permissions you want to get - loginView = new LoginButton (new CGRect (51, 0, 218, 46)) { - LoginBehavior = LoginBehavior.Native, - ReadPermissions = readPermissions.ToArray () - }; - - // Handle actions once the user is logged in - loginView.Completed += (sender, e) => { - if (e.Error != null) { - // Handle if there was an error - } - - if (e.Result.IsCancelled) { - // Handle if the user cancelled the login request - } - - // Handle your successful login - }; - - // Handle actions once the user is logged out - loginView.LoggedOut += (sender, e) => { - // Handle your logout - }; - - // The user image profile is set automatically once is logged in - pictureView = new ProfilePictureView (new CGRect (50, 50, 220, 220)); - - // Create the label that will hold user's facebook name - nameLabel = new UILabel (new RectangleF (20, 319, 280, 21)) { - TextAlignment = UITextAlignment.Center, - BackgroundColor = UIColor.Clear - }; - - // Add views to main view - View.AddSubview (loginView); - View.AddSubview (pictureView); - View.AddSubview (nameLabel); -} - -``` - -### Info.plist - -In you Info.plist file of your project, go to the `Advanced` tab and add a `URL Type`. On the `URL Schemes` input write `fbYour-Id-Here`, replacing `Your-Id-Here` with your app Id. - -### Controlling the login dialogs - -The Facebook SDK automatically selects the optimal login dialog flow based on the account settings and capabilities of a person's device. - -If you want to use your System Account of Settings, just change the FB Login's behavior: - -```csharp - -loginView.LoginBehavior = LoginBehavior.SystemAccount; - -``` - -## Documentation - -* SDK Reference: [https://developers.facebook.com/docs/reference/ios/current/](https://developers.facebook.com/docs/reference/ios/current/) - -## Contact & Discuss - -* Bugs Tracker: [https://developers.facebook.com/bugs](https://developers.facebook.com/bugs) -* StackOverflow: [http://facebook.stackoverflow.com/questions/tagged/facebook-ios-sdk](http://facebook.stackoverflow.com/questions/tagged/facebook-ios-sdk) \ No newline at end of file diff --git a/Facebook.iOS/docs/MessengerShareKit/Details.md b/Facebook.iOS/docs/MessengerShareKit/Details.md deleted file mode 100644 index 6c91dfb7..00000000 --- a/Facebook.iOS/docs/MessengerShareKit/Details.md +++ /dev/null @@ -1,111 +0,0 @@ -**(Requires iOS 7 or later.)** - -Integrate with Facebook for your iOS app. Build engaging social apps, enable easy login and get more installs: - -* **Share:** You can share, send a message, or like content in your app. Also, share Custom Stories with Open Graph. -* **Login:** You can sign in to your app with their Facebook Login. -* **App Events:** Understand people's actions in your app and measure the effectiveness of your Mobile App Ads. -* **Graph API:** Get data in and out of Facebook's social graph. Query data, post stories, upload photos and do other tasks. -* **App Links:** Link to a context in your app. - -### AppDelegate.cs - -```csharp - -using Facebook.CoreKit; -//... - -// Replace here you own Facebook App Id and App Name, if you don't have one go to -// https://developers.facebook.com/apps -string appId = "Your-Id-Here"; -string appName = "Your_App_Display_Name"; - -public override bool FinishedLaunching (UIApplication app, NSDictionary options) -{ - Settings.AppID = appId; - Settings.DisplayName = appName; - // ... - - // This method verifies if you have been logged into the app before, and keep you logged in after you reopen or kill your app. - return ApplicationDelegate.SharedInstance.FinishedLaunching (application, launchOptions); -} - -public override bool OpenUrl (UIApplication application, NSUrl url, string sourceApplication, NSObject annotation) -{ - // We need to handle URLs by passing them to their own OpenUrl in order to make the SSO authentication works. - return ApplicationDelegate.SharedInstance.OpenUrl (application, url, sourceApplication, annotation); -} - -``` - -### YourViewController.cs - -```csharp - -using Facebook.LoginKit; -using Facebook.CoreKit; -//... - -// To see the full list of permissions, visit the following link: -// https://developers.facebook.com/docs/facebook-login/permissions/v2.3 - -// This permission is set by default, even if you don't add it, but FB recommends to add it anyway -List readPermissions = new List { "public_profile" }; - -LoginButton loginView; -ProfilePictureView pictureView; - -public override void ViewDidLoad () -{ - base.ViewDidLoad (); - - loginButton = new LoginButton (new CGRect (48, 0, 218, 46)) { - LoginBehavior = LoginBehavior.Native, - ReadPermissions = readPermissions.ToArray () - }; - - // Handle actions once the user is logged in - loginView.Completed += (sender, e) => { - if (e.Error != null) { - // Handle if there was an error - } - - if (e.Result.IsCancelled) { - // Handle if the user cancelled the login request - } - - // Handle your successful login - }; - - // Handle actions once the user is logged out - loginView.LoggedOut += (sender, e) => { - // Handle your logout - }; - - // The user image profile is set automatically once is logged in - pictureView = new ProfilePictureView (new CGRect (50, 50, 220, 220)); - - // Add views to main view - View.AddSubview (loginView); - View.AddSubview (pictureView); -} - -``` - -### Info.plist - -In you Info.plist file of your project, go to the `Advanced` tab and add a `URL Type`. On the `URL Schemes` input write `fbYour-Id-Here`, replacing `Your-Id-Here` with your app Id. - -### Controlling the login dialogs - -The Facebook SDK automatically selects the optimal login dialog flow based on the account settings and capabilities of a person's device. - -If you want to use your System Account of Settings, just change the FB Login's behavior: - -```csharp - -loginView.LoginBehavior = LoginBehavior.SystemAccount; - -``` - -*Screenshot generated with [PlaceIt](http://placeit.breezi.com/).* \ No newline at end of file diff --git a/Facebook.iOS/docs/MessengerShareKit/GettingStarted.md b/Facebook.iOS/docs/MessengerShareKit/GettingStarted.md deleted file mode 100644 index 584ac292..00000000 --- a/Facebook.iOS/docs/MessengerShareKit/GettingStarted.md +++ /dev/null @@ -1,217 +0,0 @@ -The Facebook SDK for iOS makes it easier and faster to develop Facebook integrated iOS apps. - -## Integration with iOS 9 - -### Whitelist Facebook Servers for Network Requests - -If you compile your app with iOS SDK 9.0, you will be affected by [App Transport Security][1]. Currently, you will need to whitelist Facebook domains in your app by adding the following to your application's Info.plist: - -``` -NSAppTransportSecurity - - NSExceptionDomains - - facebook.com - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - fbcdn.net - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - akamaihd.net - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - - -``` - -### Whitelist Facebook Apps - -If you use any of the Facebook dialogs (e.g., Login, Share, App Invites, etc.) that can perform an app switch to Facebook apps, you will need to update your application's plist to handle the changes to `CanOpenUrl` described in https://developer.apple.com/videos/wwdc/2015/?id=703 - -If you're recompiling with iOS SDK 9.0, add the following to your application's plist *if you're using a version of the SDK v4.5 or older*: - -``` -LSApplicationQueriesSchemes - - fbapi - fbapi20130214 - fbapi20130410 - fbapi20130702 - fbapi20131010 - fbapi20131219 - fbapi20140410 - fbapi20140116 - fbapi20150313 - fbapi20150629 - fbauth - fbauth2 - fb-messenger-api20140430 - -``` - -If you're using `Facebook.MessengerShareKit` from versions older than the v4.6 release, also add: - -``` -fb-messenger-platform-20150128 -fb-messenger-platform-20150218 -fb-messenger-platform-20150305 -``` - -If you're using v4.6.0 of the SDK, you only need to add: - -``` -LSApplicationQueriesSchemes - - fbapi - fb-messenger-api - fbauth2 - fbshareextension - -``` - -This will allow the Facebook SDK integration to properly identify installed Facebook apps to perform an app switch. If you are not recompiling with iOS SDK 9.0, your app is limited to 50 distinct schemes (calls to `CanOpenURL` afterwards return *false*). - -## Sample - -### AppDelegate.cs - -```csharp -using Facebook.CoreKit; -//... - -// Replace here you own Facebook App Id and App Name, if you don't have one go to -// https://developers.facebook.com/apps -string appId = "Your-Id-Here"; -string appName = "Your_App_Display_Name"; - -public override bool FinishedLaunching (UIApplication app, NSDictionary options) -{ - // This is false by default, - // If you set true, you can handle the user profile info once is logged into FB with the Profile.Notifications.ObserveDidChange notification, - // If you set false, you need to get the user Profile info by hand with a GraphRequest - Profile.EnableUpdatesOnAccessTokenChange (true); - Settings.AppID = appId; - Settings.DisplayName = appName; - //... - - // This method verifies if you have been logged into the app before, and keep you logged in after you reopen or kill your app. - return ApplicationDelegate.SharedInstance.FinishedLaunching (application, launchOptions); -} - -public override bool OpenUrl (UIApplication application, NSUrl url, string sourceApplication, NSObject annotation) -{ - // We need to handle URLs by passing them to their own OpenUrl in order to make the SSO authentication works. - return ApplicationDelegate.SharedInstance.OpenUrl (application, url, sourceApplication, annotation); -} - -``` - -### YourViewController.cs - -```csharp -using Facebook.LoginKit; -using Facebook.CoreKit; -//... - -// To see the full list of permissions, visit the following link: -// https://developers.facebook.com/docs/facebook-login/permissions/v2.3 - -// This permission is set by default, even if you don't add it, but FB recommends to add it anyway -List readPermissions = new List { "public_profile" }; - -LoginButton loginView; -ProfilePictureView pictureView; -UILabel nameLabel; - -public override void ViewDidLoad () -{ - base.ViewDidLoad (); - - // If was send true to Profile.EnableUpdatesOnAccessTokenChange method - // this notification will be called after the user is logged in and - // after the AccessToken is gotten - Profile.Notifications.ObserveDidChange ((sender, e) => { - - if (e.NewProfile == null) - return; - - nameLabel.Text = e.NewProfile.Name; - }); - - // Set the Read and Publish permissions you want to get - loginView = new LoginButton (new CGRect (51, 0, 218, 46)) { - LoginBehavior = LoginBehavior.Native, - ReadPermissions = readPermissions.ToArray () - }; - - // Handle actions once the user is logged in - loginView.Completed += (sender, e) => { - if (e.Error != null) { - // Handle if there was an error - } - - if (e.Result.IsCancelled) { - // Handle if the user cancelled the login request - } - - // Handle your successful login - }; - - // Handle actions once the user is logged out - loginView.LoggedOut += (sender, e) => { - // Handle your logout - }; - - // The user image profile is set automatically once is logged in - pictureView = new ProfilePictureView (new CGRect (50, 50, 220, 220)); - - // Create the label that will hold user's facebook name - nameLabel = new UILabel (new RectangleF (20, 319, 280, 21)) { - TextAlignment = UITextAlignment.Center, - BackgroundColor = UIColor.Clear - }; - - // Add views to main view - View.AddSubview (loginView); - View.AddSubview (pictureView); - View.AddSubview (nameLabel); -} - -``` - -### Info.plist - -In you Info.plist file of your project, go to the `Advanced` tab and add a `URL Type`. On the `URL Schemes` input write `fbYour-Id-Here`, replacing `Your-Id-Here` with your app Id. - -### Controlling the login dialogs - -The Facebook SDK automatically selects the optimal login dialog flow based on the account settings and capabilities of a person's device. - -If you want to use your System Account of Settings, just change the FB Login's behavior: - -```csharp - -loginView.LoginBehavior = LoginBehavior.SystemAccount; - -``` - -## Documentation - -* SDK Reference: [https://developers.facebook.com/docs/reference/ios/current/](https://developers.facebook.com/docs/reference/ios/current/) - -## Contact & Discuss - -* Bugs Tracker: [https://developers.facebook.com/bugs](https://developers.facebook.com/bugs) -* StackOverflow: [http://facebook.stackoverflow.com/questions/tagged/facebook-ios-sdk](http://facebook.stackoverflow.com/questions/tagged/facebook-ios-sdk) \ No newline at end of file diff --git a/Facebook.iOS/docs/Notifications/Details.md b/Facebook.iOS/docs/Notifications/Details.md deleted file mode 100644 index 6c91dfb7..00000000 --- a/Facebook.iOS/docs/Notifications/Details.md +++ /dev/null @@ -1,111 +0,0 @@ -**(Requires iOS 7 or later.)** - -Integrate with Facebook for your iOS app. Build engaging social apps, enable easy login and get more installs: - -* **Share:** You can share, send a message, or like content in your app. Also, share Custom Stories with Open Graph. -* **Login:** You can sign in to your app with their Facebook Login. -* **App Events:** Understand people's actions in your app and measure the effectiveness of your Mobile App Ads. -* **Graph API:** Get data in and out of Facebook's social graph. Query data, post stories, upload photos and do other tasks. -* **App Links:** Link to a context in your app. - -### AppDelegate.cs - -```csharp - -using Facebook.CoreKit; -//... - -// Replace here you own Facebook App Id and App Name, if you don't have one go to -// https://developers.facebook.com/apps -string appId = "Your-Id-Here"; -string appName = "Your_App_Display_Name"; - -public override bool FinishedLaunching (UIApplication app, NSDictionary options) -{ - Settings.AppID = appId; - Settings.DisplayName = appName; - // ... - - // This method verifies if you have been logged into the app before, and keep you logged in after you reopen or kill your app. - return ApplicationDelegate.SharedInstance.FinishedLaunching (application, launchOptions); -} - -public override bool OpenUrl (UIApplication application, NSUrl url, string sourceApplication, NSObject annotation) -{ - // We need to handle URLs by passing them to their own OpenUrl in order to make the SSO authentication works. - return ApplicationDelegate.SharedInstance.OpenUrl (application, url, sourceApplication, annotation); -} - -``` - -### YourViewController.cs - -```csharp - -using Facebook.LoginKit; -using Facebook.CoreKit; -//... - -// To see the full list of permissions, visit the following link: -// https://developers.facebook.com/docs/facebook-login/permissions/v2.3 - -// This permission is set by default, even if you don't add it, but FB recommends to add it anyway -List readPermissions = new List { "public_profile" }; - -LoginButton loginView; -ProfilePictureView pictureView; - -public override void ViewDidLoad () -{ - base.ViewDidLoad (); - - loginButton = new LoginButton (new CGRect (48, 0, 218, 46)) { - LoginBehavior = LoginBehavior.Native, - ReadPermissions = readPermissions.ToArray () - }; - - // Handle actions once the user is logged in - loginView.Completed += (sender, e) => { - if (e.Error != null) { - // Handle if there was an error - } - - if (e.Result.IsCancelled) { - // Handle if the user cancelled the login request - } - - // Handle your successful login - }; - - // Handle actions once the user is logged out - loginView.LoggedOut += (sender, e) => { - // Handle your logout - }; - - // The user image profile is set automatically once is logged in - pictureView = new ProfilePictureView (new CGRect (50, 50, 220, 220)); - - // Add views to main view - View.AddSubview (loginView); - View.AddSubview (pictureView); -} - -``` - -### Info.plist - -In you Info.plist file of your project, go to the `Advanced` tab and add a `URL Type`. On the `URL Schemes` input write `fbYour-Id-Here`, replacing `Your-Id-Here` with your app Id. - -### Controlling the login dialogs - -The Facebook SDK automatically selects the optimal login dialog flow based on the account settings and capabilities of a person's device. - -If you want to use your System Account of Settings, just change the FB Login's behavior: - -```csharp - -loginView.LoginBehavior = LoginBehavior.SystemAccount; - -``` - -*Screenshot generated with [PlaceIt](http://placeit.breezi.com/).* \ No newline at end of file diff --git a/Facebook.iOS/docs/Notifications/GettingStarted.md b/Facebook.iOS/docs/Notifications/GettingStarted.md deleted file mode 100644 index 584ac292..00000000 --- a/Facebook.iOS/docs/Notifications/GettingStarted.md +++ /dev/null @@ -1,217 +0,0 @@ -The Facebook SDK for iOS makes it easier and faster to develop Facebook integrated iOS apps. - -## Integration with iOS 9 - -### Whitelist Facebook Servers for Network Requests - -If you compile your app with iOS SDK 9.0, you will be affected by [App Transport Security][1]. Currently, you will need to whitelist Facebook domains in your app by adding the following to your application's Info.plist: - -``` -NSAppTransportSecurity - - NSExceptionDomains - - facebook.com - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - fbcdn.net - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - akamaihd.net - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - - -``` - -### Whitelist Facebook Apps - -If you use any of the Facebook dialogs (e.g., Login, Share, App Invites, etc.) that can perform an app switch to Facebook apps, you will need to update your application's plist to handle the changes to `CanOpenUrl` described in https://developer.apple.com/videos/wwdc/2015/?id=703 - -If you're recompiling with iOS SDK 9.0, add the following to your application's plist *if you're using a version of the SDK v4.5 or older*: - -``` -LSApplicationQueriesSchemes - - fbapi - fbapi20130214 - fbapi20130410 - fbapi20130702 - fbapi20131010 - fbapi20131219 - fbapi20140410 - fbapi20140116 - fbapi20150313 - fbapi20150629 - fbauth - fbauth2 - fb-messenger-api20140430 - -``` - -If you're using `Facebook.MessengerShareKit` from versions older than the v4.6 release, also add: - -``` -fb-messenger-platform-20150128 -fb-messenger-platform-20150218 -fb-messenger-platform-20150305 -``` - -If you're using v4.6.0 of the SDK, you only need to add: - -``` -LSApplicationQueriesSchemes - - fbapi - fb-messenger-api - fbauth2 - fbshareextension - -``` - -This will allow the Facebook SDK integration to properly identify installed Facebook apps to perform an app switch. If you are not recompiling with iOS SDK 9.0, your app is limited to 50 distinct schemes (calls to `CanOpenURL` afterwards return *false*). - -## Sample - -### AppDelegate.cs - -```csharp -using Facebook.CoreKit; -//... - -// Replace here you own Facebook App Id and App Name, if you don't have one go to -// https://developers.facebook.com/apps -string appId = "Your-Id-Here"; -string appName = "Your_App_Display_Name"; - -public override bool FinishedLaunching (UIApplication app, NSDictionary options) -{ - // This is false by default, - // If you set true, you can handle the user profile info once is logged into FB with the Profile.Notifications.ObserveDidChange notification, - // If you set false, you need to get the user Profile info by hand with a GraphRequest - Profile.EnableUpdatesOnAccessTokenChange (true); - Settings.AppID = appId; - Settings.DisplayName = appName; - //... - - // This method verifies if you have been logged into the app before, and keep you logged in after you reopen or kill your app. - return ApplicationDelegate.SharedInstance.FinishedLaunching (application, launchOptions); -} - -public override bool OpenUrl (UIApplication application, NSUrl url, string sourceApplication, NSObject annotation) -{ - // We need to handle URLs by passing them to their own OpenUrl in order to make the SSO authentication works. - return ApplicationDelegate.SharedInstance.OpenUrl (application, url, sourceApplication, annotation); -} - -``` - -### YourViewController.cs - -```csharp -using Facebook.LoginKit; -using Facebook.CoreKit; -//... - -// To see the full list of permissions, visit the following link: -// https://developers.facebook.com/docs/facebook-login/permissions/v2.3 - -// This permission is set by default, even if you don't add it, but FB recommends to add it anyway -List readPermissions = new List { "public_profile" }; - -LoginButton loginView; -ProfilePictureView pictureView; -UILabel nameLabel; - -public override void ViewDidLoad () -{ - base.ViewDidLoad (); - - // If was send true to Profile.EnableUpdatesOnAccessTokenChange method - // this notification will be called after the user is logged in and - // after the AccessToken is gotten - Profile.Notifications.ObserveDidChange ((sender, e) => { - - if (e.NewProfile == null) - return; - - nameLabel.Text = e.NewProfile.Name; - }); - - // Set the Read and Publish permissions you want to get - loginView = new LoginButton (new CGRect (51, 0, 218, 46)) { - LoginBehavior = LoginBehavior.Native, - ReadPermissions = readPermissions.ToArray () - }; - - // Handle actions once the user is logged in - loginView.Completed += (sender, e) => { - if (e.Error != null) { - // Handle if there was an error - } - - if (e.Result.IsCancelled) { - // Handle if the user cancelled the login request - } - - // Handle your successful login - }; - - // Handle actions once the user is logged out - loginView.LoggedOut += (sender, e) => { - // Handle your logout - }; - - // The user image profile is set automatically once is logged in - pictureView = new ProfilePictureView (new CGRect (50, 50, 220, 220)); - - // Create the label that will hold user's facebook name - nameLabel = new UILabel (new RectangleF (20, 319, 280, 21)) { - TextAlignment = UITextAlignment.Center, - BackgroundColor = UIColor.Clear - }; - - // Add views to main view - View.AddSubview (loginView); - View.AddSubview (pictureView); - View.AddSubview (nameLabel); -} - -``` - -### Info.plist - -In you Info.plist file of your project, go to the `Advanced` tab and add a `URL Type`. On the `URL Schemes` input write `fbYour-Id-Here`, replacing `Your-Id-Here` with your app Id. - -### Controlling the login dialogs - -The Facebook SDK automatically selects the optimal login dialog flow based on the account settings and capabilities of a person's device. - -If you want to use your System Account of Settings, just change the FB Login's behavior: - -```csharp - -loginView.LoginBehavior = LoginBehavior.SystemAccount; - -``` - -## Documentation - -* SDK Reference: [https://developers.facebook.com/docs/reference/ios/current/](https://developers.facebook.com/docs/reference/ios/current/) - -## Contact & Discuss - -* Bugs Tracker: [https://developers.facebook.com/bugs](https://developers.facebook.com/bugs) -* StackOverflow: [http://facebook.stackoverflow.com/questions/tagged/facebook-ios-sdk](http://facebook.stackoverflow.com/questions/tagged/facebook-ios-sdk) \ No newline at end of file diff --git a/Facebook.iOS/docs/PlacesKit/Details.md b/Facebook.iOS/docs/PlacesKit/Details.md deleted file mode 100644 index 6c91dfb7..00000000 --- a/Facebook.iOS/docs/PlacesKit/Details.md +++ /dev/null @@ -1,111 +0,0 @@ -**(Requires iOS 7 or later.)** - -Integrate with Facebook for your iOS app. Build engaging social apps, enable easy login and get more installs: - -* **Share:** You can share, send a message, or like content in your app. Also, share Custom Stories with Open Graph. -* **Login:** You can sign in to your app with their Facebook Login. -* **App Events:** Understand people's actions in your app and measure the effectiveness of your Mobile App Ads. -* **Graph API:** Get data in and out of Facebook's social graph. Query data, post stories, upload photos and do other tasks. -* **App Links:** Link to a context in your app. - -### AppDelegate.cs - -```csharp - -using Facebook.CoreKit; -//... - -// Replace here you own Facebook App Id and App Name, if you don't have one go to -// https://developers.facebook.com/apps -string appId = "Your-Id-Here"; -string appName = "Your_App_Display_Name"; - -public override bool FinishedLaunching (UIApplication app, NSDictionary options) -{ - Settings.AppID = appId; - Settings.DisplayName = appName; - // ... - - // This method verifies if you have been logged into the app before, and keep you logged in after you reopen or kill your app. - return ApplicationDelegate.SharedInstance.FinishedLaunching (application, launchOptions); -} - -public override bool OpenUrl (UIApplication application, NSUrl url, string sourceApplication, NSObject annotation) -{ - // We need to handle URLs by passing them to their own OpenUrl in order to make the SSO authentication works. - return ApplicationDelegate.SharedInstance.OpenUrl (application, url, sourceApplication, annotation); -} - -``` - -### YourViewController.cs - -```csharp - -using Facebook.LoginKit; -using Facebook.CoreKit; -//... - -// To see the full list of permissions, visit the following link: -// https://developers.facebook.com/docs/facebook-login/permissions/v2.3 - -// This permission is set by default, even if you don't add it, but FB recommends to add it anyway -List readPermissions = new List { "public_profile" }; - -LoginButton loginView; -ProfilePictureView pictureView; - -public override void ViewDidLoad () -{ - base.ViewDidLoad (); - - loginButton = new LoginButton (new CGRect (48, 0, 218, 46)) { - LoginBehavior = LoginBehavior.Native, - ReadPermissions = readPermissions.ToArray () - }; - - // Handle actions once the user is logged in - loginView.Completed += (sender, e) => { - if (e.Error != null) { - // Handle if there was an error - } - - if (e.Result.IsCancelled) { - // Handle if the user cancelled the login request - } - - // Handle your successful login - }; - - // Handle actions once the user is logged out - loginView.LoggedOut += (sender, e) => { - // Handle your logout - }; - - // The user image profile is set automatically once is logged in - pictureView = new ProfilePictureView (new CGRect (50, 50, 220, 220)); - - // Add views to main view - View.AddSubview (loginView); - View.AddSubview (pictureView); -} - -``` - -### Info.plist - -In you Info.plist file of your project, go to the `Advanced` tab and add a `URL Type`. On the `URL Schemes` input write `fbYour-Id-Here`, replacing `Your-Id-Here` with your app Id. - -### Controlling the login dialogs - -The Facebook SDK automatically selects the optimal login dialog flow based on the account settings and capabilities of a person's device. - -If you want to use your System Account of Settings, just change the FB Login's behavior: - -```csharp - -loginView.LoginBehavior = LoginBehavior.SystemAccount; - -``` - -*Screenshot generated with [PlaceIt](http://placeit.breezi.com/).* \ No newline at end of file diff --git a/Facebook.iOS/docs/PlacesKit/GettingStarted.md b/Facebook.iOS/docs/PlacesKit/GettingStarted.md deleted file mode 100644 index 584ac292..00000000 --- a/Facebook.iOS/docs/PlacesKit/GettingStarted.md +++ /dev/null @@ -1,217 +0,0 @@ -The Facebook SDK for iOS makes it easier and faster to develop Facebook integrated iOS apps. - -## Integration with iOS 9 - -### Whitelist Facebook Servers for Network Requests - -If you compile your app with iOS SDK 9.0, you will be affected by [App Transport Security][1]. Currently, you will need to whitelist Facebook domains in your app by adding the following to your application's Info.plist: - -``` -NSAppTransportSecurity - - NSExceptionDomains - - facebook.com - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - fbcdn.net - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - akamaihd.net - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - - -``` - -### Whitelist Facebook Apps - -If you use any of the Facebook dialogs (e.g., Login, Share, App Invites, etc.) that can perform an app switch to Facebook apps, you will need to update your application's plist to handle the changes to `CanOpenUrl` described in https://developer.apple.com/videos/wwdc/2015/?id=703 - -If you're recompiling with iOS SDK 9.0, add the following to your application's plist *if you're using a version of the SDK v4.5 or older*: - -``` -LSApplicationQueriesSchemes - - fbapi - fbapi20130214 - fbapi20130410 - fbapi20130702 - fbapi20131010 - fbapi20131219 - fbapi20140410 - fbapi20140116 - fbapi20150313 - fbapi20150629 - fbauth - fbauth2 - fb-messenger-api20140430 - -``` - -If you're using `Facebook.MessengerShareKit` from versions older than the v4.6 release, also add: - -``` -fb-messenger-platform-20150128 -fb-messenger-platform-20150218 -fb-messenger-platform-20150305 -``` - -If you're using v4.6.0 of the SDK, you only need to add: - -``` -LSApplicationQueriesSchemes - - fbapi - fb-messenger-api - fbauth2 - fbshareextension - -``` - -This will allow the Facebook SDK integration to properly identify installed Facebook apps to perform an app switch. If you are not recompiling with iOS SDK 9.0, your app is limited to 50 distinct schemes (calls to `CanOpenURL` afterwards return *false*). - -## Sample - -### AppDelegate.cs - -```csharp -using Facebook.CoreKit; -//... - -// Replace here you own Facebook App Id and App Name, if you don't have one go to -// https://developers.facebook.com/apps -string appId = "Your-Id-Here"; -string appName = "Your_App_Display_Name"; - -public override bool FinishedLaunching (UIApplication app, NSDictionary options) -{ - // This is false by default, - // If you set true, you can handle the user profile info once is logged into FB with the Profile.Notifications.ObserveDidChange notification, - // If you set false, you need to get the user Profile info by hand with a GraphRequest - Profile.EnableUpdatesOnAccessTokenChange (true); - Settings.AppID = appId; - Settings.DisplayName = appName; - //... - - // This method verifies if you have been logged into the app before, and keep you logged in after you reopen or kill your app. - return ApplicationDelegate.SharedInstance.FinishedLaunching (application, launchOptions); -} - -public override bool OpenUrl (UIApplication application, NSUrl url, string sourceApplication, NSObject annotation) -{ - // We need to handle URLs by passing them to their own OpenUrl in order to make the SSO authentication works. - return ApplicationDelegate.SharedInstance.OpenUrl (application, url, sourceApplication, annotation); -} - -``` - -### YourViewController.cs - -```csharp -using Facebook.LoginKit; -using Facebook.CoreKit; -//... - -// To see the full list of permissions, visit the following link: -// https://developers.facebook.com/docs/facebook-login/permissions/v2.3 - -// This permission is set by default, even if you don't add it, but FB recommends to add it anyway -List readPermissions = new List { "public_profile" }; - -LoginButton loginView; -ProfilePictureView pictureView; -UILabel nameLabel; - -public override void ViewDidLoad () -{ - base.ViewDidLoad (); - - // If was send true to Profile.EnableUpdatesOnAccessTokenChange method - // this notification will be called after the user is logged in and - // after the AccessToken is gotten - Profile.Notifications.ObserveDidChange ((sender, e) => { - - if (e.NewProfile == null) - return; - - nameLabel.Text = e.NewProfile.Name; - }); - - // Set the Read and Publish permissions you want to get - loginView = new LoginButton (new CGRect (51, 0, 218, 46)) { - LoginBehavior = LoginBehavior.Native, - ReadPermissions = readPermissions.ToArray () - }; - - // Handle actions once the user is logged in - loginView.Completed += (sender, e) => { - if (e.Error != null) { - // Handle if there was an error - } - - if (e.Result.IsCancelled) { - // Handle if the user cancelled the login request - } - - // Handle your successful login - }; - - // Handle actions once the user is logged out - loginView.LoggedOut += (sender, e) => { - // Handle your logout - }; - - // The user image profile is set automatically once is logged in - pictureView = new ProfilePictureView (new CGRect (50, 50, 220, 220)); - - // Create the label that will hold user's facebook name - nameLabel = new UILabel (new RectangleF (20, 319, 280, 21)) { - TextAlignment = UITextAlignment.Center, - BackgroundColor = UIColor.Clear - }; - - // Add views to main view - View.AddSubview (loginView); - View.AddSubview (pictureView); - View.AddSubview (nameLabel); -} - -``` - -### Info.plist - -In you Info.plist file of your project, go to the `Advanced` tab and add a `URL Type`. On the `URL Schemes` input write `fbYour-Id-Here`, replacing `Your-Id-Here` with your app Id. - -### Controlling the login dialogs - -The Facebook SDK automatically selects the optimal login dialog flow based on the account settings and capabilities of a person's device. - -If you want to use your System Account of Settings, just change the FB Login's behavior: - -```csharp - -loginView.LoginBehavior = LoginBehavior.SystemAccount; - -``` - -## Documentation - -* SDK Reference: [https://developers.facebook.com/docs/reference/ios/current/](https://developers.facebook.com/docs/reference/ios/current/) - -## Contact & Discuss - -* Bugs Tracker: [https://developers.facebook.com/bugs](https://developers.facebook.com/bugs) -* StackOverflow: [http://facebook.stackoverflow.com/questions/tagged/facebook-ios-sdk](http://facebook.stackoverflow.com/questions/tagged/facebook-ios-sdk) \ No newline at end of file diff --git a/Facebook.iOS/samples/FBAccountKitSample/AppDelegate.cs b/Facebook.iOS/samples/FBAccountKitSample/AppDelegate.cs deleted file mode 100644 index da06fc4b..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/AppDelegate.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Foundation; -using UIKit; - -namespace FBAccountKitSample -{ - // The UIApplicationDelegate for the application. This class is responsible for launching the - // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. - [Register("AppDelegate")] - public class AppDelegate : UIApplicationDelegate - { - // class-level declarations - - public override UIWindow Window - { - get; - set; - } - - public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) - { - // Override point for customization after application launch. - // If not required for your application you can safely delete this method - // create a new window instance based on the screen size - - return true; - } - - public override void OnResignActivation(UIApplication application) - { - // Invoked when the application is about to move from active to inactive state. - // This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) - // or when the user quits the application and it begins the transition to the background state. - // Games should use this method to pause the game. - } - - public override void DidEnterBackground(UIApplication application) - { - // Use this method to release shared resources, save user data, invalidate timers and store the application state. - // If your application supports background exection this method is called instead of WillTerminate when the user quits. - } - - public override void WillEnterForeground(UIApplication application) - { - // Called as part of the transiton from background to active state. - // Here you can undo many of the changes made on entering the background. - } - - public override void OnActivated(UIApplication application) - { - // Restart any tasks that were paused (or not yet started) while the application was inactive. - // If the application was previously in the background, optionally refresh the user interface. - } - - public override void WillTerminate(UIApplication application) - { - // Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground. - } - } -} diff --git a/Facebook.iOS/samples/FBAccountKitSample/Assets.xcassets/AppIcon.appiconset/Contents.json b/Facebook.iOS/samples/FBAccountKitSample/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 64d0e3dd..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,202 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - }, - { - "size" : "24x24", - "idiom" : "watch", - "scale" : "2x", - "role" : "notificationCenter", - "subtype" : "38mm" - }, - { - "size" : "27.5x27.5", - "idiom" : "watch", - "scale" : "2x", - "role" : "notificationCenter", - "subtype" : "42mm" - }, - { - "size" : "29x29", - "idiom" : "watch", - "role" : "companionSettings", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "watch", - "role" : "companionSettings", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "watch", - "scale" : "2x", - "role" : "appLauncher", - "subtype" : "38mm" - }, - { - "size" : "44x44", - "idiom" : "watch", - "scale" : "2x", - "role" : "longLook", - "subtype" : "42mm" - }, - { - "size" : "86x86", - "idiom" : "watch", - "scale" : "2x", - "role" : "quickLook", - "subtype" : "38mm" - }, - { - "size" : "98x98", - "idiom" : "watch", - "scale" : "2x", - "role" : "quickLook", - "subtype" : "42mm" - }, - { - "idiom" : "mac", - "size" : "16x16", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "16x16", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "32x32", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "32x32", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "128x128", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "128x128", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "256x256", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "256x256", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "512x512", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "512x512", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/Facebook.iOS/samples/FBAccountKitSample/Assets.xcassets/Contents.json b/Facebook.iOS/samples/FBAccountKitSample/Assets.xcassets/Contents.json deleted file mode 100644 index 4caf392f..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Facebook.iOS/samples/FBAccountKitSample/AuthenticatedController.cs b/Facebook.iOS/samples/FBAccountKitSample/AuthenticatedController.cs deleted file mode 100644 index 5d31fb8b..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/AuthenticatedController.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; - -using UIKit; - -using Facebook.AccountKit; -using Foundation; - -namespace FBAccountKitSample { - public partial class AuthenticatedController : UIViewController, IViewControllerDelegate { - private AccountKit accountKit; - - public AuthenticatedController (IntPtr handle) : base (handle) - { - } - - public override void ViewDidLoad () - { - base.ViewDidLoad (); - // Perform any additional setup after loading the view, typically from a nib. - - } - - public override void ViewWillAppear (bool animated) - { - base.ViewWillAppear (animated); - if (accountKit == null) { - accountKit = new AccountKit (ResponseType.AccessToken); - } - - RequestAccountHandler handler = AccountHandlerDelegate; - - accountKit.RequestAccount (handler); - } - - public override void DidReceiveMemoryWarning () - { - base.DidReceiveMemoryWarning (); - // Release any cached data, images, etc that aren't in use. - } - - public void AccountHandlerDelegate (IAccount account, NSError error) - { - if (error != null) { - var errorAlertController = UIAlertController.Create ("Account Kit Alert", "Facebook Account Kit Login Flow Errored", UIAlertControllerStyle.Alert); - - errorAlertController.AddAction (UIAlertAction.Create ("OK", UIAlertActionStyle.Default, null)); - - PresentViewController (errorAlertController, true, null); - } else { - var accountIdAlertController = UIAlertController.Create ("Account Kit Alert", $"Account Id: {account.AccountId}", UIAlertControllerStyle.Alert); - - accountIdAlertController.AddAction (UIAlertAction.Create ("OK", UIAlertActionStyle.Default, null)); - - PresentViewController (accountIdAlertController, true, null); - - Email.Text = account.EmailAddress ?? string.Empty; - PhoneNumber.Text = account.PhoneNumber.PhoneNumberString ?? string.Empty; - } - } - - partial void Logout_TouchUpInside (UIButton sender) - { - accountKit?.LogOut (); - NavigationController.PopViewController (true); - } - } -} diff --git a/Facebook.iOS/samples/FBAccountKitSample/AuthenticatedController.designer.cs b/Facebook.iOS/samples/FBAccountKitSample/AuthenticatedController.designer.cs deleted file mode 100644 index 350f283e..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/AuthenticatedController.designer.cs +++ /dev/null @@ -1,51 +0,0 @@ -// WARNING -// -// This file has been generated automatically by Visual Studio from the outlets and -// actions declared in your storyboard file. -// Manual changes to this file will not be maintained. -// -using Foundation; -using System; -using System.CodeDom.Compiler; -using UIKit; - -namespace FBAccountKitSample -{ - [Register ("AuthenticatedController")] - partial class AuthenticatedController - { - [Outlet] - [GeneratedCode ("iOS Designer", "1.0")] - UIKit.UILabel Email { get; set; } - - [Outlet] - [GeneratedCode ("iOS Designer", "1.0")] - UIKit.UIButton Logout { get; set; } - - [Outlet] - [GeneratedCode ("iOS Designer", "1.0")] - UIKit.UILabel PhoneNumber { get; set; } - - [Action ("Logout_TouchUpInside:")] - [GeneratedCode ("iOS Designer", "1.0")] - partial void Logout_TouchUpInside (UIKit.UIButton sender); - - void ReleaseDesignerOutlets () - { - if (Email != null) { - Email.Dispose (); - Email = null; - } - - if (Logout != null) { - Logout.Dispose (); - Logout = null; - } - - if (PhoneNumber != null) { - PhoneNumber.Dispose (); - PhoneNumber = null; - } - } - } -} \ No newline at end of file diff --git a/Facebook.iOS/samples/FBAccountKitSample/AuthenticatedController.xib b/Facebook.iOS/samples/FBAccountKitSample/AuthenticatedController.xib deleted file mode 100644 index 9bd3ab8e..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/AuthenticatedController.xib +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/Facebook.iOS/samples/FBAccountKitSample/Entitlements.plist b/Facebook.iOS/samples/FBAccountKitSample/Entitlements.plist deleted file mode 100644 index 9ae59937..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/Entitlements.plist +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Facebook.iOS/samples/FBAccountKitSample/FBAccountKitSample.csproj b/Facebook.iOS/samples/FBAccountKitSample/FBAccountKitSample.csproj deleted file mode 100644 index d905bade..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/FBAccountKitSample.csproj +++ /dev/null @@ -1,139 +0,0 @@ - - - - Debug - iPhoneSimulator - {137D749C-2729-4D43-A573-314911D6ED14} - {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Exe - FBAccountKitSample - FBAccountKitSample - Resources - - - true - full - false - bin\iPhoneSimulator\Debug - DEBUG;ENABLE_TEST_CLOUD; - prompt - 4 - iPhone Developer - true - 46922 - None - i386, x86_64 - HttpClientHandler - false - - - - - true - - - pdbonly - true - bin\iPhone\Release - - - prompt - 4 - iPhone Developer - true - Entitlements.plist - SdkOnly - ARM64 - HttpClientHandler - - - - - - - pdbonly - true - bin\iPhoneSimulator\Release - - - prompt - 4 - iPhone Developer - true - None - x86_64 - HttpClientHandler - - - - - - - true - full - false - bin\iPhone\Debug - DEBUG;ENABLE_TEST_CLOUD; - prompt - 4 - iPhone Developer - true - Entitlements.plist - 56308 - SdkOnly - ARMv7, ARM64 - HttpClientHandler - - - - - false - - - - - - - - - - - - - false - - - false - - - - - - - - - - - - - - - - - - - ViewController.cs - - - - AuthenticatedController.cs - - - - - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF} - AccountKit - - - - \ No newline at end of file diff --git a/Facebook.iOS/samples/FBAccountKitSample/Info.plist b/Facebook.iOS/samples/FBAccountKitSample/Info.plist deleted file mode 100644 index 38e63bf0..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/Info.plist +++ /dev/null @@ -1,50 +0,0 @@ - - - - - CFBundleName - FBAccountKitSample - CFBundleIdentifier - com.companyname.FBAccountKitSample - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - MinimumOSVersion - 8.0 - UIDeviceFamily - - 1 - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - - XSAppIconAssets - Assets.xcassets/AppIcon.appiconset - FacebookAppID - {1234} - AccountKitClientToken - {account kit client token} - CFBundleURLTypes - - - CFBundleURLSchemes - - {ak1234} - - - - CFBundleShortVersionString - 4.31.0 - - diff --git a/Facebook.iOS/samples/FBAccountKitSample/LaunchScreen.storyboard b/Facebook.iOS/samples/FBAccountKitSample/LaunchScreen.storyboard deleted file mode 100644 index 5d2e905a..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Facebook.iOS/samples/FBAccountKitSample/Main.cs b/Facebook.iOS/samples/FBAccountKitSample/Main.cs deleted file mode 100644 index 7a90e146..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/Main.cs +++ /dev/null @@ -1,15 +0,0 @@ -using UIKit; - -namespace FBAccountKitSample -{ - public class Application - { - // This is the main entry point of the application. - static void Main(string[] args) - { - // if you want to use a different Application Delegate class from "AppDelegate" - // you can specify it here. - UIApplication.Main(args, null, "AppDelegate"); - } - } -} diff --git a/Facebook.iOS/samples/FBAccountKitSample/Main.storyboard b/Facebook.iOS/samples/FBAccountKitSample/Main.storyboard deleted file mode 100644 index 73b62b95..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/Main.storyboard +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Facebook.iOS/samples/FBAccountKitSample/ViewController.cs b/Facebook.iOS/samples/FBAccountKitSample/ViewController.cs deleted file mode 100644 index 298ff05c..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/ViewController.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Threading.Tasks; -using UIKit; - -using Facebook.AccountKit; -using Foundation; - -namespace FBAccountKitSample { - public partial class ViewController : UIViewController, IViewControllerDelegate { - public AccountKit accountKit; - public UIViewController pendingLoginViewController; - private TaskCompletionSource fbtcs; - - - public ViewController (IntPtr handle) : base (handle) - { - } - - public override void DidReceiveMemoryWarning () - { - base.DidReceiveMemoryWarning (); - - // Release any cached data, images, etc that aren't in use. - } - - public override void ViewDidLoad () - { - base.ViewDidLoad (); - - // Perform any additional setup after loading the view, typically from a nib. - if (accountKit == null) { - accountKit = new AccountKit (ResponseType.AccessToken); //Or use Code - } - - pendingLoginViewController = accountKit.GetViewControllerForLoginResume (); - fbtcs = new TaskCompletionSource (); - } - - public override void ViewWillAppear (bool animated) - { - base.ViewWillAppear (animated); - if (accountKit.CurrentAccessToken != null) { - PerformSegue ("AuthenticatedSegue", null); - } - if (pendingLoginViewController != null) { - PrepareLoginViewController (pendingLoginViewController.AsIViewControllerProtocol ()); - UIWindow w = UIApplication.SharedApplication.KeyWindow; - w.RootViewController.PresentViewController (pendingLoginViewController, true, null); - pendingLoginViewController = null; - } - } - - partial void LoginWithEmail_TouchUpInside (UIButton sender) - { - UIViewController loginWithEmailViewController = accountKit.GetViewControllerForEmailLogin (); - PrepareLoginViewController (loginWithEmailViewController.AsIViewControllerProtocol ()); - - UIWindow w = UIApplication.SharedApplication.KeyWindow; - - w.RootViewController.PresentViewController (loginWithEmailViewController, true, null); - } - - partial void LoginWithPhone_TouchUpInside (UIButton sender) - { - UIViewController loginWithPhoneViewController = accountKit.GetViewControllerForPhoneLogin (); - PrepareLoginViewController (loginWithPhoneViewController.AsIViewControllerProtocol ()); - UIWindow w = UIApplication.SharedApplication.KeyWindow; - - w.RootViewController.PresentViewController (loginWithPhoneViewController, true, null); - } - - [Export ("viewControllerDidCancel:")] - public void DidCancel (UIViewController viewController) - { - var CanceledAlertController = UIAlertController.Create ("Account Kit Alert", "Facebook Account Kit Login Flow Canceled", UIAlertControllerStyle.Alert); - - CanceledAlertController.AddAction (UIAlertAction.Create ("OK", UIAlertActionStyle.Default, null)); - - PresentViewController (CanceledAlertController, true, null); - fbtcs.TrySetException (new Exception ("Facebook Account Kit Login Flow Canceled")); - } - - //For server side validation (code) - //[Export("viewController:didCompleteLoginWithAuthorizationCode:state:")] - //public void DidCompleteLogin(UIViewController viewController, string code, string state) - //{ - // Configure for code here - //} - - [Export ("viewController:didCompleteLoginWithAccessToken:state:")] - public void DidCompleteLogin (UIViewController viewController, IAccessToken accessToken, string state) - { - if (!string.IsNullOrEmpty (accessToken?.TokenString)) { - fbtcs.TrySetResult (accessToken.TokenString); - PerformSegue ("AuthenticatedSegue", null); - } else { - fbtcs.TrySetException (new Exception ("Facebook Account Kit Login Flow Failed")); - } - } - - [Export ("viewController:didFailWithError:")] - public void DidFail (UIViewController viewController, NSError error) - { - var errorAlertController = UIAlertController.Create ("Account Kit Alert", "Facebook Account Kit Login Flow Errored", UIAlertControllerStyle.Alert); - - errorAlertController.AddAction (UIAlertAction.Create ("OK", UIAlertActionStyle.Default, null)); - - PresentViewController (errorAlertController, true, null); - fbtcs.TrySetException (new Exception ("Facebook Account Kit Login Flow Errored")); - } - - - private void PrepareLoginViewController (IViewController controller) - { - var loginViewController = controller; - loginViewController.Delegate = this; - } - - } -} \ No newline at end of file diff --git a/Facebook.iOS/samples/FBAccountKitSample/ViewController.designer.cs b/Facebook.iOS/samples/FBAccountKitSample/ViewController.designer.cs deleted file mode 100644 index 08127c88..00000000 --- a/Facebook.iOS/samples/FBAccountKitSample/ViewController.designer.cs +++ /dev/null @@ -1,45 +0,0 @@ -// WARNING -// -// This file has been generated automatically by Visual Studio from the outlets and -// actions declared in your storyboard file. -// Manual changes to this file will not be maintained. -// -using Foundation; -using System; -using System.CodeDom.Compiler; - -namespace FBAccountKitSample -{ - [Register ("ViewController")] - partial class ViewController - { - [Outlet] - [GeneratedCode ("iOS Designer", "1.0")] - UIKit.UIButton LoginWithEmail { get; set; } - - [Outlet] - [GeneratedCode ("iOS Designer", "1.0")] - UIKit.UIButton LoginWithPhone { get; set; } - - [Action ("LoginWithEmail_TouchUpInside:")] - [GeneratedCode ("iOS Designer", "1.0")] - partial void LoginWithEmail_TouchUpInside (UIKit.UIButton sender); - - [Action ("LoginWithPhone_TouchUpInside:")] - [GeneratedCode ("iOS Designer", "1.0")] - partial void LoginWithPhone_TouchUpInside (UIKit.UIButton sender); - - void ReleaseDesignerOutlets () - { - if (LoginWithEmail != null) { - LoginWithEmail.Dispose (); - LoginWithEmail = null; - } - - if (LoginWithPhone != null) { - LoginWithPhone.Dispose (); - LoginWithPhone = null; - } - } - } -} \ No newline at end of file diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/AdPlacementIds.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/AdPlacementIds.cs deleted file mode 100644 index f2658cd4..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/AdPlacementIds.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -using Facebook.AudienceNetwork; - -namespace FBAudienceNetworkSample { - public static class AdPlacementIds { - public const string Banner = "Banner_Placement_Id"; - public const string Interstitial = "Interstitial_Placement_Id"; - public const string Native = "Interstitial_Placement_Id"; - public const string RewardedVideo = "Rewarded_Video_Placement_Id"; - - public static void AddTestDevices () - { - AdSettings.LogLevel = AdLogLevel.Log; - AdSettings.ClearTestDevices (); - AdSettings.AddTestDevice ("Hash_Device"); - } - } -} diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.cs deleted file mode 100644 index 577cabaf..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.cs +++ /dev/null @@ -1,334 +0,0 @@ -using System; - -using UIKit; -using Foundation; - -using Facebook.AudienceNetwork; -using CoreGraphics; -using System.Collections.Generic; -using ObjCRuntime; - -namespace FBAudienceNetworkSample -{ - public partial class AdsViewController : UIViewController, IUITableViewDataSource, IUITableViewDelegate, - INativeAdDelegate, IAdViewDelegate, IInterstitialAdDelegate, IRewardedVideoAdDelegate - { - #region Class Variables - - static object padlock = new object (); - - List customNativeAds; - NativeAd nativeAd; - NativeAd nativeAdTemplate; - AdView bannerAdView; - InterstitialAd interstitialAd; - RewardedVideoAd rewardedVideoAd; - - #endregion - - #region Constructors - - public AdsViewController (IntPtr handle) : base (handle) - { - } - - #endregion - - #region Controller Life Cycle - - public override void ViewDidLoad () - { - base.ViewDidLoad (); - // Perform any additional setup after loading the view, typically from a nib. - - customNativeAds = new List (); - } - - #endregion - - #region User Interactions - - partial void BtnShow_Click (NSObject sender) - { - var actionSheet = UIAlertController.Create (null, null, UIAlertControllerStyle.ActionSheet); - actionSheet.AddAction (UIAlertAction.Create ("Cancel", UIAlertActionStyle.Cancel, null)); - actionSheet.AddAction (UIAlertAction.Create ("Add Native ad to Table", UIAlertActionStyle.Default, AddNativeAd)); - actionSheet.AddAction (UIAlertAction.Create ("Add Native ad template to Table", UIAlertActionStyle.Default, AddNativeAdTemplate)); - actionSheet.AddAction (UIAlertAction.Create ("Show Banner ad", UIAlertActionStyle.Default, ShowBannerAd)); - actionSheet.AddAction (UIAlertAction.Create ("Show Interstitial ad", UIAlertActionStyle.Default, ShowInterstitialAd)); - actionSheet.AddAction (UIAlertAction.Create ("Show Rewarded Video Ad", UIAlertActionStyle.Default, ShowRewardedVideoAd)); - PresentViewController (actionSheet, true, null); - } - - void AddNativeAd (UIAlertAction obj) - { - nativeAd = new NativeAd (AdPlacementIds.Native) { Delegate = this }; - nativeAd.LoadAd (); - } - - void AddNativeAdTemplate (UIAlertAction obj) - { - nativeAdTemplate = new NativeAd (AdPlacementIds.Native) { Delegate = this }; - nativeAdTemplate.LoadAd (); - } - - void ShowBannerAd (UIAlertAction obj) - { - bannerAdView?.RemoveFromSuperview (); - bannerAdView?.Dispose (); - bannerAdView = null; - - bannerAdView = new AdView (AdPlacementIds.Banner, AdSizes.BannerHeight50, this) { Delegate = this }; - bannerAdView.Frame = new CGRect (0, 0, bannerAdView.Bounds.Width, bannerAdView.Bounds.Height); - bannerAdView.LoadAd (); - BannerView.AddSubview (bannerAdView); - } - - void ShowInterstitialAd (UIAlertAction obj) - { - interstitialAd?.Dispose (); - interstitialAd = null; - - interstitialAd = new InterstitialAd (AdPlacementIds.Interstitial) { Delegate = this }; - interstitialAd.LoadAd (); - } - - void ShowRewardedVideoAd (UIAlertAction obj) - { - rewardedVideoAd?.Dispose (); - rewardedVideoAd = null; - - rewardedVideoAd = new RewardedVideoAd (AdPlacementIds.RewardedVideo) { Delegate = this }; - rewardedVideoAd.LoadAd (); - } - - #endregion - - #region UITableView Data Source - - [Export ("numberOfSectionsInTableView:")] - public nint NumberOfSections (UITableView tableView) => 1; - public nint RowsInSection (UITableView tableView, nint section) => customNativeAds.Count; - - public UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) - { - var customNativeAd = customNativeAds [indexPath.Row]; - - if (customNativeAd.IsTemplate) { - var cell = tableView.DequeueReusableCell (NativeAdTemplateTableViewCell.Key, indexPath) as NativeAdTemplateTableViewCell; - var nativeAdView = NativeAdView.From (customNativeAd.NativeAd, NativeAdViewType.GenericHeight300); - nativeAdView.Frame = new CGRect (0, 0, cell.AdView.Frame.Width, 300); - cell.AdView.AddSubview (nativeAdView); - - return cell; - } else { - var cell = tableView.DequeueReusableCell (NativeAdTableViewCell.Key, indexPath) as NativeAdTableViewCell; - - customNativeAd.NativeAd.UnregisterView (); - - // Wire up UIView with the native ad; only call to action button and media view will be clickable. - customNativeAd.NativeAd.RegisterView (cell.AdView, cell.CoverMediaViewAd, cell.IconViewAd, this, new UIView [] { cell.CoverMediaViewAd, cell.AdCallToActionButton }); - - // Render native ads onto UIView - cell.AdTitle = customNativeAd.NativeAd.AdvertiserName; - cell.AdBody = customNativeAd.NativeAd.BodyText; - cell.AdSocialContext = customNativeAd.NativeAd.SocialContext; - cell.Sponsored = "Sponsored"; - cell.AdCallToActionButton.SetTitle (customNativeAd.NativeAd.CallToAction, UIControlState.Normal); - cell.ChoiceViewAd.NativeAd = customNativeAd.NativeAd; - cell.ChoiceViewAd.Corner = UIRectCorner.TopRight; - - return cell; - } - } - - #endregion - - #region UITableView Delegate - - [Export ("tableView:canEditRowAtIndexPath:")] - public bool CanEditRow (UITableView tableView, NSIndexPath indexPath) => true; - - [Export ("tableView:commitEditingStyle:forRowAtIndexPath:")] - public void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath) - { - switch (editingStyle) { - case UITableViewCellEditingStyle.Delete: - var customNativeAd = customNativeAds [indexPath.Row]; - customNativeAd.AdImage = null; - customNativeAd.NativeAd.Dispose (); - customNativeAd.NativeAd = null; - customNativeAds.RemoveAt (indexPath.Row); - tableView.DeleteRows (new [] { indexPath }, UITableViewRowAnimation.Automatic); - - break; - } - } - - #endregion - - #region Internal Functionality - - void InsertRow () - { - var newIndexPath = NSIndexPath.FromRowSection (customNativeAds.Count - 1, 0); - AdsTableView.InsertRows (new [] { newIndexPath }, UITableViewRowAnimation.Automatic); - AdsTableView.ScrollToRow (newIndexPath, UITableViewScrollPosition.Bottom, true); - } - - #endregion - - #region NativeAd Delegate - - [Export ("nativeAdDidLoad:")] - public void NativeAdDidLoad (NativeAd nativeAd) - { - CustomNativeAd customNativeAd; - lock (padlock) { - customNativeAd = new CustomNativeAd (nativeAd, nativeAdTemplate == nativeAd); - customNativeAds.Add (customNativeAd); - } - - InsertRow (); - - //if (!customNativeAd.IsTemplate) { - - // return; - //} - - //// Native Ad Template Logic - //var nativeAdView = NativeAdView.From (nativeAd, NativeAdViewType.GenericHeight300); - //customNativeAds.Add (nativeAdView); - - //// Register the native ad view and its view controller with the native ad instance - //nativeAd.RegisterView (nativeAdView, this); - - //var newIndexPath = NSIndexPath.FromRowSection (customNativeAds.Count - 1, 0); - //AdsTableView.InsertRows (new [] { newIndexPath }, UITableViewRowAnimation.Automatic); - //AdsTableView.ScrollToRow (newIndexPath, UITableViewScrollPosition.Bottom, true); - } - - [Export ("nativeAd:didFailWithError:")] - public void NativeAdDidFail (NativeAd nativeAd, NSError error) - { - Console.WriteLine ($"{nameof (NativeAdDidFail)} - Native ad failed to load with error: {error.LocalizedDescription}"); - AppDelegate.ShowMessage ("Native Ad Error", error.LocalizedDescription, NavigationController); - } - - [Export ("nativeAdDidClick:")] - public void NativeAdDidClick (NativeAd nativeAd) => - Console.WriteLine ($"{nameof (NativeAdDidClick)} - Native ad was clicked."); - - [Export ("nativeAdDidFinishHandlingClick:")] - public void NativeAdDidFinishHandlingClick (NativeAd nativeAd) => - Console.WriteLine ($"{nameof (NativeAdDidFinishHandlingClick)} - Native ad did finish click handling."); - - [Export ("nativeAdWillLogImpression:")] - public void NativeAdWillLogImpression (NativeAd nativeAd) => - Console.WriteLine ($"{nameof (NativeAdWillLogImpression)} - Native ad impression is being captured."); - - #endregion - - #region AdView Delegate - - [Export ("adViewDidLoad:")] - public void AdViewDidLoad (AdView adView) => - Console.WriteLine ($"{nameof (AdViewDidLoad)} - Ad was loaded and ready to be displayed"); - - [Export ("adView:didFailWithError:")] - public void AdViewDidFail (AdView adView, NSError error) - { - Console.WriteLine ($"{nameof (AdViewDidFail)} - Ad failed to load: {error.LocalizedDescription}"); - AppDelegate.ShowMessage ("Banner Ad Error", error.LocalizedDescription, NavigationController); - } - - [Export ("adViewDidClick:")] - public void AdViewDidClick (AdView adView) => - Console.WriteLine ($"{nameof (AdViewDidClick)} - Banner ad was clicked."); - - [Export ("adViewDidFinishHandlingClick:")] - public void AdViewDidFinishHandlingClick (AdView adView) => - Console.WriteLine ($"{nameof (AdViewDidFinishHandlingClick)} - Banner ad did finish click handling."); - - [Export ("adViewWillLogImpression:")] - public void AdViewWillLogImpression (AdView adView) => - Console.WriteLine ($"{nameof (AdViewWillLogImpression)} - Banner ad impression is being captured."); - - #endregion - - #region InterstitialAd Delegate - - [Export ("interstitialAdDidLoad:")] - public void InterstitialAdDidLoad (InterstitialAd interstitialAd) - { - Console.WriteLine ($"{nameof (InterstitialAdDidLoad)} - Ad is loaded and ready to be displayed"); - - // You can now display the full screen ad using this code: - interstitialAd.ShowAd (this); - } - - [Export ("interstitialAd:didFailWithError:")] - public void IntersitialDidFail (InterstitialAd interstitialAd, NSError error) - { - Console.WriteLine ($"{nameof (IntersitialDidFail)} - Ad failed to load: {error.LocalizedDescription}"); - AppDelegate.ShowMessage ("Interstitial Ad Error", error.LocalizedDescription, NavigationController); - } - - [Export ("interstitialAdWillLogImpression:")] - public void InterstitialAdWillLogImpression (InterstitialAd interstitialAd) => - Console.WriteLine ($"{nameof (InterstitialAdWillLogImpression)} - The user sees the add"); - - [Export ("interstitialAdDidClick:")] - public void InterstitialAdDidClick (InterstitialAd interstitialAd) => - Console.WriteLine ($"{nameof (InterstitialAdDidClick)} - The user clicked on the ad and will be taken to its destination"); - - [Export ("interstitialAdWillClose:")] - public void InterstitialAdWillClose (InterstitialAd interstitialAd) => - Console.WriteLine ($"{nameof (InterstitialAdWillClose)} - The user clicked on the close button, the ad is just about to close"); - - [Export ("interstitialAdDidClose:")] - public void InterstitialAdDidClose (InterstitialAd interstitialAd) => - Console.WriteLine ($"{nameof (InterstitialAdDidClose)} - Interstitial had been closed"); - - #endregion - - #region RewardedVideoAd Delegate - - [Export ("rewardedVideoAdDidLoad:")] - public void RewardedVideoAdDidLoad (RewardedVideoAd rewardedVideoAd) - { - Console.WriteLine ($"{nameof (RewardedVideoAdDidLoad)} - Video ad is loaded and ready to be displayed"); - - rewardedVideoAd.ShowAd (this); - } - - [Export ("rewardedVideoAd:didFailWithError:")] - public void RewardedVideoAdDidFail (RewardedVideoAd rewardedVideoAd, NSError error) - { - Console.WriteLine ($"{nameof (RewardedVideoAdDidFail)} - Rewarded video ad failed to load: {error.LocalizedDescription}"); - AppDelegate.ShowMessage ("Banner Ad Error", error.LocalizedDescription, NavigationController); - } - - [Export ("rewardedVideoAdDidClick:")] - public void RewardedVideoAdDidClick (RewardedVideoAd rewardedVideoAd) => - Console.WriteLine ($"{nameof (RewardedVideoAdDidClick)} - Video ad clicked"); - - [Export ("rewardedVideoAdComplete:")] - public void RewardedVideoAdComplete (RewardedVideoAd rewardedVideoAd) => - Console.WriteLine ($"{nameof (RewardedVideoAdComplete)} - Rewarded Video ad complete - this is called after a full video view, before the ad end card is shown.You can use this event to initialize your reward"); - - [Export ("rewardedVideoAdDidClose:")] - public void RewardedVideoAdDidClose (RewardedVideoAd rewardedVideoAd) => - Console.WriteLine ($"{nameof (RewardedVideoAdDidClose)} - Rewarded Video ad closed - this can be triggered by closing the application, or closing the video end card"); - - [Export ("rewardedVideoAdWillClose:")] - public void RewardedVideoAdWillClose (RewardedVideoAd rewardedVideoAd) => - Console.WriteLine ($"{nameof (RewardedVideoAdWillClose)} - The user clicked on the close button, the ad is just about to close"); - - [Export ("rewardedVideoAdWillLogImpression:")] - public void RewardedVideoAdWillLogImpression (RewardedVideoAd rewardedVideoAd) => - Console.WriteLine ($"{nameof (RewardedVideoAdWillLogImpression)} - Rewarded Video impression is being captured"); - - #endregion - } -} diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.designer.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.designer.cs deleted file mode 100644 index 818a3e52..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.designer.cs +++ /dev/null @@ -1,40 +0,0 @@ -// WARNING -// -// This file has been generated automatically by Visual Studio from the outlets and -// actions declared in your storyboard file. -// Manual changes to this file will not be maintained. -// -using Foundation; -using System; -using System.CodeDom.Compiler; - -namespace FBAudienceNetworkSample -{ - [Register ("AdsViewController")] - partial class AdsViewController - { - [Outlet] - UIKit.UITableView AdsTableView { get; set; } - - - [Outlet] - UIKit.UIView BannerView { get; set; } - - - [Action ("BtnShow_Click:")] - partial void BtnShow_Click (Foundation.NSObject sender); - - void ReleaseDesignerOutlets () - { - if (AdsTableView != null) { - AdsTableView.Dispose (); - AdsTableView = null; - } - - if (BannerView != null) { - BannerView.Dispose (); - BannerView = null; - } - } - } -} \ No newline at end of file diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/AppDelegate.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/AppDelegate.cs deleted file mode 100644 index c89e6d6a..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/AppDelegate.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using Foundation; -using UIKit; - -using Facebook.AudienceNetwork; - -namespace FBAudienceNetworkSample -{ - // The UIApplicationDelegate for the application. This class is responsible for launching the - // User Interface of the application, as well as listening (and optionally responding) to - // application events from iOS. - [Register ("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { - // class-level declarations - - public override UIWindow Window { - get; - set; - } - - public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) - { - UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent; - - AdPlacementIds.AddTestDevices (); - - return true; - } - - public static void ShowMessage (string title, string message, UIViewController fromViewController) - { - var alertController = UIAlertController.Create (title, message, UIAlertControllerStyle.Alert); - alertController.AddAction (UIAlertAction.Create ("Ok", UIAlertActionStyle.Cancel, null)); - fromViewController.PresentViewController (alertController, true, null); - } - } -} - diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/Assets.xcassets/LaunchImage.launchimage/Contents.json b/Facebook.iOS/samples/FBAudienceNetworkSample/Assets.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index ab0ab490..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/Assets.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "images": [ - { - "orientation": "portrait", - "idiom": "iphone", - "extent": "full-screen", - "filename": "Default-568h@2x.png", - "size": "320x568", - "subtype": "retina4", - "scale": "2x" - } - ], - "info": { - "version": 1, - "author": "xcode" - } -} \ No newline at end of file diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/CustomNativeAd.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/CustomNativeAd.cs deleted file mode 100644 index f8c4e2ff..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/CustomNativeAd.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -using UIKit; - -using Facebook.AudienceNetwork; - -namespace FBAudienceNetworkSample { - public class CustomNativeAd { - public NativeAd NativeAd { get; set; } - public bool IsTemplate { get; set; } - public UIImage AdImage { get; set; } - - public CustomNativeAd (NativeAd nativeAd, bool isTemplate) - { - NativeAd = nativeAd; - IsTemplate = isTemplate; - } - } -} diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/Entitlements.plist b/Facebook.iOS/samples/FBAudienceNetworkSample/Entitlements.plist deleted file mode 100644 index 9ae59937..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/Entitlements.plist +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/FBAudienceNetworkSample.csproj b/Facebook.iOS/samples/FBAudienceNetworkSample/FBAudienceNetworkSample.csproj deleted file mode 100644 index bb75a534..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/FBAudienceNetworkSample.csproj +++ /dev/null @@ -1,144 +0,0 @@ - - - - Debug - iPhoneSimulator - {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E} - Exe - FBAudienceNetworkSample - Resources - FBAudienceNetworkSample - obj\$(Platform)\$(Configuration) - - - true - full - false - bin\iPhoneSimulator\Debug - DEBUG; - prompt - 4 - false - None - Entitlements.plist - true - - - i386, x86_64 - true - - - full - true - bin\iPhoneSimulator\Release - prompt - 4 - None - false - Entitlements.plist - - - i386, x86_64 - - - true - full - false - bin\iPhone\Debug - DEBUG; - prompt - 4 - false - Entitlements.plist - true - iPhone Developer - - - - - ARMv7, ARM64 - true - - - full - true - bin\iPhone\Release - prompt - 4 - Entitlements.plist - false - iPhone Developer - - - ARMv7, ARM64 - - SdkOnly - - - full - true - bin\iPhone\Ad-Hoc - prompt - 4 - false - Entitlements.plist - true - Automatic:AdHoc - iPhone Distribution - - - full - true - bin\iPhone\AppStore - prompt - 4 - iPhone Distribution - Entitlements.plist - false - Automatic:AppStore - - - - - - - - - - - - - - - - - AdsViewController.cs - - - - NativeAdTemplateTableViewCell.cs - - - - NativeAdTableViewCell.cs - - - - - - - - - - - - - - - - {54FF3FE1-B984-4642-8131-16A4E8335A0D} - AudienceNetwork - - - diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/Info.plist b/Facebook.iOS/samples/FBAudienceNetworkSample/Info.plist deleted file mode 100644 index a750160b..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/Info.plist +++ /dev/null @@ -1,67 +0,0 @@ - - - - - CFBundleDisplayName - FBAudienceNetworkSample - CFBundleIdentifier - com.xamarin.FBAudienceNetworkSample - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - MinimumOSVersion - 9.0 - UIDeviceFamily - - 1 - - UIMainStoryboardFile - MainStoryboard - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - NSAppTransportSecurity - - NSExceptionDomains - - facebook.com - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - fbcdn.net - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - akamaihd.net - - NSIncludesSubdomains - - NSThirdPartyExceptionRequiresForwardSecrecy - - - - - CFBundleName - FBAudienceNetworkSample - UILaunchStoryboardName - LaunchScreen - XSLaunchImageAssets - Assets.xcassets/LaunchImage.launchimage - UIViewControllerBasedStatusBarAppearance - - - diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/LaunchScreen.storyboard b/Facebook.iOS/samples/FBAudienceNetworkSample/LaunchScreen.storyboard deleted file mode 100644 index 7981a14b..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/Main.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/Main.cs deleted file mode 100644 index ecadc558..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/Main.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -#if __UNIFIED__ -using Foundation; -using UIKit; - -#else -using MonoTouch.Foundation; -using MonoTouch.UIKit; -#endif - -namespace FBAudienceNetworkSample -{ - public class Application - { - // This is the main entry point of the application. - static void Main (string[] args) - { - // if you want to use a different Application Delegate class from "AppDelegate" - // you can specify it here. - UIApplication.Main (args, null, "AppDelegate"); - } - } -} \ No newline at end of file diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/MainStoryboard.storyboard b/Facebook.iOS/samples/FBAudienceNetworkSample/MainStoryboard.storyboard deleted file mode 100644 index c87f1ff2..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/MainStoryboard.storyboard +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.cs deleted file mode 100644 index bc17cc8a..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; - -using Foundation; -using UIKit; - -using Facebook.AudienceNetwork; - -namespace FBAudienceNetworkSample -{ - public partial class NativeAdTableViewCell : UITableViewCell - { - public static readonly NSString Key = new NSString (nameof (NativeAdTableViewCell)); - - public UIView AdView { get => View; } - public MediaView CoverMediaViewAd { get => AdCoverMediaView; } - public AdChoicesView ChoiceViewAd { get => AdChoiceView; } - public UIButton AdCallToActionButton { get => BtnAdCallToAction; } - public AdIconView IconViewAd { get => AdIconView; } - public string AdTitle { - get => LblAdTitle.Text; - set => LblAdTitle.Text = value; - } - public string Sponsored { - get => LblSponsored.Text; - set => LblSponsored.Text = value; - } - public string AdSocialContext { - get => LblAdSocialContext.Text; - set => LblAdSocialContext.Text = value; - } - public string AdBody { - get => LblAdBody.Text; - set => LblAdBody.Text = value; - } - - protected NativeAdTableViewCell (IntPtr handle) : base (handle) - { - // Note: this .ctor should not contain any initialization logic. - } - } -} diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.designer.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.designer.cs deleted file mode 100644 index 3c7c7687..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.designer.cs +++ /dev/null @@ -1,100 +0,0 @@ -// WARNING -// -// This file has been generated automatically by Visual Studio to store outlets and -// actions made in the UI designer. If it is removed, they will be lost. -// Manual changes to this file may not be handled correctly. -// -using Foundation; -using System.CodeDom.Compiler; - -namespace FBAudienceNetworkSample -{ - [Register ("NativeAdTableViewCell")] - partial class NativeAdTableViewCell - { - [Outlet] - Facebook.AudienceNetwork.AdChoicesView AdChoiceView { get; set; } - - [Outlet] - Facebook.AudienceNetwork.MediaView AdCoverMediaView { get; set; } - - [Outlet] - Facebook.AudienceNetwork.AdIconView AdIconView { get; set; } - - [Outlet] - UIKit.UIButton BtnAdCallToAction { get; set; } - - [Outlet] - UIKit.UILabel LblAdBody { get; set; } - - [Outlet] - UIKit.UILabel LblAdSocialContext { get; set; } - - [Outlet] - UIKit.UILabel LblAdTitle { get; set; } - - [Outlet] - [GeneratedCode ("iOS Designer", "1.0")] - UIKit.UILabel LblSocialContext { get; set; } - - [Outlet] - UIKit.UILabel LblSponsored { get; set; } - - [Outlet] - [GeneratedCode ("iOS Designer", "1.0")] - UIKit.UIView View { get; set; } - - void ReleaseDesignerOutlets () - { - if (AdChoiceView != null) { - AdChoiceView.Dispose (); - AdChoiceView = null; - } - - if (AdCoverMediaView != null) { - AdCoverMediaView.Dispose (); - AdCoverMediaView = null; - } - - if (BtnAdCallToAction != null) { - BtnAdCallToAction.Dispose (); - BtnAdCallToAction = null; - } - - if (AdIconView != null) { - AdIconView.Dispose (); - AdIconView = null; - } - - if (LblAdBody != null) { - LblAdBody.Dispose (); - LblAdBody = null; - } - - if (LblAdSocialContext != null) { - LblAdSocialContext.Dispose (); - LblAdSocialContext = null; - } - - if (LblAdTitle != null) { - LblAdTitle.Dispose (); - LblAdTitle = null; - } - - if (LblSponsored != null) { - LblSponsored.Dispose (); - LblSponsored = null; - } - - if (LblSocialContext != null) { - LblSocialContext.Dispose (); - LblSocialContext = null; - } - - if (View != null) { - View.Dispose (); - View = null; - } - } - } -} diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.cs deleted file mode 100644 index 4fb62db4..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -using Foundation; -using UIKit; - -namespace FBAudienceNetworkSample -{ - public partial class NativeAdTemplateTableViewCell : UITableViewCell - { - public static readonly NSString Key = new NSString (nameof (NativeAdTemplateTableViewCell)); - - public UIView AdView { get => View; } - - protected NativeAdTemplateTableViewCell (IntPtr handle) : base (handle) - { - // Note: this .ctor should not contain any initialization logic. - } - } -} diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.designer.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.designer.cs deleted file mode 100644 index a24bb285..00000000 --- a/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.designer.cs +++ /dev/null @@ -1,27 +0,0 @@ -// WARNING -// -// This file has been generated automatically by Visual Studio from the outlets and -// actions declared in your storyboard file. -// Manual changes to this file will not be maintained. -// -using Foundation; -using System; -using System.CodeDom.Compiler; - -namespace FBAudienceNetworkSample -{ - [Register ("NativeAdTemplateTableViewCell")] - partial class NativeAdTemplateTableViewCell - { - [Outlet] - UIKit.UIView View { get; set; } - - void ReleaseDesignerOutlets () - { - if (View != null) { - View.Dispose (); - View = null; - } - } - } -} \ No newline at end of file diff --git a/Facebook.iOS/samples/FacebookiOSSample/FacebookiOSSample.csproj b/Facebook.iOS/samples/FacebookiOSSample/FacebookiOSSample.csproj index 083de605..de4d82e5 100644 --- a/Facebook.iOS/samples/FacebookiOSSample/FacebookiOSSample.csproj +++ b/Facebook.iOS/samples/FacebookiOSSample/FacebookiOSSample.csproj @@ -114,10 +114,6 @@ {8C6EFD7E-1512-4976-8E47-CF189BF6CB90} LoginKit - - {30556F40-CE2F-413B-9031-5A7A037AE1C9} - PlacesKit - {170FAF51-4DF1-4271-B843-3257D285E864} ShareKit diff --git a/Facebook.iOS/samples/Samples.sln b/Facebook.iOS/samples/Samples.sln index 1644f9aa..8dc641a8 100644 --- a/Facebook.iOS/samples/Samples.sln +++ b/Facebook.iOS/samples/Samples.sln @@ -5,30 +5,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{97B7 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "source", "source", "{22223EF5-BB05-497A-9729-4257528ABD91}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccountKit", "..\source\AccountKit\AccountKit.csproj", "{EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AudienceNetwork", "..\source\AudienceNetwork\AudienceNetwork.csproj", "{54FF3FE1-B984-4642-8131-16A4E8335A0D}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreKit", "..\source\CoreKit\CoreKit.csproj", "{5B88D7C7-6E76-4D0D-8DBE-B3F0A5D6B8A0}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FacebookSdks", "..\source\FacebookSdks\FacebookSdks.csproj", "{B8A416D8-45F1-4CD5-9469-5436304E3CBA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoginKit", "..\source\LoginKit\LoginKit.csproj", "{8C6EFD7E-1512-4976-8E47-CF189BF6CB90}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MarketingKit", "..\source\MarketingKit\MarketingKit.csproj", "{6ADBEE9E-5804-4362-85E9-811024EFAA15}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlacesKit", "..\source\PlacesKit\PlacesKit.csproj", "{30556F40-CE2F-413B-9031-5A7A037AE1C9}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShareKit", "..\source\ShareKit\ShareKit.csproj", "{170FAF51-4DF1-4271-B843-3257D285E864}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FacebookiOSSample", "FacebookiOSSample\FacebookiOSSample.csproj", "{FB530EE3-BAED-46B1-9703-D33D85E58A92}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FBAccountKitSample", "FBAccountKitSample\FBAccountKitSample.csproj", "{137D749C-2729-4D43-A573-314911D6ED14}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FBAudienceNetworkSample", "FBAudienceNetworkSample\FBAudienceNetworkSample.csproj", "{EDDC7A9A-9BB2-4C37-B85B-3D151079029E}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloFacebook", "HelloFacebook\HelloFacebook.csproj", "{F622F5FE-A71F-4A3E-B45C-2468DBAA406C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GamingServicesKit", "..\source\GamingServicesKit\GamingServicesKit.csproj", "{F4745BFB-8CB2-43F4-82D9-35E2F777FF62}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 @@ -41,38 +31,6 @@ Global AppStore|iPhone = AppStore|iPhone EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Debug|x86.ActiveCfg = Debug|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Debug|x86.Build.0 = Debug|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Release|x86.ActiveCfg = Release|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Release|x86.Build.0 = Release|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Release|iPhone.ActiveCfg = Release|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Release|iPhone.Build.0 = Release|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Debug|iPhone.Build.0 = Debug|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.AppStore|iPhone.Build.0 = Debug|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|x86.ActiveCfg = Debug|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|x86.Build.0 = Debug|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|x86.ActiveCfg = Release|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|x86.Build.0 = Release|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|iPhone.ActiveCfg = Release|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|iPhone.Build.0 = Release|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|iPhone.Build.0 = Debug|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.AppStore|iPhone.Build.0 = Debug|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Debug|x86.ActiveCfg = Debug|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Debug|x86.Build.0 = Debug|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Release|x86.ActiveCfg = Release|Any CPU @@ -89,38 +47,6 @@ Global {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.AppStore|iPhone.ActiveCfg = Debug|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.AppStore|iPhone.Build.0 = Debug|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Debug|x86.ActiveCfg = Debug|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Debug|x86.Build.0 = Debug|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Release|x86.ActiveCfg = Release|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Release|x86.Build.0 = Release|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Release|iPhone.ActiveCfg = Release|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Release|iPhone.Build.0 = Release|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Debug|iPhone.Build.0 = Debug|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.AppStore|iPhone.Build.0 = Debug|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Debug|x86.ActiveCfg = Debug|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Debug|x86.Build.0 = Debug|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Release|x86.ActiveCfg = Release|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Release|x86.Build.0 = Release|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Release|iPhone.ActiveCfg = Release|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Release|iPhone.Build.0 = Release|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Debug|iPhone.Build.0 = Debug|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.AppStore|iPhone.Build.0 = Debug|Any CPU {170FAF51-4DF1-4271-B843-3257D285E864}.Debug|x86.ActiveCfg = Debug|Any CPU {170FAF51-4DF1-4271-B843-3257D285E864}.Debug|x86.Build.0 = Debug|Any CPU {170FAF51-4DF1-4271-B843-3257D285E864}.Release|x86.ActiveCfg = Release|Any CPU @@ -185,38 +111,6 @@ Global {FB530EE3-BAED-46B1-9703-D33D85E58A92}.Ad-Hoc|iPhone.Build.0 = Release|iPhone {FB530EE3-BAED-46B1-9703-D33D85E58A92}.AppStore|iPhone.ActiveCfg = Release|iPhone {FB530EE3-BAED-46B1-9703-D33D85E58A92}.AppStore|iPhone.Build.0 = Release|iPhone - {137D749C-2729-4D43-A573-314911D6ED14}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator - {137D749C-2729-4D43-A573-314911D6ED14}.Debug|x86.Build.0 = Debug|iPhoneSimulator - {137D749C-2729-4D43-A573-314911D6ED14}.Release|x86.ActiveCfg = Release|iPhone - {137D749C-2729-4D43-A573-314911D6ED14}.Release|x86.Build.0 = Release|iPhone - {137D749C-2729-4D43-A573-314911D6ED14}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {137D749C-2729-4D43-A573-314911D6ED14}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {137D749C-2729-4D43-A573-314911D6ED14}.Release|iPhone.ActiveCfg = Release|iPhone - {137D749C-2729-4D43-A573-314911D6ED14}.Release|iPhone.Build.0 = Release|iPhone - {137D749C-2729-4D43-A573-314911D6ED14}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {137D749C-2729-4D43-A573-314911D6ED14}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {137D749C-2729-4D43-A573-314911D6ED14}.Debug|iPhone.ActiveCfg = Debug|iPhone - {137D749C-2729-4D43-A573-314911D6ED14}.Debug|iPhone.Build.0 = Debug|iPhone - {137D749C-2729-4D43-A573-314911D6ED14}.Ad-Hoc|iPhone.ActiveCfg = Release|iPhone - {137D749C-2729-4D43-A573-314911D6ED14}.Ad-Hoc|iPhone.Build.0 = Release|iPhone - {137D749C-2729-4D43-A573-314911D6ED14}.AppStore|iPhone.ActiveCfg = Release|iPhone - {137D749C-2729-4D43-A573-314911D6ED14}.AppStore|iPhone.Build.0 = Release|iPhone - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Debug|x86.Build.0 = Debug|iPhoneSimulator - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Release|x86.ActiveCfg = Release|iPhone - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Release|x86.Build.0 = Release|iPhone - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Release|iPhone.ActiveCfg = Release|iPhone - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Release|iPhone.Build.0 = Release|iPhone - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Debug|iPhone.ActiveCfg = Debug|iPhone - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Debug|iPhone.Build.0 = Debug|iPhone - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.AppStore|iPhone.ActiveCfg = AppStore|iPhone - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.AppStore|iPhone.Build.0 = AppStore|iPhone {F622F5FE-A71F-4A3E-B45C-2468DBAA406C}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator {F622F5FE-A71F-4A3E-B45C-2468DBAA406C}.Debug|x86.Build.0 = Debug|iPhoneSimulator {F622F5FE-A71F-4A3E-B45C-2468DBAA406C}.Release|x86.ActiveCfg = Release|iPhone @@ -233,19 +127,30 @@ Global {F622F5FE-A71F-4A3E-B45C-2468DBAA406C}.Ad-Hoc|iPhone.Build.0 = Release|iPhone {F622F5FE-A71F-4A3E-B45C-2468DBAA406C}.AppStore|iPhone.ActiveCfg = Release|iPhone {F622F5FE-A71F-4A3E-B45C-2468DBAA406C}.AppStore|iPhone.Build.0 = Release|iPhone + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Debug|x86.ActiveCfg = Debug|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Debug|x86.Build.0 = Debug|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Release|x86.ActiveCfg = Release|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Release|x86.Build.0 = Release|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Release|iPhone.ActiveCfg = Release|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Release|iPhone.Build.0 = Release|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Debug|iPhone.Build.0 = Debug|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.AppStore|iPhone.ActiveCfg = Release|Any CPU + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.AppStore|iPhone.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF} = {22223EF5-BB05-497A-9729-4257528ABD91} - {54FF3FE1-B984-4642-8131-16A4E8335A0D} = {22223EF5-BB05-497A-9729-4257528ABD91} {5B88D7C7-6E76-4D0D-8DBE-B3F0A5D6B8A0} = {22223EF5-BB05-497A-9729-4257528ABD91} {B8A416D8-45F1-4CD5-9469-5436304E3CBA} = {22223EF5-BB05-497A-9729-4257528ABD91} {8C6EFD7E-1512-4976-8E47-CF189BF6CB90} = {22223EF5-BB05-497A-9729-4257528ABD91} - {6ADBEE9E-5804-4362-85E9-811024EFAA15} = {22223EF5-BB05-497A-9729-4257528ABD91} - {30556F40-CE2F-413B-9031-5A7A037AE1C9} = {22223EF5-BB05-497A-9729-4257528ABD91} {170FAF51-4DF1-4271-B843-3257D285E864} = {22223EF5-BB05-497A-9729-4257528ABD91} {FB530EE3-BAED-46B1-9703-D33D85E58A92} = {97B73468-8507-4464-BA5C-6D3FE0DC7055} - {137D749C-2729-4D43-A573-314911D6ED14} = {97B73468-8507-4464-BA5C-6D3FE0DC7055} - {EDDC7A9A-9BB2-4C37-B85B-3D151079029E} = {97B73468-8507-4464-BA5C-6D3FE0DC7055} {F622F5FE-A71F-4A3E-B45C-2468DBAA406C} = {97B73468-8507-4464-BA5C-6D3FE0DC7055} + {F4745BFB-8CB2-43F4-82D9-35E2F777FF62} = {22223EF5-BB05-497A-9729-4257528ABD91} EndGlobalSection EndGlobal diff --git a/Facebook.iOS/source/AccountKit/AccountKit.csproj b/Facebook.iOS/source/AccountKit/AccountKit.csproj deleted file mode 100644 index 44078f31..00000000 --- a/Facebook.iOS/source/AccountKit/AccountKit.csproj +++ /dev/null @@ -1,76 +0,0 @@ - - - - Xamarin.iOS10 - true - Facebook.AccountKit - Facebook.AccountKit - 1.0.0.0 - 5.4.0 - Resources - true - - - - Xamarin.Facebook.AccountKit.iOS - Facebook Account Kit SDK for Xamarin iOS - C# bindings for Facebook Account Kit's official SDK - C# bindings for Facebook Account Kit's official SDK - Microsoft - Microsoft - © Microsoft Corporation. All rights reserved. - https://go.microsoft.com/fwlink/?linkid=873259 - https://go.microsoft.com/fwlink/?linkid=873258 - true - 5.4.0 - - - - - - - - - - - - - - - - - AccountKit.framework - - - - - - - Framework - True - UIKit Foundation AudioToolbox CoreGraphics CoreLocation Accounts Security Social - -ObjC - QuartzCore - - - - - - - - - - - - - - - - - - - Resources\AccountKitStrings.bundle\%(RecursiveDir)\%(Filename)%(Extension) - - - - diff --git a/Facebook.iOS/source/AccountKit/ApiDefinition.cs b/Facebook.iOS/source/AccountKit/ApiDefinition.cs deleted file mode 100644 index b57da14f..00000000 --- a/Facebook.iOS/source/AccountKit/ApiDefinition.cs +++ /dev/null @@ -1,582 +0,0 @@ -using System; - -using ObjCRuntime; -using Foundation; -using UIKit; - -namespace Facebook.AccountKit { - interface IAccessToken { } - - // @protocol AKFAccessToken - [Protocol (Name = "AKFAccessToken")] - interface AccessToken : INSCopying, INSSecureCoding { - // @required @property (readonly, copy, nonatomic) NSString * _Nonnull accountID; - [Abstract] - [Export ("accountID")] - string AccountId { get; } - - // @required @property (readonly, copy, nonatomic) NSString * _Nonnull applicationID; - [Abstract] - [Export ("applicationID")] - string ApplicationId { get; } - - // @required @property (readonly, copy, nonatomic) NSDate * _Nonnull lastRefresh; - [Abstract] - [Export ("lastRefresh", ArgumentSemantic.Copy)] - NSDate LastRefresh { get; } - - // @required @property (readonly, assign, nonatomic) NSTimeInterval tokenRefreshInterval; - [Abstract] - [Export ("tokenRefreshInterval")] - double TokenRefreshInterval { get; } - - // @required @property (readonly, copy, nonatomic) NSString * _Nonnull tokenString; - [Abstract] - [Export ("tokenString")] - string TokenString { get; } - } - - interface IAccount { } - - // @protocol AKFAccount - [Protocol (Name = "AKFAccount")] - interface Account : INSCopying, INSSecureCoding { - // @required @property (readonly, copy, nonatomic) NSString * _Nonnull accountID; - [Abstract] - [Export ("accountID")] - string AccountId { get; } - - // @required @property (readonly, copy, nonatomic) NSString * _Nullable emailAddress; - [Abstract] - [NullAllowed, Export ("emailAddress")] - string EmailAddress { get; } - - // @required @property (readonly, copy, nonatomic) AKFPhoneNumber * _Nullable phoneNumber; - [Abstract] - [NullAllowed, Export ("phoneNumber", ArgumentSemantic.Copy)] - PhoneNumber PhoneNumber { get; } - } - - // typedef void (^AKFRequestAccountHandler)(id _Nullable, NSError * _Nullable); - delegate void RequestAccountHandler ([NullAllowed] IAccount account, [NullAllowed] NSError error); - - // typedef void (^AKFLogoutHandler)(BOOL, NSError * _Nullable); - delegate void LogoutHandler (bool success, [NullAllowed] NSError error); - - // @interface AKFAccountKit : NSObject - [BaseType (typeof (NSObject), Name = "AKFAccountKit")] - [DisableDefaultCtor] - interface AccountKit { - [Field ("AKFErrorDomain", "__Internal")] - NSString ErrorDomain { get; } - - [Field ("AKFErrorDeveloperMessageKey", "__Internal")] - NSString ErrorDeveloperMessageKey { get; } - - [Field ("AKFErrorUserMessageKey", "__Internal")] - NSString ErrorUserMessageKey { get; } - - [Field ("AKFErrorObjectKey", "__Internal")] - NSString ErrorObjectKey { get; } - - [Field ("AKFServerErrorDomain", "__Internal")] - NSString ServerErrorDomain { get; } - - // +(NSString * _Nonnull)graphVersionString; - [Static] - [Export ("graphVersionString")] - //[Verify(MethodToProperty)] - string GraphVersionString { get; } - - // +(NSString * _Nonnull)versionString; - [Static] - [Export ("versionString")] - //[Verify(MethodToProperty)] - string VersionString { get; } - - // @property (readonly, copy, nonatomic) id _Nullable currentAccessToken; - [NullAllowed, Export ("currentAccessToken", ArgumentSemantic.Copy)] - IAccessToken CurrentAccessToken { get; } - - // -(instancetype _Nonnull)initWithResponseType:(AKFResponseType)responseType __attribute__((objc_designated_initializer)); - [Export ("initWithResponseType:")] - [DesignatedInitializer] - IntPtr Constructor (ResponseType responseType); - - // -(void)cancelLogin; - [Export ("cancelLogin")] - void CancelLogin (); - - // -(void)logOut; - [Export ("logOut")] - void LogOut (); - - // -(void)logOut:(AKFLogoutHandler _Nullable)handler; - [Async] - [Export ("logOut:")] - void LogOut ([NullAllowed] LogoutHandler handler); - - // -(void)requestAccount:(AKFRequestAccountHandler _Nonnull)handler; - [Async] - [Export ("requestAccount:")] - void RequestAccount (RequestAccountHandler handler); - - // -(UIViewController * _Nonnull)viewControllerForEmailLogin; - [Export ("viewControllerForEmailLogin")] - UIViewController GetViewControllerForEmailLogin (); - - // -(UIViewController * _Nonnull)viewControllerForEmailLoginWithEmail:(NSString * _Nullable)email state:(NSString * _Nullable)state; - [Export ("viewControllerForEmailLoginWithEmail:state:")] - UIViewController GetViewControllerForEmailLogin ([NullAllowed] string email, [NullAllowed] string state); - - // -(UIViewController * _Nonnull)viewControllerForPhoneLogin; - [Export ("viewControllerForPhoneLogin")] - UIViewController GetViewControllerForPhoneLogin (); - - // -(UIViewController * _Nonnull)viewControllerForPhoneLoginWithPhoneNumber:(AKFPhoneNumber * _Nullable)phoneNumber state:(NSString * _Nullable)state; - [Export ("viewControllerForPhoneLoginWithPhoneNumber:state:")] - UIViewController GetViewControllerForPhoneLogin ([NullAllowed] PhoneNumber phoneNumber, [NullAllowed] string state); - - // -(UIViewController * _Nullable)viewControllerForLoginResume; - [return: NullAllowed] - [Export ("viewControllerForLoginResume")] - UIViewController GetViewControllerForLoginResume (); - } - - interface IConfiguring { } - - // @protocol AKFConfiguring - [Protocol (Name = "AKFConfiguring")] - interface Configuring { - // @required @property (copy, nonatomic) NSArray * blacklistedCountryCodes; - [Abstract] - [Export ("blacklistedCountryCodes", ArgumentSemantic.Copy)] - string [] BlacklistedCountryCodes { get; set; } - - // @required @property (copy, nonatomic) NSString * defaultCountryCode; - [Abstract] - [NullAllowed] - [Export ("defaultCountryCode")] - string DefaultCountryCode { get; set; } - - // @required @property (getter = isSendToFacebookEnabled, assign, nonatomic) BOOL enableSendToFacebook; - [Abstract] - [Export ("enableSendToFacebook")] - bool EnableSendToFacebook { [Bind ("isSendToFacebookEnabled")] get; set; } - - // @required @property (getter = isInitialSMSButtonEnabled, assign, nonatomic) BOOL enableInitialSMSButton; - [Abstract] - [Export ("enableSMS")] - bool EnableSMS { [Bind ("isSMSEnabled")] get; set; } - - // @required @property (getter = isGetACallEnabled, assign, nonatomic) BOOL enableGetACall; - [Abstract] - [Export ("testSmsWithInfobip")] - bool TestSmsWithInfobip { get; set; } - - // @required @property (copy, nonatomic) NSArray * whitelistedCountryCodes; - [Abstract] - [Export ("whitelistedCountryCodes", ArgumentSemantic.Copy)] - string [] WhitelistedCountryCodes { get; set; } - } - - // @interface AKFPhoneNumber : NSObject - [BaseType (typeof (NSObject), Name = "AKFPhoneNumber")] - [DisableDefaultCtor] - interface PhoneNumber : INSCopying, INSSecureCoding { - // -(instancetype _Nonnull)initWithCountryCode:(NSString * _Nonnull)countryCode phoneNumber:(NSString * _Nonnull)phoneNumber __attribute__((objc_designated_initializer)); - [Export ("initWithCountryCode:phoneNumber:")] - [DesignatedInitializer] - IntPtr Constructor (string countryCode, string phoneNumber); - - // -(instancetype _Nonnull)initWithCountryCode:(NSString * _Nonnull)countryCode countryISO:(NSString * _Nonnull)iso phoneNumber:(NSString * _Nonnull)phoneNumber; - [Export ("initWithCountryCode:countryISO:phoneNumber:")] - IntPtr Constructor (string countryCode, string iso, string phoneNumber); - - // @property (readonly, copy, nonatomic) NSString * _Nonnull countryCode; - [Export ("countryCode")] - string CountryCode { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nonnull countryISO; - [Export ("countryISO")] - string CountryIso { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nonnull phoneNumber; - [Export ("phoneNumber")] - string PhoneNumberString { get; } - - // -(BOOL)isEqualToPhoneNumber:(AKFPhoneNumber * _Nonnull)phoneNumber; - [Export ("isEqualToPhoneNumber:")] - bool Equals (PhoneNumber phoneNumber); - - // -(NSString * _Nonnull)stringRepresentation; - [Override] - [Export ("stringRepresentation")] - string ToString (); - - [Obsolete ("Use ToString method instead. This will be removed in future versions.")] - [Wrap ("ToString ()")] - string GetStringRepresentation (); - } - - // @interface AKFSettings : NSObject - [BaseType (typeof (NSObject), Name = "AKFSettings")] - interface Settings { - // @property (copy, nonatomic, class) NSString * _Nonnull clientToken; - [Static] - [Export ("clientToken")] - string ClientToken { get; set; } - } - - // @interface AKFSkinManager : NSObject - [BaseType (typeof (NSObject), Name = "AKFSkinManager")] - [DisableDefaultCtor] - interface SkinManager : UIManager { - // -(instancetype _Nonnull)initWithSkinType:(AKFSkinType)skinType primaryColor:(UIColor * _Nullable)primaryColor backgroundImage:(UIImage * _Nullable)backgroundImage backgroundTint:(AKFBackgroundTint)backgroundTint tintIntensity:(CGFloat)tintIntensity __attribute__((objc_designated_initializer)); - [Export ("initWithSkinType:primaryColor:backgroundImage:backgroundTint:tintIntensity:")] - [DesignatedInitializer] - IntPtr Constructor (SkinType skinType, [NullAllowed] UIColor primaryColor, [NullAllowed] UIImage backgroundImage, BackgroundTint backgroundTint, nfloat tintIntensity); - - // -(instancetype _Nonnull)initWithSkinType:(AKFSkinType)skinType primaryColor:(UIColor * _Nullable)primaryColor; - [Export ("initWithSkinType:primaryColor:")] - IntPtr Constructor (SkinType skinType, [NullAllowed] UIColor primaryColor); - - // -(instancetype _Nonnull)initWithSkinType:(AKFSkinType)skinType; - [Export ("initWithSkinType:")] - IntPtr Constructor (SkinType skinType); - - // @property (readonly, assign, nonatomic) AKFSkinType skinType; - [Export ("skinType", ArgumentSemantic.Assign)] - SkinType SkinType { get; } - - // @property (readonly, copy, nonatomic) UIColor * _Null_unspecified primaryColor; - [Export ("primaryColor", ArgumentSemantic.Copy)] - UIColor PrimaryColor { get; } - - // @property (readonly, copy, nonatomic) UIImage * _Nullable backgroundImage; - [NullAllowed, Export ("backgroundImage", ArgumentSemantic.Copy)] - UIImage BackgroundImage { get; } - - // @property (readonly, assign, nonatomic) AKFBackgroundTint backgroundTint; - [Export ("backgroundTint", ArgumentSemantic.Assign)] - BackgroundTint BackgroundTint { get; } - - // @property (readonly, assign, nonatomic) CGFloat tintIntensity; - [Export ("tintIntensity")] - nfloat TintIntensity { get; } - } - - // @interface Theme : NSObject - [BaseType (typeof (NSObject), Name = "AKFTheme")] - interface Theme : INSCopying { - [Field ("AKFButtonTypeCount", "__Internal")] - nuint ButtonTypeCount { get; } - - [Field ("AKFLoginFlowStateCount", "__Internal")] - nuint LoginFlowStateCount { get; } - - [Field ("AKFTextPositionCount", "__Internal")] - nuint TextPositionCount { get; } - - [Field ("AKFHeaderTextTypeCount", "__Internal")] - nuint HeaderTextTypeCount { get; } - - // +(instancetype _Nonnull)defaultTheme; - [Static] - [Export ("defaultTheme")] - Theme GetDefaultTheme (); - - // +(instancetype _Nonnull)outlineTheme; - [Static] - [Export ("outlineTheme")] - Theme GetOutlineTheme (); - - // +(instancetype _Nonnull)outlineThemeWithPrimaryColor:(UIColor * _Nonnull)primaryColor primaryTextColor:(UIColor * _Nonnull)primaryTextColor secondaryTextColor:(UIColor * _Nonnull)secondaryTextColor statusBarStyle:(UIStatusBarStyle)statusBarStyle; - [Static] - [Export ("outlineThemeWithPrimaryColor:primaryTextColor:secondaryTextColor:statusBarStyle:")] - Theme GetOutlineTheme (UIColor primaryColor, UIColor primaryTextColor, UIColor secondaryTextColor, UIStatusBarStyle statusBarStyle); - - // +(instancetype _Nonnull)themeWithPrimaryColor:(UIColor * _Nonnull)primaryColor primaryTextColor:(UIColor * _Nonnull)primaryTextColor secondaryColor:(UIColor * _Nonnull)secondaryColor secondaryTextColor:(UIColor * _Nonnull)secondaryTextColor statusBarStyle:(UIStatusBarStyle)statusBarStyle; - [Static] - [Export ("themeWithPrimaryColor:primaryTextColor:secondaryColor:secondaryTextColor:statusBarStyle:")] - Theme GetTheme (UIColor primaryColor, UIColor primaryTextColor, UIColor secondaryColor, UIColor secondaryTextColor, UIStatusBarStyle statusBarStyle); - - // @property (copy, nonatomic) UIColor * _Nonnull backgroundColor; - [Export ("backgroundColor", ArgumentSemantic.Copy)] - UIColor BackgroundColor { get; set; } - - // @property (copy, nonatomic) UIImage * _Nullable backgroundImage; - [NullAllowed, Export ("backgroundImage", ArgumentSemantic.Copy)] - UIImage BackgroundImage { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull buttonBackgroundColor; - [Export ("buttonBackgroundColor", ArgumentSemantic.Copy)] - UIColor ButtonBackgroundColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull buttonBorderColor; - [Export ("buttonBorderColor", ArgumentSemantic.Copy)] - UIColor ButtonBorderColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull buttonDisabledBackgroundColor; - [Export ("buttonDisabledBackgroundColor", ArgumentSemantic.Copy)] - UIColor ButtonDisabledBackgroundColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull buttonDisabledBorderColor; - [Export ("buttonDisabledBorderColor", ArgumentSemantic.Copy)] - UIColor ButtonDisabledBorderColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull buttonDisabledTextColor; - [Export ("buttonDisabledTextColor", ArgumentSemantic.Copy)] - UIColor ButtonDisabledTextColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull buttonHighlightedBackgroundColor; - [Export ("buttonHighlightedBackgroundColor", ArgumentSemantic.Copy)] - UIColor ButtonHighlightedBackgroundColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull buttonHighlightedBorderColor; - [Export ("buttonHighlightedBorderColor", ArgumentSemantic.Copy)] - UIColor ButtonHighlightedBorderColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull buttonHighlightedTextColor; - [Export ("buttonHighlightedTextColor", ArgumentSemantic.Copy)] - UIColor ButtonHighlightedTextColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull buttonTextColor; - [Export ("buttonTextColor", ArgumentSemantic.Copy)] - UIColor ButtonTextColor { get; set; } - - // @property (assign, nonatomic) AKFButtonTranslucentStyle buttonTranslucenStyle; - [Export ("buttonTranslucenStyle", ArgumentSemantic.Assign)] - ButtonTranslucentStyle ButtonTranslucenStyle { get; set; } - - // @property (assign, nonatomic) NSUInteger contentBodyLayoutWeight; - [Export ("contentBodyLayoutWeight")] - nuint ContentBodyLayoutWeight { get; set; } - - // @property (assign, nonatomic) NSUInteger contentBottomLayoutWeight; - [Export ("contentBottomLayoutWeight")] - nuint ContentBottomLayoutWeight { get; set; } - - // @property (assign, nonatomic) NSUInteger contentFooterLayoutWeight; - [Export ("contentFooterLayoutWeight")] - nuint ContentFooterLayoutWeight { get; set; } - - // @property (assign, nonatomic) NSUInteger contentHeaderLayoutWeight; - [Export ("contentHeaderLayoutWeight")] - nuint ContentHeaderLayoutWeight { get; set; } - - // @property (assign, nonatomic) CGFloat contentMarginLeft; - [Export ("contentMarginLeft")] - nfloat ContentMarginLeft { get; set; } - - // @property (assign, nonatomic) CGFloat contentMarginRight; - [Export ("contentMarginRight")] - nfloat ContentMarginRight { get; set; } - - // @property (assign, nonatomic) CGFloat contentMaxWidth; - [Export ("contentMaxWidth")] - nfloat ContentMaxWidth { get; set; } - - // @property (assign, nonatomic) CGFloat contentMinHeight; - [Export ("contentMinHeight")] - nfloat ContentMinHeight { get; set; } - - // @property (assign, nonatomic) NSUInteger contentTextLayoutWeight; - [Export ("contentTextLayoutWeight")] - nuint ContentTextLayoutWeight { get; set; } - - // @property (assign, nonatomic) NSUInteger contentTopLayoutWeight; - [Export ("contentTopLayoutWeight")] - nuint ContentTopLayoutWeight { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull headerBackgroundColor; - [Export ("headerBackgroundColor", ArgumentSemantic.Copy)] - UIColor HeaderBackgroundColor { get; set; } - - // @property (nonatomic, strong) UIColor * _Nonnull headerButtonTextColor; - [Export ("headerButtonTextColor", ArgumentSemantic.Strong)] - UIColor HeaderButtonTextColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull headerTextColor; - [Export ("headerTextColor", ArgumentSemantic.Copy)] - UIColor HeaderTextColor { get; set; } - - // @property (assign, nonatomic) AKFHeaderTextType headerTextType; - [Export ("headerTextType", ArgumentSemantic.Assign)] - HeaderTextType HeaderTextType { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull iconColor; - [Export ("iconColor", ArgumentSemantic.Copy)] - UIColor IconColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull inputBackgroundColor; - [Export ("inputBackgroundColor", ArgumentSemantic.Copy)] - UIColor InputBackgroundColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull inputBorderColor; - [Export ("inputBorderColor", ArgumentSemantic.Copy)] - UIColor InputBorderColor { get; set; } - - // @property (assign, nonatomic) AKFInputStyle inputStyle; - [Export ("inputStyle", ArgumentSemantic.Assign)] - InputStyle InputStyle { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull inputTextColor; - [Export ("inputTextColor", ArgumentSemantic.Copy)] - UIColor InputTextColor { get; set; } - - // @property (assign, nonatomic) UIStatusBarStyle statusBarStyle; - [Export ("statusBarStyle", ArgumentSemantic.Assign)] - UIStatusBarStyle StatusBarStyle { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull textColor; - [Export ("textColor", ArgumentSemantic.Copy)] - UIColor TextColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nonnull titleColor; - [Export ("titleColor", ArgumentSemantic.Copy)] - UIColor TitleColor { get; set; } - - // -(BOOL)isEqualToTheme:(Theme * _Nonnull)theme; - [Export ("isEqualToTheme:")] - bool Equals (Theme theme); - } - - interface IActionController { } - - // @protocol AKFActionController - [Protocol (Name = "AKFActionController")] - interface ActionController { - // @required -(void)back; - [Abstract] - [Export ("back")] - void Back (); - - // @required -(void)cancel; - [Abstract] - [Export ("cancel")] - void Cancel (); - } - - interface IUIManager { } - - // @protocol AKFUIManager - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "AKFUIManager")] - interface UIManager { - // @optional -(UIView * _Nullable)actionBarViewForState:(AKFLoginFlowState)state; - [return: NullAllowed] - [Export ("actionBarViewForState:")] - UIView GetActionBarView (LoginFlowState state); - - // @optional -(UIView * _Nullable)bodyViewForState:(AKFLoginFlowState)state; - [return: NullAllowed] - [Export ("bodyViewForState:")] - UIView GetBodyView (LoginFlowState state); - - // @optional -(AKFButtonType)buttonTypeForState:(AKFLoginFlowState)state; - [Export ("buttonTypeForState:")] - ButtonType GetButtonType (LoginFlowState state); - - // @optional -(UIView * _Nullable)footerViewForState:(AKFLoginFlowState)state; - [return: NullAllowed] - [Export ("footerViewForState:")] - UIView GetFooterView (LoginFlowState state); - - // @optional -(UIView * _Nullable)headerViewForState:(AKFLoginFlowState)state; - [return: NullAllowed] - [Export ("headerViewForState:")] - UIView GetHeaderView (LoginFlowState state); - - // @optional -(void)setActionController:(id _Nonnull)actionController; - [Export ("setActionController:")] - void SetActionController (IActionController actionController); - - // @optional -(void)setError:(NSError * _Nonnull)error; - [Export ("setError:")] - void SetError (NSError error); - - // @optional -(AKFTextPosition)textPositionForState:(AKFLoginFlowState)state; - [Export ("textPositionForState:")] - TextPosition GetTextPosition (LoginFlowState state); - - // @optional -(Theme * _Nullable)theme; - [return: NullAllowed] - [Export ("theme")] - Theme GetTheme (); - } - - interface IAdvancedUIManager { } - - // @protocol AKFAdvancedUIManager - [Protocol (Name = "AKFAdvancedUIManager")] - interface AdvancedUIManager : UIManager { } - - interface IAdvancedUIActionController { } - - // @protocol AKFAdvancedUIActionController - [Protocol (Name = "AKFAdvancedUIActionController")] - interface AdvancedUIActionController : ActionController { } - - interface IUIManaging { } - - // @protocol AKFUIManaging - [Protocol (Name = "AKFUIManaging")] - interface UIManaging { - // @required @property (nonatomic, strong) id uiManager; - [Abstract] - [Export ("uiManager", ArgumentSemantic.Strong)] - IUIManager UiManager { get; set; } - - // @required -(void)setAdvancedUIManager:(id)uiManager; - [Abstract] - [Export ("setAdvancedUIManager:")] - void SetAdvancedUIManager (IAdvancedUIManager uiManager); - - // @required -(void)setTheme:(Theme *)theme; - [Abstract] - [Export ("setTheme:")] - void SetTheme (Theme theme); - } - - interface IViewController { } - - // @protocol AKFViewController - [Protocol (Name = "AKFViewController")] - interface ViewController : UIManaging, Configuring { - // @required @property (nonatomic, weak) id delegate; - [Abstract] - [Export ("delegate", ArgumentSemantic.Weak)] - IViewControllerDelegate Delegate { get; set; } - - // @required @property (readonly, assign, nonatomic) AKFLoginType loginType; - [Abstract] - [Export ("loginType", ArgumentSemantic.Assign)] - LoginType LoginType { get; } - } - - interface IViewControllerDelegate { } - - // @protocol AKFViewControllerDelegate - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "AKFViewControllerDelegate")] - interface ViewControllerDelegate { - // @optional -(void)viewController:(UIViewController *)viewController didCompleteLoginWithAuthorizationCode:(NSString *)code state:(NSString *)state; - [Export ("viewController:didCompleteLoginWithAuthorizationCode:state:")] - void DidCompleteLogin (IViewController viewController, string code, string state); - - // @optional -(void)viewController:(UIViewController *)viewController didCompleteLoginWithAccessToken:(id)accessToken state:(NSString *)state; - [Export ("viewController:didCompleteLoginWithAccessToken:state:")] - void DidCompleteLogin (IViewController viewController, IAccessToken accessToken, string state); - - // @optional -(void)viewController:(UIViewController *)viewController didFailWithError:(NSError *)error; - [Export ("viewController:didFailWithError:")] - void DidFail (IViewController viewController, NSError error); - - // @optional -(void)viewControllerDidCancel:(UIViewController *)viewController; - [Export ("viewControllerDidCancel:")] - void DidCancel (IViewController viewController); - } -} diff --git a/Facebook.iOS/source/AccountKit/Enums.cs b/Facebook.iOS/source/AccountKit/Enums.cs deleted file mode 100644 index 536ea648..00000000 --- a/Facebook.iOS/source/AccountKit/Enums.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using ObjCRuntime; - -namespace Facebook.AccountKit { - [Native] - public enum ResponseType : ulong { - AccessToken = 0, - AuthorizationCode - } - - [Native] - public enum LoginType : ulong { - Email = 0, - Phone - } - - [Native] - public enum ButtonType : ulong { - Default = 0, - Begin, - Confirm, - Continue, - LogIn, - Next, - Ok, - Send, - Start, - Submit - } - - [Native] - public enum LoginFlowState : ulong { - None = 0, - PhoneNumberInput, - EmailInput, - EmailVerify, - SendingCode, - SentCode, - CodeInput, - VerifyingCode, - Verified, - Error, - ResendCode, - CountryCode - } - - [Native] - public enum TextPosition : ulong { - Default = 0, - AboveBody, - BelowBody - } - - [Native] - public enum HeaderTextType : ulong { - Login = 0, - AppName - } - - [Native] - public enum InputStyle : long { - Default, - Underline, - BlurLight, - BlurDark - } - - [Native] - public enum ButtonTranslucentStyle : long { - Default, - BlurLight, - BlurDark - } - - [Native] - public enum Error : long { - NetworkConnection = 100, - Server = 200, - LoginRequestInvalidated = 300, - InvalidParameterValue = 400 - } - - [Native] - public enum ServerError : long { - InvalidServerParameterValueError = 201 - } - - [Native] - public enum LoginRequestError : long { - Expired = 301 - } - - [Native] - public enum ParameterError : long { - EmailAddress = 401, - PhoneNumber = 402, - CodingValue = 403, - AccessToken = 404, - AccountPreferenceKey = 405, - AccountPreferenceValue = 406, - OperationNotSuccessful = 407, - UIManager = 408 - } - - [Native] - public enum ServerResponseError : long { - InvalidConfirmationCode = 15003 - } - - [Native] - public enum SkinType : ulong { - Classic = 0, - Contemporary, - Translucent - } - - [Native] - public enum BackgroundTint : ulong { - White = 0, - Black - } - -} - diff --git a/Facebook.iOS/source/AccountKit/License.md b/Facebook.iOS/source/AccountKit/License.md deleted file mode 100644 index 322c0bc0..00000000 --- a/Facebook.iOS/source/AccountKit/License.md +++ /dev/null @@ -1,13 +0,0 @@ -### Xamarin Component for Facebook Account Kit iOS SDK - -**The MIT License (MIT)** - -Copyright (c) .NET Foundation Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -20180419 diff --git a/Facebook.iOS/source/AccountKit/extensions.cs b/Facebook.iOS/source/AccountKit/extensions.cs deleted file mode 100644 index 7fdff670..00000000 --- a/Facebook.iOS/source/AccountKit/extensions.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -using ObjCRuntime; -using Foundation; -using UIKit; - -namespace Facebook.AccountKit -{ - [Preserve(AllMembers = true)] - public static class Extensions - { - public static IViewController AsIViewControllerProtocol(this UIViewController ctrl) - { - return ctrl as IViewController ?? Runtime.GetINativeObject(ctrl.Handle, false); - } - } -} \ No newline at end of file diff --git a/Facebook.iOS/source/AudienceNetwork/ApiDefinition.cs b/Facebook.iOS/source/AudienceNetwork/ApiDefinition.cs deleted file mode 100644 index e130b3ad..00000000 --- a/Facebook.iOS/source/AudienceNetwork/ApiDefinition.cs +++ /dev/null @@ -1,1875 +0,0 @@ -// -// ApiDefinition.cs: Bindings to the Facebook iOS SDK. -// -// Authors: -// Miguel de Icaza (miguel@xamarin.com) -// Alex Soto (alex.soto@xamarin.com) -// Israel Soto (israel.soto@xamarin.com) -// - -using System; - -using ObjCRuntime; -using Foundation; -using UIKit; -using CoreLocation; -using Accounts; -using CoreGraphics; -using System.Reflection; -using System.ComponentModel; -using CoreMedia; -using CoreFoundation; - -namespace Facebook.AudienceNetwork -{ - // @interface FBAdChoicesView : UIView - [DisableDefaultCtor] - [BaseType (typeof (UIView), Name = "FBAdChoicesView")] - interface AdChoicesView { - // @property (readonly, nonatomic, weak) UILabel * label; - [Export ("label", ArgumentSemantic.Weak)] - UILabel Label { get; } - - // @property (getter = isBackgroundShown, assign, nonatomic) BOOL backgroundShown; - [Export ("backgroundShown")] - bool BackgroundShown { [Bind ("isBackgroundShown")] get; set; } - - // @property (nonatomic, assign, readonly, getter=isExpandable) BOOL expandable; - [Export ("expandable")] - bool Expandable { [Bind ("isExpandable")] get; set; } - - // @property (readwrite, nonatomic, weak) FBNativeAdBase * _Nullable nativeAd; - [NullAllowed] - [Export ("nativeAd", ArgumentSemantic.Weak)] - NativeAdBase NativeAd { get; set; } - - // @property (nonatomic, assign, readwrite) UIRectCorner corner; - [Export ("corner", ArgumentSemantic.Assign)] - UIRectCorner Corner { get; set; } - - // @property (assign, readwrite, nonatomic) UIEdgeInsets insets; - [Export ("insets", ArgumentSemantic.Assign)] - UIEdgeInsets Insets { get; set; } - - // @property (nonatomic, weak, readwrite, nullable) UIViewController *rootViewController; - [NullAllowed] - [Export ("rootViewController", ArgumentSemantic.Weak)] - UIViewController RootViewController { get; set; } - - // @property (readonly, assign, nonatomic) FBNativeAdViewTag nativeAdViewTag; - [Export ("nativeAdViewTag", ArgumentSemantic.Assign)] - NativeAdViewTag NativeAdViewTag { get; } - - // -(instancetype)initWithNativeAd:(FBNativeAd *)nativeAd; - [Export ("initWithNativeAd:")] - IntPtr Constructor (NativeAdBase nativeAd); - - // - (nonnull instancetype)initWithNativeAd:(nonnull FBNativeAd *)nativeAd expandable:(BOOL)expandable; - [Export ("initWithNativeAd:expandable:")] - IntPtr Constructor (NativeAdBase nativeAd, bool expandable); - - // -(instancetype _Nonnull)initWithNativeAd:(FBNativeAdBase * _Nonnull)nativeAd expandable:(BOOL)expandable attributes:(FBNativeAdViewAttributes * _Nullable)attributes; - [Export ("initWithNativeAd:expandable:attributes:")] - IntPtr Constructor (NativeAdBase nativeAd, bool expandable, [NullAllowed] NativeAdViewAttributes attributes); - - // -(void)updateFrameFromSuperview; - [Export ("updateFrameFromSuperview")] - void UpdateFrameFromSuperview (); - - // -(void)updateFrameFromSuperview:(UIRectCorner)corner; - [Export ("updateFrameFromSuperview:")] - void UpdateFrameFromSuperview (UIRectCorner corner); - - // - (void)updateFrameFromSuperview:(UIRectCorner)corner insets:(UIEdgeInsets)insets; - [Export ("updateFrameFromSuperview:insets:")] - void UpdateFrameFromSuperview (UIRectCorner corner, UIEdgeInsets insets); - } - - [Static] - partial interface AdExperienceType - { - // extern const FBAdExperienceType _Nonnull FBAdExperienceTypeRewarded; - [Field ("FBAdExperienceTypeRewarded", "__Internal")] - NSString Rewarded { get; } - - // extern const FBAdExperienceType _Nonnull FBAdExperienceTypeInterstitial; - [Field ("FBAdExperienceTypeInterstitial", "__Internal")] - NSString Interstitial { get; } - - // extern const FBAdExperienceType _Nonnull FBAdExperienceTypeRewardedInterstitial; - [Field ("FBAdExperienceTypeRewardedInterstitial", "__Internal")] - NSString RewardedInterstitial { get; } - } - - // @interface FBAdExperienceConfig : NSObject - [BaseType(typeof(NSObject), Name= "FBAdExperienceConfig")] - [DisableDefaultCtor] - interface AdExperienceConfig - { - // @property (readwrite, nonatomic, strong) FBAdExperienceType _Nonnull adExperienceType; - [Export("adExperienceType", ArgumentSemantic.Strong)] - string AdExperienceType { get; set; } - - // -(instancetype _Nonnull)initWithAdExperienceType:(FBAdExperienceType _Nonnull)adExperienceType __attribute__((objc_designated_initializer)); - [Export("initWithAdExperienceType:")] - [DesignatedInitializer] - IntPtr Constructor(NSString adExperienceType); - } - - [Static] - interface AdExtraHintKeywords { - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordAccessories; - [Obsolete ("Use the AdExtraHintKeyword.Accessories enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Accessories.GetConstant ()")] - NSString Accessories { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordArtHistory; - [Obsolete ("Use the AdExtraHintKeyword.ArtHistory enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.ArtHistory.GetConstant ()")] - NSString ArtHistory { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordAutomotive; - [Obsolete ("Use the AdExtraHintKeyword.Automotive enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Automotive.GetConstant ()")] - NSString Automotive { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBeauty; - [Obsolete ("Use the AdExtraHintKeyword.Beauty enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Beauty.GetConstant ()")] - NSString Beauty { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBiology; - [Obsolete ("Use the AdExtraHintKeyword.Biology enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Biology.GetConstant ()")] - NSString Biology { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBoardGames; - [Obsolete ("Use the AdExtraHintKeyword.BoardGames enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.BoardGames.GetConstant ()")] - NSString BoardGames { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBusinessSoftware; - [Obsolete ("Use the AdExtraHintKeyword.BusinessSoftware enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.BusinessSoftware.GetConstant ()")] - NSString BusinessSoftware { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBuyingSellingHomes; - [Obsolete ("Use the AdExtraHintKeyword.BuyingSellingHomes enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.BuyingSellingHomes.GetConstant ()")] - NSString BuyingSellingHomes { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordCats; - [Obsolete ("Use the AdExtraHintKeyword.Cats enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Cats.GetConstant ()")] - NSString Cats { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordCelebrities; - [Obsolete ("Use the AdExtraHintKeyword.Celebrities enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Celebrities.GetConstant ()")] - NSString Celebrities { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordClothing; - [Obsolete ("Use the AdExtraHintKeyword.Clothing enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Clothing.GetConstant ()")] - NSString Clothing { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordComicBooks; - [Obsolete ("Use the AdExtraHintKeyword.ComicBooks enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.ComicBooks.GetConstant ()")] - NSString ComicBooks { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordDesktopVideo; - [Obsolete ("Use the AdExtraHintKeyword.DesktopVideo enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.DesktopVideo.GetConstant ()")] - NSString DesktopVideo { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordDogs; - [Obsolete ("Use the AdExtraHintKeyword.Dogs enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Dogs.GetConstant ()")] - NSString Dogs { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordEducation; - [Obsolete ("Use the AdExtraHintKeyword.Education enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Education.GetConstant ()")] - NSString Education { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordEmail; - [Obsolete ("Use the AdExtraHintKeyword.Email enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Email.GetConstant ()")] - NSString Email { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordEntertainment; - [Obsolete ("Use the AdExtraHintKeyword.Entertainment enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Entertainment.GetConstant ()")] - NSString Entertainment { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFamilyParenting; - [Obsolete ("Use the AdExtraHintKeyword.FamilyParenting enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.FamilyParenting.GetConstant ()")] - NSString FamilyParenting { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFashion; - [Obsolete ("Use the AdExtraHintKeyword.Fashion enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Fashion.GetConstant ()")] - NSString Fashion { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFineArt; - [Obsolete ("Use the AdExtraHintKeyword.FineArt enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.FineArt.GetConstant ()")] - NSString FineArt { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFoodDrink; - [Obsolete ("Use the AdExtraHintKeyword.FoodDrink enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.FoodDrink.GetConstant ()")] - NSString FoodDrink { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFrenchCuisine; - [Obsolete ("Use the AdExtraHintKeyword.FrenchCuisine enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.FrenchCuisine.GetConstant ()")] - NSString FrenchCuisine { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordGovernment; - [Obsolete ("Use the AdExtraHintKeyword.Government enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Government.GetConstant ()")] - NSString Government { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHealthFitness; - [Obsolete ("Use the AdExtraHintKeyword.HealthFitness enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.HealthFitness.GetConstant ()")] - NSString HealthFitness { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHobbies; - [Obsolete ("Use the AdExtraHintKeyword.Hobbies enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Hobbies.GetConstant ()")] - NSString Hobbies { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHomeGarden; - [Obsolete ("Use the AdExtraHintKeyword.HomeGarden enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.HomeGarden.GetConstant ()")] - NSString HomeGarden { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHumor; - [Obsolete ("Use the AdExtraHintKeyword.Humor enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Humor.GetConstant ()")] - NSString Humor { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordInternetTechnology; - [Obsolete ("Use the AdExtraHintKeyword.InternetTechnology enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.InternetTechnology.GetConstant ()")] - NSString InternetTechnology { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLargeAnimals; - [Obsolete ("Use the AdExtraHintKeyword.LargeAnimals enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.LargeAnimals.GetConstant ()")] - NSString LargeAnimals { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLaw; - [Obsolete ("Use the AdExtraHintKeyword.Law enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Law.GetConstant ()")] - NSString Law { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLegalIssues; - [Obsolete ("Use the AdExtraHintKeyword.LegalIssues enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.LegalIssues.GetConstant ()")] - NSString LegalIssues { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLiterature; - [Obsolete ("Use the AdExtraHintKeyword.Literature enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Literature.GetConstant ()")] - NSString Literature { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordMarketing; - [Obsolete ("Use the AdExtraHintKeyword.Marketing enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Marketing.GetConstant ()")] - NSString Marketing { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordMovies; - [Obsolete ("Use the AdExtraHintKeyword.Movies enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Movies.GetConstant ()")] - NSString Movies { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordMusic; - [Obsolete ("Use the AdExtraHintKeyword.Music enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Music.GetConstant ()")] - NSString Music { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordNews; - [Obsolete ("Use the AdExtraHintKeyword.News enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.News.GetConstant ()")] - NSString News { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPersonalFinance; - [Obsolete ("Use the AdExtraHintKeyword.PersonalFinance enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.PersonalFinance.GetConstant ()")] - NSString PersonalFinance { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPets; - [Obsolete ("Use the AdExtraHintKeyword.Pets enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Pets.GetConstant ()")] - NSString Pets { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPhotography; - [Obsolete ("Use the AdExtraHintKeyword.Photography enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Photography.GetConstant ()")] - NSString Photography { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPolitics; - [Obsolete ("Use the AdExtraHintKeyword.Politics enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Politics.GetConstant ()")] - NSString Politics { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordRealEstate; - [Obsolete ("Use the AdExtraHintKeyword.RealEstate enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.RealEstate.GetConstant ()")] - NSString RealEstate { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordRoleplayingGames; - [Obsolete ("Use the AdExtraHintKeyword.RoleplayingGames enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.RoleplayingGames.GetConstant ()")] - NSString RoleplayingGames { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordScience; - [Obsolete ("Use the AdExtraHintKeyword.Science enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Science.GetConstant ()")] - NSString Science { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordShopping; - [Obsolete ("Use the AdExtraHintKeyword.Shopping enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Shopping.GetConstant ()")] - NSString Shopping { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordSociety; - [Obsolete ("Use the AdExtraHintKeyword.Society enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Society.GetConstant ()")] - NSString Society { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordSports; - [Obsolete ("Use the AdExtraHintKeyword.Sports enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Sports.GetConstant ()")] - NSString Sports { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordTechnology; - [Obsolete ("Use the AdExtraHintKeyword.Technology enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Technology.GetConstant ()")] - NSString Technology { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordTelevision; - [Obsolete ("Use the AdExtraHintKeyword.Television enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Television.GetConstant ()")] - NSString Television { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordTravel; - [Obsolete ("Use the AdExtraHintKeyword.Travel enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.Travel.GetConstant ()")] - NSString Travel { get; } - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordVideoComputerGames; - [Obsolete ("Use the AdExtraHintKeyword.VideoComputerGames enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("AdExtraHintKeyword.VideoComputerGames.GetConstant ()")] - NSString VideoComputerGames { get; } - } - - // @interface FBAdExtraHint : NSObject - [Obsolete ("Keywords are no longer used in Audience Network.")] - [BaseType (typeof (NSObject), Name = "FBAdExtraHint")] - interface AdExtraHint { - // @property (copy, nonatomic) NSString * _Nullable contentURL; - [Obsolete ("Extra hints are no longer used in Audience Network.")] - [NullAllowed] - [Export ("contentURL")] - string ContentUrl { get; set; } - - // @property (copy, nonatomic) NSString * _Nullable extraData; - [Obsolete ("Extra hints are no longer used in Audience Network.")] - [NullAllowed] - [Export ("extraData")] - string ExtraData { get; set; } - - // @property (copy, nonatomic) NSString * _Nullable mediationData; - [Obsolete ("Extra hints are no longer used in Audience Network.")] - [NullAllowed] - [Export ("mediationData")] - string MediationData { get; set; } - - // -(instancetype _Nonnull)initWithKeywords:(NSArray * _Nonnull)keywords; - [Internal] - [Export ("initWithKeywords:")] - IntPtr Constructor (NSArray keywords); - - [Obsolete ("Keywords are no longer used in Audience Network.")] - [Wrap ("this (NSArray.FromNSObjects (k => k.GetConstant (), keywords))")] - IntPtr Constructor (AdExtraHintKeyword [] keywords); - - [Obsolete ("Keywords are no longer used in Audience Network.")] - [Wrap ("this (NSArray.FromNSObjects (keywords))")] - IntPtr Constructor (NSString [] keywords); - - // -(void)addKeyword:(FBAdExtraHintKeyword _Nonnull)keyword; - [Internal] - [Export ("addKeyword:")] - void _AddKeyword (NSString keyword); - - [Obsolete ("Keywords are no longer used in Audience Network.")] - [Wrap ("_AddKeyword (keyword.GetConstant ())")] - void AddKeyword (AdExtraHintKeyword keyword); - - [Obsolete ("Use the AddKeyword (AdExtraHintKeyword) overload method instead. This will be removed in future versions.")] - [Wrap ("_AddKeyword (keyword)")] - void AddKeyword (NSString keyword); - - // -(void)removeKeyword:(FBAdExtraHintKeyword _Nonnull)keyword; - [Internal] - [Export ("removeKeyword:")] - void _RemoveKeyword (NSString keyword); - - [Obsolete ("Keywords are no longer used in Audience Network.")] - [Wrap ("_RemoveKeyword (keyword.GetConstant ())")] - void RemoveKeyword (AdExtraHintKeyword keyword); - - [Obsolete ("Use the RemoveKeyword (AdExtraHintKeyword) overload method instead. This will be removed in future versions.")] - [Wrap ("_RemoveKeyword (keyword)")] - void RemoveKeyword (NSString keyword); - } - - // @interface FBAdIconView : UIView - [Obsolete ("This class will be removed in a future release. Use MediaView instead.")] - [BaseType (typeof (MediaView), Name = "FBAdIconView")] - interface AdIconView { - [Export ("initWithFrame:")] - IntPtr Constructor (CGRect frame); - - // @property (readonly, assign, nonatomic) FBNativeAdViewTag nativeAdViewTag; - [Export ("nativeAdViewTag", ArgumentSemantic.Assign)] - NativeAdViewTag NativeAdViewTag { get; } - } - - // @interface FBAdOptionsView : UIView - [BaseType (typeof (UIView), Name = "FBAdOptionsView")] - interface AdOptionsView { - // @property (readwrite, nonatomic, weak) FBNativeAdBase * _Nullable nativeAd; - [NullAllowed] - [Export ("nativeAd", ArgumentSemantic.Weak)] - NativeAdBase NativeAd { get; set; } - - // @property (nonatomic, strong) UIColor * _Nullable foregroundColor; - [NullAllowed] - [Export ("foregroundColor", ArgumentSemantic.Strong)] - UIColor ForegroundColor { get; set; } - - // @property (assign, nonatomic) BOOL useSingleIcon; - [Export ("useSingleIcon")] - bool UseSingleIcon { get; set; } - } - - delegate void AdImageCompletionHandler ([NullAllowed] UIImage imageLoaded); - - // @interface FBAdImage : NSObject - [BaseType (typeof (NSObject), Name = "FBAdImage")] - interface AdImage { - // @property (readonly, copy, nonatomic) NSURL * url; - [Export ("url", ArgumentSemantic.Copy)] - NSUrl Url { get; } - - // @property (readonly, assign, nonatomic) NSInteger width; - [Export ("width")] - nint Width { get; } - - // @property (readonly, assign, nonatomic) NSInteger height; - [Export ("height")] - nint Height { get; } - - // -(instancetype)initWithURL:(NSURL *)url width:(NSInteger)width height:(NSInteger)height __attribute__((objc_designated_initializer)); - [DesignatedInitializer] - [Export ("initWithURL:width:height:")] - IntPtr Constructor (NSUrl url, nint width, nint height); - - // -(void)loadImageAsyncWithBlock:(void (^ _Nullable)(UIImage * _Nullable))block; - [Export ("loadImageAsyncWithBlock:")] - void LoadImageAsync ([NullAllowed] AdImageCompletionHandler block); - } - - [DisableDefaultCtor] - [BaseType (typeof (NSObject), Name = "FBAdSettings")] - interface AdSettings { - [Field ("FBAudienceNetworkErrorDomain", "__Internal")] - NSString AdsErrorDomain { get; } - - [Field ("FBAudienceNetworkMediaViewErrorDomain", "__Internal")] - NSString MediaViewErrorDomain { get; } - - // @property (class, nonatomic, assign, getter=isBackgroundVideoPlaybackAllowed) BOOL backgroundVideoPlaybackAllowed; - [Static] - [Export ("backgroundVideoPlaybackAllowed")] - bool IsBackgroundVideoPlaybackAllowed { [Bind ("isBackgroundVideoPlaybackAllowed")] get; set; } - - // @property (class, nonatomic, assign) FBAdTestAdType testAdType; - [Static] - [Export ("testAdType", ArgumentSemantic.Assign)] - AdTestAdType TestAdType { get; set; } - - // @property (class, nonatomic, weak, nullable) id loggingDelegate; - [Static] - [NullAllowed] - [Export ("loggingDelegate", ArgumentSemantic.Weak)] - IAdLoggingDelegate LoggingDelegate { get; set; } - - // @property (class, nonatomic, copy, readonly) NSString *bidderToken; - [Static] - [Export ("bidderToken")] - string BidderToken { get; } - - // @property (readonly, copy, nonatomic, class) NSString * _Nonnull routingToken; - [Static] - [Export ("routingToken")] - string RoutingToken { get; } - - [Static] - [Export ("isTestMode")] - bool IsTestMode { get; } - - [Static] - [Export ("testDeviceHash")] - string TestDeviceHash { get; } - - [Static] - [Export ("addTestDevice:")] - void AddTestDevice (string deviceHash); - - [Static] - [Export ("addTestDevices:")] - void AddTestDevices (string [] devicesHash); - - [Static] - [Export ("clearTestDevices")] - void ClearTestDevices (); - - [Static] - [Export ("clearTestDevice:")] - void ClearTestDevice (string deviceHash); - - [Obsolete ("SetIsChildDirected method is no longer supported in Audience Network. Use MixedAudience static property instead.")] - [Static] - [Export ("setIsChildDirected:")] - void SetIsChildDirected (bool isChildDirected); - - // @property (getter = isMixedAudience, assign, nonatomic, class) BOOL mixedAudience; - [Static] - [Export ("mixedAudience")] - bool MixedAudience { [Bind ("isMixedAudience")] get; set; } - - // + (void)setMediationService:(NSString *)service; - [Static] - [Export ("setMediationService:")] - void SetMediationService (string service); - - // + (NSString *)urlPrefix; - // + (void)setUrlPrefix:(NSString *)urlPrefix; - [Advice ("This property should never be used in production.")] - [Static] - [NullAllowed] - [Export ("urlPrefix")] - string UrlPrefix { get; set; } - - // +(FBAdLogLevel)getLogLevel; - // +(void)setLogLevel:(FBAdLogLevel)level; - [Static] - [Export ("logLevel")] - AdLogLevel LogLevel { [Bind ("getLogLevel")] get; set; } - - // +(void)setDataProcessingOptions:(NSArray * _Nonnull)options country:(NSInteger)country state:(NSInteger)state; - [Static] - [Export ("setDataProcessingOptions:country:state:")] - void SetDataProcessingOptions (string[] options, nint country, nint state); - - // +(void)setDataProcessingOptions:(NSArray * _Nonnull)options; - [Static] - [Export ("setDataProcessingOptions:")] - void SetDataProcessingOptions (string[] options); - } - - interface IAdLoggingDelegate { } - - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "FBAdLoggingDelegate")] - interface AdLoggingDelegate { - // @required -(void)logAtLevel:(FBAdLogLevel)level withFileName:(NSString * _Nonnull)fileName withLineNumber:(int)lineNumber withThreadId:(long)threadId withBody:(NSString * _Nonnull)body; - [Abstract] - [Export ("logAtLevel:withFileName:withLineNumber:withThreadId:withBody:")] - void Log (AdLogLevel level, string fileName, int lineNumber, nint threadId, string body); - } - - [Static] - interface AdSizes { - [Internal] - [Field ("kFBAdSize320x50", "__Internal")] - IntPtr _kFBAdSize320x50 { get; } - - [Internal] - [Field ("kFBAdSizeHeight50Banner", "__Internal")] - IntPtr _kFBAdSizeHeight50Banner { get; } - - [Internal] - [Field ("kFBAdSizeHeight90Banner", "__Internal")] - IntPtr _kFBAdSizeHeight90Banner { get; } - - [Internal] - [Field ("kFBAdSizeInterstitial", "__Internal")] - IntPtr _kFBAdSizeInterstitial { get; } - - [Internal] - [Field ("kFBAdSizeHeight250Rectangle", "__Internal")] - IntPtr _kFBAdSizeHeight250Rectangle { get; } - } - - [DisableDefaultCtor] - [BaseType (typeof (UIView), Name = "FBAdView")] - interface AdView { - [DesignatedInitializer] - [Export ("initWithPlacementID:adSize:rootViewController:")] - IntPtr Constructor (string placementId, AdSize adSize, [NullAllowed] UIViewController rootViewController); - - // -(instancetype _Nullable)initWithPlacementID:(NSString * _Nonnull)placementID bidPayload:(NSString * _Nonnull)bidPayload rootViewController:(UIViewController * _Nullable)rootViewController error:(NSError * _Nullable * _Nullable)error; - [Export ("initWithPlacementID:bidPayload:rootViewController:error:")] - IntPtr Constructor (string placementId, string bidPayload, [NullAllowed] UIViewController rootViewController, [NullAllowed] out NSError error); - - [Export ("loadAd")] - void LoadAd (); - - // - (void)loadAdWithBidPayload:(NSString *)bidPayload; - [Export ("loadAdWithBidPayload:")] - void LoadAd (string bidPayload); - - // -(void)disableAutoRefresh; - [Obsolete ("Autorefresh is disabled by default.")] - [Export ("disableAutoRefresh")] - void DisableAutoRefresh (); - - [Export ("placementID")] - string PlacementId { get; } - - [NullAllowed] - [Export ("rootViewController", ArgumentSemantic.Weak)] - UIViewController RootViewController { get; } - - // @property (readonly, getter = isAdValid, nonatomic) BOOL adValid; - [Export ("isAdValid")] - bool IsAdValid { get; } - - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - IAdViewDelegate Delegate { get; set; } - - // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; - [NullAllowed] - [Export ("extraHint", ArgumentSemantic.Strong)] - AdExtraHint ExtraHint { get; set; } - } - - interface IAdViewDelegate { } - - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "FBAdViewDelegate")] - interface AdViewDelegate { - [Export ("adViewDidClick:")] - void AdViewDidClick (AdView adView); - - [Export ("adViewDidFinishHandlingClick:")] - void AdViewDidFinishHandlingClick (AdView adView); - - [Export ("adViewDidLoad:")] - void AdViewDidLoad (AdView adView); - - [Export ("adView:didFailWithError:")] - void AdViewDidFail (AdView adView, NSError error); - - // @optional -(void)adViewWillLogImpression:(FBAdView * _Nonnull)adView; - [Export ("adViewWillLogImpression:")] - void AdViewWillLogImpression (AdView adView); - - [Export ("viewControllerForPresentingModalView", ArgumentSemantic.Strong)] - UIViewController GetViewControllerForPresentingModalView (); - } - - // @interface FBAdInitSettings : NSObject - [DisableDefaultCtor] - [BaseType (typeof (NSObject), Name = "FBAdInitSettings")] - interface AdInitSettings { - // -(instancetype _Nonnull)initWithPlacementIDs:(NSArray * _Nonnull)placementIDs mediationService:(NSString * _Nonnull)mediationService; - [Export ("initWithPlacementIDs:mediationService:")] - IntPtr Constructor (string [] placementIds, string mediationService); - - // @property (readonly, copy, nonatomic) NSArray * _Nonnull placementIDs; - [Export ("placementIDs", ArgumentSemantic.Copy)] - string [] PlacementIds { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nonnull mediationService; - [Export ("mediationService")] - string MediationService { get; } - } - - // @interface FBAdInitResults : NSObject - [BaseType (typeof (NSObject), Name = "FBAdInitResults")] - interface AdInitResults { - // @property (readonly, getter = isSuccess, assign, nonatomic) BOOL success; - [Export ("isSuccess")] - bool IsSuccess { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nonnull message; - [Export ("message")] - string Message { get; } - } - - // @interface FBAudienceNetworkAds : NSObject - [DisableDefaultCtor] - [BaseType (typeof (NSObject), Name = "FBAudienceNetworkAds")] - interface AudienceNetworkAds { - // +(void)initializeWithSettings:(FBAdInitSettings * _Nullable)settings completionHandler:(void (^ _Nullable)(FBAdInitResults * _Nonnull))completionHandler; - [Static] - [Export ("initializeWithSettings:completionHandler:")] - void Initialize ([NullAllowed] AdInitSettings settings, [NullAllowed] Action completionHandler); - - // +(FBAdFormatTypeName)adFormatTypeNameForPlacementId:(NSString * _Nonnull)placementId; - [Static] - [Export ("adFormatTypeNameForPlacementId:")] - AdFormatTypeName GetAdFormatTypeName (string placementId); - } - - // @interface FBInstreamAdView : UIView - [DisableDefaultCtor] - [BaseType (typeof (UIView), Name = "FBInstreamAdView")] - interface InstreamAdView { - // @property (readonly, getter = isAdValid, nonatomic) BOOL adValid; - [Export ("adValid")] - bool IsAdValid { [Bind ("isAdValid")] get; } - - // @property (nonatomic, weak) id _Nullable delegate; - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - IInstreamAdViewDelegate Delegate { get; set; } - - // @property (readonly, copy, nonatomic) NSString * _Nonnull placementID; - [NullAllowed] - [Export ("placementID")] - string PlacementId { get; } - - // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; - [NullAllowed] - [Export ("extraHint", ArgumentSemantic.Strong)] - AdExtraHint ExtraHint { get; set; } - - // -(instancetype _Nullable)initWithPlacementID:(NSString * _Nonnull)placementID __attribute__((objc_designated_initializer)); - [Obsolete("Instream ads have been deprecated. Initialiser will return nil.")] - [DesignatedInitializer] - [Export ("initWithPlacementID:")] - IntPtr Constructor (string placementId); - - // -(void)loadAd; - [Obsolete("Instream ads have been deprecated. Initialiser will return nil.")] - [PostGet ("IsAdValid")] - [Export ("loadAd")] - void LoadAd (); - - // - (void) loadAdWithBidPayload:(NSString*) bidPayload; - [Obsolete("Instream ads have been deprecated. Initialiser will return nil.")] - [Export ("loadAdWithBidPayload:")] - void LoadAd (string bidPayload); - - // -(BOOL)showAdFromRootViewController:(UIViewController * _Nullable)rootViewController; - [Obsolete("Instream ads have been deprecated. Initialiser will return nil.")] - [Export ("showAdFromRootViewController:")] - bool ShowAd ([NullAllowed] UIViewController rootViewController); - } - - interface IInstreamAdViewDelegate { } - - // @protocol FBInstreamAdViewDelegate - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "FBInstreamAdViewDelegate")] - interface InstreamAdViewDelegate { - // @required -(void)adViewDidLoad:(FBInstreamAdView * _Nonnull)adView; - [Abstract] - [Export ("adViewDidLoad:")] - void AdViewDidLoad ([NullAllowed] InstreamAdView adView); - - // @required -(void)adViewDidEnd:(FBInstreamAdView * _Nonnull)adView; - [Abstract] - [Export ("adViewDidEnd:")] - void AdViewDidEnd ([NullAllowed] InstreamAdView adView); - - // @required -(void)adView:(FBInstreamAdView * _Nonnull)adView didFailWithError:(NSError * _Nonnull)error; - [Abstract] - [Export ("adView:didFailWithError:")] - void AdViewDidFail ([NullAllowed] InstreamAdView adView, [NullAllowed] NSError error); - - // @optional -(void)adViewDidClick:(FBInstreamAdView * _Nonnull)adView; - [Export ("adViewDidClick:")] - void AdViewDidClick ([NullAllowed] InstreamAdView adView); - - // @optional -(void)adViewWillLogImpression:(FBInstreamAdView * _Nonnull)adView; - [Export ("adViewWillLogImpression:")] - void AdViewWillLogImpression ([NullAllowed] InstreamAdView adView); - } - - [DisableDefaultCtor] - [BaseType (typeof (NSObject), Name = "FBInterstitialAd")] - interface InterstitialAd { - [Export ("placementID")] - string PlacementId { get; } - - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - IInterstitialAdDelegate Delegate { get; set; } - - // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; - [NullAllowed] - [Export ("extraHint", ArgumentSemantic.Strong)] - AdExtraHint ExtraHint { get; set; } - - [Export ("initWithPlacementID:")] - [DesignatedInitializer] - IntPtr Constructor (string placementId); - - [Export ("isAdValid")] - bool IsAdValid { get; } - - [PostGet ("IsAdValid")] - [Export ("loadAd")] - void LoadAd (); - - // - (void) loadAdWithBidPayload:(NSString*) bidPayload; - [PostGet ("IsAdValid")] - [Export ("loadAdWithBidPayload:")] - void LoadAd (string bidPayload); - - [Export ("showAdFromRootViewController:")] - bool ShowAd ([NullAllowed] UIViewController rootViewController); - } - - interface IInterstitialAdDelegate { } - - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "FBInterstitialAdDelegate")] - interface InterstitialAdDelegate { - [Export ("interstitialAdDidClick:")] - void InterstitialAdDidClick (InterstitialAd interstitialAd); - - [Export ("interstitialAdDidClose:")] - void InterstitialAdDidClose (InterstitialAd interstitialAd); - - [Export ("interstitialAdWillClose:")] - void InterstitialAdWillClose (InterstitialAd interstitialAd); - - [Export ("interstitialAdDidLoad:")] - void InterstitialAdDidLoad (InterstitialAd interstitialAd); - - [Export ("interstitialAd:didFailWithError:")] - void IntersitialDidFail (InterstitialAd interstitialAd, NSError error); - - // @optional -(void)interstitialAdWillLogImpression:(FBInterstitialAd * _Nonnull)interstitialAd; - [Export ("interstitialAdWillLogImpression:")] - void InterstitialAdWillLogImpression (InterstitialAd interstitialAd); - } - - // @interface FBMediaView : UIView - [BaseType (typeof (UIView), Name = "FBMediaView")] - interface MediaView { - [Export ("initWithFrame:")] - IntPtr Constructor (CGRect frame); - - // @property (nonatomic, weak) id delegate; - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - IMediaViewDelegate Delegate { get; set; } - - // @property (nonatomic, strong, nonnull) FBMediaViewVideoRenderer *videoRenderer; - [Export ("videoRenderer", ArgumentSemantic.Strong)] - MediaViewVideoRenderer VideoRenderer { get; set; } - - // @property (readonly, assign, nonatomic) float volume; - [Export ("volume")] - float Volume { get; } - - // @property (nonatomic, readonly, getter=isAutoplayEnabled) BOOL autoplayEnabled; - [Export ("isAutoplayEnabled")] - bool IsAutoplayEnabled { get; } - - // @property (readonly, assign, nonatomic) CGFloat aspectRatio; - [Export ("aspectRatio")] - nfloat AspectRatio { get; } - - // @property (readonly, assign, nonatomic) FBNativeAdViewTag nativeAdViewTag; - [New] - [Export ("nativeAdViewTag", ArgumentSemantic.Assign)] - NativeAdViewTag NativeAdViewTag { get; } - - // -(void)applyNaturalWidth; - [Export ("applyNaturalWidth")] - void ApplyNaturalWidth (); - - // -(void)applyNaturalHeight; - [Export ("applyNaturalHeight")] - void ApplyNaturalHeight (); - } - - interface IMediaViewDelegate { } - - // @protocol FBMediaViewDelegate - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "FBMediaViewDelegate")] - interface MediaViewDelegate { - // @optional -(void)mediaViewDidLoad:(FBMediaView *)mediaView; - [Export ("mediaViewDidLoad:")] - void MediaViewDidLoad (MediaView mediaView); - - // @optional -(void)mediaViewWillEnterFullscreen:(FBMediaView * _Nonnull)mediaView; - [Export ("mediaViewWillEnterFullscreen:")] - void MediaViewWillEnterFullscreen (MediaView mediaView); - - // @optional -(void)mediaViewDidExitFullscreen:(FBMediaView * _Nonnull)mediaView; - [Export ("mediaViewDidExitFullscreen:")] - void MediaViewDidExitFullscreen (MediaView mediaView); - - // @optional -(void)mediaView:(FBMediaView * _Nonnull)mediaView videoVolumeDidChange:(float)volume; - [Export ("mediaView:videoVolumeDidChange:")] - void MediaViewVideoVolumeDidChange (MediaView mediaView, float volume); - - // @optional -(void)mediaViewVideoDidPause:(FBMediaView * _Nonnull)mediaView; - [Export ("mediaViewVideoDidPause:")] - void MediaViewVideoDidPause (MediaView mediaView); - - // @optional -(void)mediaViewVideoDidPlay:(FBMediaView * _Nonnull)mediaView; - [Export ("mediaViewVideoDidPlay:")] - void MediaViewVideoDidPlay (MediaView mediaView); - - // @optional -(void)mediaViewVideoDidComplete:(MediaView * _Nonnull)mediaView; - [Export ("mediaViewVideoDidComplete:")] - void MediaViewVideoDidComplete (MediaView mediaView); - } - - // @interface FBMediaViewVideoRenderer : UIView - [DisableDefaultCtor] - [BaseType (typeof (UIView), Name = "FBMediaViewVideoRenderer")] - interface MediaViewVideoRenderer { - [Export ("initWithFrame:")] - IntPtr Constructor (CGRect frame); - - // @property (nonatomic, assign, readonly) CGFloat aspectRatio; - [Export ("aspectRatio", ArgumentSemantic.Assign)] - nfloat AspectRatio { get; } - - // @property (nonatomic, assign, readonly) CMTime currentTime; - [Export ("currentTime", ArgumentSemantic.Assign)] - CMTime CurrentTime { get; } - - // @property (nonatomic, assign, readonly) CMTime duration; - [Export ("duration", ArgumentSemantic.Assign)] - CMTime Duration { get; } - - // @property (nonatomic, assign, readonly, getter=isPlaying) BOOL playing; - [Export ("isPlaying", ArgumentSemantic.Assign)] - bool IsPlaying { get; } - - // @property (nonatomic, assign) float volume; - [Export ("volume", ArgumentSemantic.Assign)] - float Volume { get; set; } - - // - (void)playVideo; - [Export ("playVideo")] - void PlayVideo (); - - // - (void)pauseVideo; - [Export ("pauseVideo")] - void PauseVideo (); - - // - (void)engageVideoSeek; - [Export ("engageVideoSeek")] - void EngageVideoSeek (); - - // - (void)disengageVideoSeek; - [Export ("disengageVideoSeek")] - void DisengageVideoSeek (); - - // - (void)seekVideoToTime:(CMTime)time; - [Export ("seekVideoToTime:")] - void SeekVideoToTime (CMTime time); - - // - (nullable id)addPeriodicTimeObserverForInterval:(CMTime)interval queue:(dispatch_queue_t) queue usingBlock:(void (^)(CMTime time))block; - [return: NullAllowed] - [Export ("addPeriodicTimeObserverForInterval:queue:usingBlock:")] - NSObject AddPeriodicTimeObserver (CMTime interval, DispatchQueue queue, Action block); - - // - (void)removeTimeObserver:(id)observer; - [Export ("removeTimeObserver:")] - void RemoveTimeObserver (NSObject observer); - - // - (void)videoDidChangeVolume; - [Export ("videoDidChangeVolume")] - void VideoDidChangeVolume (); - - // - (void)videoDidLoad; - [Export ("videoDidLoad")] - void VideoDidLoad (); - - // - (void)videoDidPause; - [Export ("videoDidPause")] - void VideoDidPause (); - - // - (void)videoDidPlay; - [Export ("videoDidPlay")] - void VideoDidPlay (); - - // - (void)videoDidEngageSeek; - [Export ("videoDidEngageSeek")] - void VideoDidEngageSeek (); - - // - (void)videoDidSeek; - [Export ("videoDidSeek")] - void VideoDidSeek (); - - // - (void)videoDidDisengageSeek; - [Export ("videoDidDisengageSeek")] - void VideoDidDisengageSeek (); - - // - (void)videoDidEnd; - [Export ("videoDidEnd")] - void VideoDidEnd (); - - // - (void)videoDidFailWithError:(NSError *)error; - [Export ("videoDidFailWithError:")] - void VideoDidFail (NSError error); - } - - [DisableDefaultCtor] - [BaseType (typeof (NativeAdBase), Name = "FBNativeAd")] - interface NativeAd { - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - INativeAdDelegate Delegate { get; set; } - - [Export ("initWithPlacementID:")] - IntPtr Constructor (string placementId); - - // - (void)registerViewForInteraction:(UIView *)view mediaView:(FBMediaView*) mediaView iconView:(nullable FBAdIconView *)iconView viewController:(nullable UIViewController *)viewController; - [Export ("registerViewForInteraction:mediaView:iconView:viewController:")] - void RegisterView (UIView view, MediaView mediaView, [NullAllowed] MediaView iconView, [NullAllowed] UIViewController viewController); - - // - (void)registerViewForInteraction:(UIView *)view mediaView:(FBMediaView*) mediaView iconView:(nullable FBAdIconView *)iconView viewController:(nullable UIViewController *)viewController clickableViews:(nullable NSArray *)clickableViews; - [Export ("registerViewForInteraction:mediaView:iconView:viewController:clickableViews:")] - void RegisterView (UIView view, MediaView mediaView, [NullAllowed] MediaView iconView, [NullAllowed] UIViewController viewController, [NullAllowed] UIView [] clickableViews); - - // -(void)registerViewForInteraction:(UIView * _Nonnull)view mediaView:(FBMediaView * _Nonnull)mediaView iconImageView:(UIImageView * _Nullable)iconImageView viewController:(UIViewController * _Nullable)viewController; - [Export ("registerViewForInteraction:mediaView:iconImageView:viewController:")] - void RegisterView (UIView view, MediaView mediaView, [NullAllowed] UIImageView iconImageView, [NullAllowed] UIViewController viewController); - - // -(void)registerViewForInteraction:(UIView * _Nonnull)view mediaView:(FBMediaView * _Nonnull)mediaView iconImageView:(UIImageView * _Nullable)iconImageView viewController:(UIViewController * _Nullable)viewController clickableViews:(NSArray * _Nullable)clickableViews; - [Export ("registerViewForInteraction:mediaView:iconImageView:viewController:clickableViews:")] - void RegisterView (UIView view, MediaView mediaView, [NullAllowed] UIImageView iconImageView, [NullAllowed] UIViewController viewController, [NullAllowed] UIView [] clickableViews); - - - - // -(void)downloadMedia; - [Export ("downloadMedia")] - void DownloadMedia (); - } - - interface INativeAdDelegate { } - - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "FBNativeAdDelegate")] - interface NativeAdDelegate - { - [Export ("nativeAdDidLoad:")] - void NativeAdDidLoad (NativeAd nativeAd); - - // @optional -(void)nativeAdDidDownloadMedia:(FBNativeAd * _Nonnull)nativeAd; - [Export ("nativeAdDidDownloadMedia:")] - void NativeAdDidDownloadMedia (NativeAd nativeAd); - - [Export ("nativeAd:didFailWithError:")] - void NativeAdDidFail (NativeAd nativeAd, NSError error); - - [Export ("nativeAdDidClick:")] - void NativeAdDidClick (NativeAd nativeAd); - - [Export ("nativeAdDidFinishHandlingClick:")] - void NativeAdDidFinishHandlingClick (NativeAd nativeAd); - - [Export("nativeAdWillLogImpression:")] - void NativeAdWillLogImpression(NativeAd nativeAd); - } - - // @interface FBNativeAdBase : NSObject - [DisableDefaultCtor] - [BaseType (typeof (NSObject), Name = "FBNativeAdBase")] - interface NativeAdBase { - // @property (readonly, copy, nonatomic) NSString * _Nonnull placementID; - [Export ("placementID")] - string PlacementId { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nullable headline; - [NullAllowed] - [Export ("headline")] - string Headline { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nullable linkDescription; - [NullAllowed] - [Export ("linkDescription")] - string LinkDescription { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nullable advertiserName; - [NullAllowed] - [Export ("advertiserName")] - string AdvertiserName { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nullable socialContext; - [NullAllowed] - [Export ("socialContext")] - string SocialContext { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nullable callToAction; - [NullAllowed] - [Export ("callToAction")] - string CallToAction { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nullable rawBodyText; - [NullAllowed] - [Export ("rawBodyText")] - string RawBodyText { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nullable bodyText; - [NullAllowed] - [Export ("bodyText")] - string BodyText { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nullable sponsoredTranslation; - [NullAllowed] - [Export ("sponsoredTranslation")] - string SponsoredTranslation { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nullable adTranslation; - [NullAllowed] - [Export ("adTranslation")] - string AdTranslation { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nullable promotedTranslation; - [NullAllowed] - [Export ("promotedTranslation")] - string PromotedTranslation { get; } - - // @property (readonly, nonatomic, strong) FBAdImage * _Nullable adChoicesIcon; - [NullAllowed] - [Export ("adChoicesIcon", ArgumentSemantic.Strong)] - AdImage AdChoicesIcon { get; } - - // @property (readonly, nonatomic, strong) UIImage * _Nullable iconImage; - [NullAllowed, Export ("iconImage", ArgumentSemantic.Strong)] - UIImage IconImage { get; } - - // @property (readonly, assign, nonatomic) CGFloat aspectRatio; - [Export ("aspectRatio")] - nfloat AspectRatio { get; } - - // @property (readonly, copy, nonatomic) NSURL * _Nullable adChoicesLinkURL; - [NullAllowed] - [Export ("adChoicesLinkURL", ArgumentSemantic.Copy)] - NSUrl AdChoicesLinkUrl { get; } - - // @property (readonly, copy, nonatomic) NSString * _Nullable adChoicesText; - [NullAllowed] - [Export ("adChoicesText")] - string AdChoicesText { get; } - - // @property (readonly, assign, nonatomic) FBAdFormatType adFormatType; - [Export ("adFormatType", ArgumentSemantic.Assign)] - AdFormatType AdFormatType { get; } - - // @property (readonly, nonatomic) FBNativeAdsCachePolicy mediaCachePolicy; - [Export ("mediaCachePolicy")] - NativeAdsCachePolicy MediaCachePolicy { get; } - - // @property (readonly, getter = isAdValid, nonatomic) BOOL adValid; - [Export ("isAdValid")] - bool IsAdValid { get; } - - // @property (readonly, getter = isRegistered, nonatomic) BOOL registered; - [Export ("isRegistered")] - bool IsRegistered { get; } - - // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; - [NullAllowed] - [Export ("extraHint", ArgumentSemantic.Strong)] - AdExtraHint ExtraHint { get; set; } - - // -(void)unregisterView; - [Export ("unregisterView")] - void UnregisterView (); - - // -(void)loadAd; - [Export ("loadAd")] - void LoadAd (); - - // -(void)loadAdWithMediaCachePolicy:(FBNativeAdsCachePolicy)mediaCachePolicy; - [Export ("loadAdWithMediaCachePolicy:")] - void LoadAd (NativeAdsCachePolicy mediaCachePolicy); - - // -(void)loadAdWithBidPayload:(NSString * _Nonnull)bidPayload; - [Export ("loadAdWithBidPayload:")] - void LoadAd (string bidPayload); - - // -(void)loadAdWithBidPayload:(NSString * _Nonnull)bidPayload mediaCachePolicy:(FBNativeAdsCachePolicy)mediaCachePolicy; - [Export ("loadAdWithBidPayload:mediaCachePolicy:")] - void LoadAd (string bidPayload, NativeAdsCachePolicy mediaCachePolicy); - - // +(instancetype _Nullable)nativeAdWithPlacementId:(NSString * _Nonnull)placementId bidPayload:(NSString * _Nonnull)bidPayload error:(NSError * _Nullable * _Nullable)error; - [Static] - [return: NullAllowed] - [Export ("nativeAdWithPlacementId:bidPayload:error:")] - NativeAdBase Create (string placementId, string bidPayload, [NullAllowed] out NSError error); - } - - // @interface FBNativeAdBaseView : UIView - [BaseType (typeof (UIView), Name = "FBNativeAdBaseView")] - interface NativeAdBaseView { - // @property (nonatomic, weak) UIViewController * _Nullable rootViewController; - [NullAllowed] - [Export ("rootViewController", ArgumentSemantic.Weak)] - UIViewController RootViewController { get; set; } - } - - // @interface FBNativeAdCollectionViewAdProvider : NSObject - [DisableDefaultCtor] - [BaseType (typeof (NSObject), Name = "FBNativeAdCollectionViewAdProvider")] - interface NativeAdCollectionViewAdProvider { - // @property (nonatomic, weak) id _Nullable delegate; - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - INativeAdDelegate Delegate { get; set; } - - // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; - [NullAllowed] - [Export ("extraHint", ArgumentSemantic.Strong)] - AdExtraHint ExtraHint { get; set; } - - // -(instancetype _Nonnull)initWithManager:(FBNativeAdsManager * _Nonnull)manager __attribute__((objc_designated_initializer)); - [DesignatedInitializer] - [Export ("initWithManager:")] - IntPtr Constructor (NativeAdsManager manager); - - // -(FBNativeAd * _Nonnull)collectionView:(UICollectionView * _Nonnull)collectionView nativeAdForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath; - [Export ("collectionView:nativeAdForRowAtIndexPath:")] - NativeAd GetNativeAdForRow (UICollectionView collectionView, NSIndexPath indexPath); - - // -(BOOL)isAdCellAtIndexPath:(NSIndexPath * _Nonnull)indexPath forStride:(NSUInteger)stride; - [Export ("isAdCellAtIndexPath:forStride:")] - bool IsAdCellAtIndexPath (NSIndexPath indexPath, nuint stride); - - // -(NSIndexPath * _Nonnull)adjustNonAdCellIndexPath:(NSIndexPath * _Nonnull)indexPath forStride:(NSUInteger)stride; - [return: NullAllowed] - [Export ("adjustNonAdCellIndexPath:forStride:")] - NSIndexPath AdjustNonAdCellIndexPath (NSIndexPath indexPath, nuint stride); - - // -(NSUInteger)adjustCount:(NSUInteger)count forStride:(NSUInteger)stride; - [Export ("adjustCount:forStride:")] - nuint AdjustCount (nuint count, nuint stride); - } - - // @interface FBNativeAdCollectionViewCellProvider : FBNativeAdCollectionViewAdProvider - [DisableDefaultCtor] - [BaseType (typeof (NativeAdCollectionViewAdProvider), Name = "FBNativeAdCollectionViewCellProvider")] - interface NativeAdCollectionViewCellProvider { - // -(instancetype _Nonnull)initWithManager:(FBNativeAdsManager * _Nonnull)manager forType:(FBNativeAdViewType)type; - [Export ("initWithManager:forType:")] - IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type); - - // -(instancetype _Nonnull)initWithManager:(FBNativeAdsManager * _Nonnull)manager forType:(FBNativeAdViewType)type forAttributes:(FBNativeAdViewAttributes * _Nonnull)attributes __attribute__((objc_designated_initializer)); - [DesignatedInitializer] - [Export ("initWithManager:forType:forAttributes:")] - IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type, NativeAdViewAttributes attributes); - - // -(UICollectionViewCell * _Nonnull)collectionView:(UICollectionView * _Nonnull)collectionView cellForItemAtIndexPath:(NSIndexPath * _Nonnull)indexPath; - [Export ("collectionView:cellForItemAtIndexPath:")] - UICollectionViewCell GetCell (UICollectionView collectionView, NSIndexPath indexPath); - - // -(CGFloat)collectionView:(UICollectionView * _Nonnull)collectionView heightForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath; - [Export ("collectionView:heightForRowAtIndexPath:")] - nfloat GetHeightForRow (UICollectionView collectionView, NSIndexPath indexPath); - } - - delegate UIView NativeAdScrollViewViewProviderHandler (NativeAd nativeAd, nuint position); - - // @interface FBNativeAdScrollView : UIView - [DisableDefaultCtor] - [BaseType (typeof (UIView), Name = "FBNativeAdScrollView")] - interface NativeAdScrollView { - // @property (readonly, assign, nonatomic) NSUInteger maximumNativeAdCount; - [Export ("maximumNativeAdCount", ArgumentSemantic.Assign)] - nuint MaximumNativeAdCount { get; } - - // @property (getter = isAnimationEnabled, assign, nonatomic) BOOL animationEnabled; - [Export ("animationEnabled")] - bool AnimationEnabled { [Bind ("isAnimationEnabled")] get; set; } - - // @property (assign, nonatomic) CGFloat xInset; - [Export ("xInset", ArgumentSemantic.Assign)] - nfloat XInset { get; set; } - - // @property (getter = isAdPersistenceEnabled, assign, nonatomic) BOOL adPersistenceEnabled; - [Export ("adPersistenceEnabled")] - bool AdPersistenceEnabled { [Bind ("isAdPersistenceEnabled")] get; set; } - - // @property (nonatomic, weak) UIViewController * viewController; - [NullAllowed] - [Export ("rootViewController", ArgumentSemantic.Weak)] - UIViewController RootViewController { get; set; } - - // @property (nonatomic, weak) id delegate; - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - INativeAdDelegate Delegate { get; set; } - - // -(instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager withType:(FBNativeAdViewType)type; - [Export ("initWithNativeAdsManager:withType:")] - IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type); - - // -(instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager withType:(FBNativeAdViewType)type withAttributes:(FBNativeAdViewAttributes *)attributes; - [Export ("initWithNativeAdsManager:withType:withAttributes:")] - IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type, NativeAdViewAttributes attributes); - - // -(instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager withType:(FBNativeAdViewType)type withAttributes:(FBNativeAdViewAttributes *)attributes withMaximum:(NSUInteger)maximumNativeAdCount; - [Export ("initWithNativeAdsManager:withType:withAttributes:withMaximum:")] - IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type, NativeAdViewAttributes attributes, nuint maximumNativeAdCount); - - // -(instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager withViewProvider:(UIView *(^)(FBNativeAd *, NSUInteger))childViewProvider; - [Export ("initWithNativeAdsManager:withViewProvider:")] - IntPtr Constructor (NativeAdsManager manager, NativeAdScrollViewViewProviderHandler childViewProviderHandler); - - // -(instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager withViewProvider:(UIView *(^)(FBNativeAd *, NSUInteger))childViewProvider withMaximum:(NSUInteger)maximumNativeAdCount; - [DesignatedInitializer] - [Export ("initWithNativeAdsManager:withViewProvider:withMaximum:")] - IntPtr Constructor (NativeAdsManager manager, NativeAdScrollViewViewProviderHandler childViewProviderHandler, nuint maximumNativeAdCount); - } - - interface INativeAdsManagerDelegate { } - - // @protocol FBNativeAdsManagerDelegate - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "FBNativeAdsManagerDelegate")] - interface NativeAdsManagerDelegate { - // @required -(void)nativeAdsLoaded; - [Abstract] - [Export ("nativeAdsLoaded")] - void NativeAdsLoaded (); - - // @required -(void)nativeAdsFailedToLoadWithError:(NSError *)error; - [Abstract] - [Export ("nativeAdsFailedToLoadWithError:")] - void NativeAdsFailedToLoad (NSError error); - } - - // @interface FBNativeAdsManager : NSObject - [DisableDefaultCtor] - [BaseType (typeof (NSObject), Name = "FBNativeAdsManager")] - interface NativeAdsManager - { - // @property (nonatomic, weak) id delegate; - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - INativeAdsManagerDelegate Delegate { get; set; } - - // @property (assign, nonatomic) FBNativeAdsCachePolicy mediaCachePolicy; - [Export ("mediaCachePolicy", ArgumentSemantic.Assign)] - NativeAdsCachePolicy MediaCachePolicy { get; set; } - - // @property (readonly, assign, nonatomic) NSUInteger uniqueNativeAdCount; - [Export ("uniqueNativeAdCount", ArgumentSemantic.Assign)] - nuint UniqueNativeAdCount { get; } - - // @property (readonly, getter = isValid, assign, nonatomic) BOOL valid; - [Export ("valid")] - bool Valid { [Bind ("isValid")] get; } - - // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; - [NullAllowed] - [Export ("extraHint", ArgumentSemantic.Strong)] - AdExtraHint ExtraHint { get; set; } - - // -(instancetype)initWithPlacementID:(NSString *)placementID forNumAdsRequested:(NSUInteger)numAdsRequested; - [DesignatedInitializer] - [Export ("initWithPlacementID:forNumAdsRequested:")] - IntPtr Constructor (string placementId, nuint numAdsRequested); - - // -(void)loadAds; - [Export ("loadAds")] - void LoadAds (); - - // -(void)disableAutoRefresh; - [Export ("disableAutoRefresh")] - void DisableAutoRefresh (); - - // -(FBNativeAd *)nextNativeAd; - [Export ("nextNativeAd", ArgumentSemantic.Strong)] - [NullAllowed] - NativeAd NextNativeAd { get; } - } - - // @interface FBNativeAdTableViewAdProvider : NSObject - [DisableDefaultCtor] - [BaseType (typeof (NSObject), Name = "FBNativeAdTableViewAdProvider")] - interface NativeAdTableViewAdProvider { - // @property (nonatomic, weak) id delegate; - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - INativeAdDelegate Delegate { get; set; } - - // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; - [NullAllowed] - [Export ("extraHint", ArgumentSemantic.Strong)] - AdExtraHint ExtraHint { get; set; } - - // -(instancetype)initWithManager:(FBNativeAdsManager *)manager; - [DesignatedInitializer] - [Export ("initWithManager:")] - IntPtr Constructor (NativeAdsManager manager); - - // -(FBNativeAd *)tableView:(UITableView *)tableView nativeAdForRowAtIndexPath:(NSIndexPath *)indexPath; - [Export ("tableView:nativeAdForRowAtIndexPath:")] - NativeAd GetNativeAd (UITableView tableView, NSIndexPath indexPath); - - // -(BOOL)isAdCellAtIndexPath:(NSIndexPath *)indexPath forStride:(NSUInteger)stride; - [Export ("isAdCellAtIndexPath:forStride:")] - bool IsAdCell (NSIndexPath indexPath, nuint stride); - - // -(NSIndexPath *)adjustNonAdCellIndexPath:(NSIndexPath *)indexPath forStride:(NSUInteger)stride; - [return: NullAllowed] - [Export ("adjustNonAdCellIndexPath:forStride:")] - NSIndexPath AdjustNonAdCell (NSIndexPath indexPath, nuint stride); - - // -(NSUInteger)adjustCount:(NSUInteger)count forStride:(NSUInteger)stride; - [Export ("adjustCount:forStride:")] - nuint AdjustCount (nuint count, nuint stride); - } - - // @interface FBNativeAdTableViewCellProvider : FBNativeAdTableViewAdProvider - [DisableDefaultCtor] - [BaseType (typeof (NativeAdTableViewAdProvider), Name = "FBNativeAdTableViewCellProvider")] - interface NativeAdTableViewCellProvider : IUITableViewDataSource - { - - // -(instancetype)initWithManager:(FBNativeAdsManager *)manager forType:(FBNativeAdViewType)type; - [Export ("initWithManager:forType:")] - IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type); - - // -(instancetype)initWithManager:(FBNativeAdsManager *)manager forType:(FBNativeAdViewType)type forAttributes:(FBNativeAdViewAttributes *)attributes; - [DesignatedInitializer] - [Export ("initWithManager:forType:forAttributes:")] - IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type, NativeAdViewAttributes attributes); - - // -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; - [Export ("tableView:cellForRowAtIndexPath:")] - new UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath); - - // -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath; - [Export ("tableView:heightForRowAtIndexPath:")] - nfloat GetHeight (UITableView tableView, NSIndexPath indexPath); - - // -(CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath; - [Export ("tableView:estimatedHeightForRowAtIndexPath:")] - nfloat GetEstimateHeight (UITableView tableView, NSIndexPath indexPath); - } - - // @interface FBNativeAdView : UIView - [DisableDefaultCtor] - [BaseType (typeof (NativeAdBaseView), Name = "FBNativeAdView")] - interface NativeAdView - { - // @property (readonly, assign, nonatomic) FBNativeAdViewType type; - [Export ("type", ArgumentSemantic.Assign)] - NativeAdViewType Type { get; } - - // +(instancetype _Nonnull)nativeAdViewWithNativeAd:(FBNativeAd * _Nonnull)nativeAd; - [Static] - [Export ("nativeAdViewWithNativeAd:")] - NativeAdView Create (NativeAd nativeAd); - - // +(instancetype _Nonnull)nativeAdViewWithNativeAd:(FBNativeAd * _Nonnull)nativeAd withAttributes:(FBNativeAdViewAttributes * _Nonnull)attributes; - [Static] - [Export ("nativeAdViewWithNativeAd:withAttributes:")] - NativeAdView Create (NativeAd nativeAd, NativeAdViewAttributes attributes); - - // +(instancetype)nativeAdViewWithNativeAd:(FBNativeAd *)nativeAd withType:(FBNativeAdViewType)type; - [Static] - [Export ("nativeAdViewWithNativeAd:withType:")] - NativeAdView Create (NativeAd nativeAd, NativeAdViewType type); - - [Obsolete ("Use the Create method instead. This will be removed in future versions.")] - [Static] - [Wrap ("Create (nativeAd, type)")] - NativeAdView From (NativeAd nativeAd, NativeAdViewType type); - - // +(instancetype)nativeAdViewWithNativeAd:(FBNativeAd *)nativeAd withType:(FBNativeAdViewType)type withAttributes:(FBNativeAdViewAttributes *)attributes; - [Static] - [Export ("nativeAdViewWithNativeAd:withType:withAttributes:")] - NativeAdView Create (NativeAd nativeAd, NativeAdViewType type, NativeAdViewAttributes attributes); - - [Obsolete ("Use the Create method instead. This will be removed in future versions.")] - [Static] - [Wrap ("Create (nativeAd, type, attributes)")] - NativeAdView From (NativeAd nativeAd, NativeAdViewType type, NativeAdViewAttributes attributes); - } - - // @interface FBNativeAdViewAttributes : NSObject - [BaseType (typeof (NSObject), Name = "FBNativeAdViewAttributes")] - interface NativeAdViewAttributes : INSCopying - { - // - (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *) dict; - [Export ("initWithDictionary:")] - [DesignatedInitializer] - IntPtr Constructor (NSDictionary dictionary); - - // @property (copy, nonatomic) UIColor * backgroundColor; - [NullAllowed] - [Export ("backgroundColor", ArgumentSemantic.Copy)] - UIColor BackgroundColor { get; set; } - - // @property (copy, nonatomic) UIColor * titleColor; - [NullAllowed] - [Export ("titleColor", ArgumentSemantic.Copy)] - UIColor TitleColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nullable advertiserNameColor; - [NullAllowed] - [Export ("advertiserNameColor", ArgumentSemantic.Copy)] - UIColor AdvertiserNameColor { get; set; } - - // @property (copy, nonatomic) UIColor * _Nullable adChoicesForegroundColor; - [NullAllowed] - [Export ("adChoicesForegroundColor", ArgumentSemantic.Copy)] - UIColor AdChoicesForegroundColor { get; set; } - - // @property (copy, nonatomic) UIFont * titleFont; - [NullAllowed] - [Export ("titleFont", ArgumentSemantic.Copy)] - UIFont TitleFont { get; set; } - - // @property (copy, nonatomic) UIColor * descriptionColor; - [NullAllowed] - [Export ("descriptionColor", ArgumentSemantic.Copy)] - UIColor DescriptionColor { get; set; } - - // @property (copy, nonatomic) UIFont * descriptionFont; - [NullAllowed] - [Export ("descriptionFont", ArgumentSemantic.Copy)] - UIFont DescriptionFont { get; set; } - - // @property (copy, nonatomic) UIColor * buttonColor; - [NullAllowed] - [Export ("buttonColor", ArgumentSemantic.Copy)] - UIColor ButtonColor { get; set; } - - // @property (copy, nonatomic) UIColor * buttonTitleColor; - [NullAllowed] - [Export ("buttonTitleColor", ArgumentSemantic.Copy)] - UIColor ButtonTitleColor { get; set; } - - // @property (copy, nonatomic) UIFont * buttonTitleFont; - [NullAllowed] - [Export ("buttonTitleFont", ArgumentSemantic.Copy)] - UIFont ButtonTitleFont { get; set; } - - // @property (copy, nonatomic) UIColor * buttonBorderColor; - [Export ("buttonBorderColor", ArgumentSemantic.Copy)] - UIColor ButtonBorderColor { get; set; } - - // @property (getter = isAutoplayEnabled, assign, nonatomic) BOOL autoplayEnabled __attribute__((deprecated("This attribute is no longer used."))); - [Obsolete ("This attribute is no longer used.")] - [Export ("autoplayEnabled")] - bool AutoplayEnabled { [Bind ("isAutoplayEnabled")] get; set; } - - //////////////////////////////////////////////////////////////////////// - // From @interface FBNativeAdView (FBNativeAdViewAttributes) Category // - //////////////////////////////////////////////////////////////////////// - - // +(instancetype)defaultAttributesForType:(FBNativeAdViewType)type; - [Static] - [Export ("defaultAttributesForType:")] - NativeAdViewAttributes DefaultAttributes (NativeAdViewType type); - } - - // @interface FBNativeBannerAd : FBNativeAdBase - [DisableDefaultCtor] - [BaseType (typeof (NativeAdBase), Name = "FBNativeBannerAd")] - interface NativeBannerAd { - // @property (nonatomic, weak) id _Nullable delegate; - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - INativeBannerAdDelegate Delegate { get; set; } - - // -(instancetype _Nonnull)initWithPlacementID:(NSString * _Nonnull)placementID; - [Export ("initWithPlacementID:")] - IntPtr Constructor (string placementId); - - // -(void)registerViewForInteraction:(UIView * _Nonnull)view iconView:(FBAdIconView * _Nonnull)iconView viewController:(UIViewController * _Nullable)viewController; - [Export ("registerViewForInteraction:iconView:viewController:")] - void RegisterView (UIView view, MediaView iconView, [NullAllowed] UIViewController viewController); - - // -(void)registerViewForInteraction:(UIView * _Nonnull)view iconView:(FBAdIconView * _Nonnull)iconView viewController:(UIViewController * _Nullable)viewController clickableViews:(NSArray * _Nullable)clickableViews; - [Export ("registerViewForInteraction:iconView:viewController:clickableViews:")] - void RegisterView (UIView view, MediaView iconView, [NullAllowed] UIViewController viewController, [NullAllowed] UIView [] clickableViews); - - // -(void)registerViewForInteraction:(UIView * _Nonnull)view iconImageView:(UIImageView * _Nonnull)iconImageView viewController:(UIViewController * _Nullable)viewController; - [Export("registerViewForInteraction:iconImageView:viewController:")] - void RegisterView (UIView view, UIImageView iconImageView, [NullAllowed] UIViewController viewController); - - // -(void)registerViewForInteraction:(UIView * _Nonnull)view iconImageView:(UIImageView * _Nonnull)iconImageView viewController:(UIViewController * _Nullable)viewController clickableViews:(NSArray * _Nullable)clickableViews; - [Export("registerViewForInteraction:iconImageView:viewController:clickableViews:")] - void RegisterView(UIView view, UIImageView iconImageView, [NullAllowed] UIViewController viewController, [NullAllowed] UIView[] clickableViews); - - // -(void)downloadMedia; - [Export ("downloadMedia")] - void DownloadMedia (); - } - - interface INativeBannerAdDelegate { } - - // @protocol FBNativeBannerAdDelegate - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "FBNativeBannerAdDelegate")] - interface NativeBannerAdDelegate { - // @optional -(void)nativeBannerAdDidLoad:(FBNativeBannerAd * _Nonnull)nativeBannerAd; - [Export ("nativeBannerAdDidLoad:")] - void NativeBannerAdDidLoad (NativeBannerAd nativeBannerAd); - - // @optional -(void)nativeBannerAdDidDownloadMedia:(FBNativeBannerAd * _Nonnull)nativeBannerAd; - [Export ("nativeBannerAdDidDownloadMedia:")] - void NativeBannerAdDidDownloadMedia (NativeBannerAd nativeBannerAd); - - // @optional -(void)nativeBannerAdWillLogImpression:(FBNativeBannerAd * _Nonnull)nativeBannerAd; - [Export ("nativeBannerAdWillLogImpression:")] - void NativeBannerAdWillLogImpression (NativeBannerAd nativeBannerAd); - - // @optional -(void)nativeBannerAd:(FBNativeBannerAd * _Nonnull)nativeBannerAd didFailWithError:(NSError * _Nonnull)error; - [Export ("nativeBannerAd:didFailWithError:")] - void NativeBannerAdDidFail (NativeBannerAd nativeBannerAd, NSError error); - - // @optional -(void)nativeBannerAdDidClick:(FBNativeBannerAd * _Nonnull)nativeBannerAd; - [Export ("nativeBannerAdDidClick:")] - void NativeBannerAdDidClick (NativeBannerAd nativeBannerAd); - - // @optional -(void)nativeBannerAdDidFinishHandlingClick:(FBNativeBannerAd * _Nonnull)nativeBannerAd; - [Export ("nativeBannerAdDidFinishHandlingClick:")] - void NativeBannerAdDidFinishHandlingClick (NativeBannerAd nativeBannerAd); - } - - // @interface FBNativeBannerAdView : FBNativeAdBaseView - [DisableDefaultCtor] - [BaseType (typeof (NativeAdBaseView), Name = "FBNativeBannerAdView")] - interface NativeBannerAdView { - // @property (readonly, assign, nonatomic) FBNativeBannerAdViewType type; - [Export ("type", ArgumentSemantic.Assign)] - NativeBannerAdViewType Type { get; } - - // +(instancetype _Nonnull)nativeBannerAdViewWithNativeBannerAd:(FBNativeBannerAd * _Nonnull)nativeBannerAd withType:(FBNativeBannerAdViewType)type; - [Static] - [Export ("nativeBannerAdViewWithNativeBannerAd:withType:")] - NativeBannerAdView Create (NativeBannerAd nativeBannerAd, NativeBannerAdViewType type); - - [Obsolete ("Use the Create method instead. This will be removed in future versions.")] - [Static] - [Wrap ("Create (nativeBannerAd, type)")] - NativeBannerAdView From (NativeBannerAd nativeBannerAd, NativeBannerAdViewType type); - - // +(instancetype _Nonnull)nativeBannerAdViewWithNativeBannerAd:(FBNativeBannerAd * _Nonnull)nativeBannerAd withType:(FBNativeBannerAdViewType)type withAttributes:(FBNativeAdViewAttributes * _Nonnull)attributes; - [Static] - [Export ("nativeBannerAdViewWithNativeBannerAd:withType:withAttributes:")] - NativeBannerAdView Create (NativeBannerAd nativeBannerAd, NativeBannerAdViewType type, NativeAdViewAttributes attributes); - - [Obsolete ("Use the Create method instead. This will be removed in future versions.")] - [Static] - [Wrap ("Create (nativeBannerAd, type, attributes)")] - NativeBannerAdView From (NativeBannerAd nativeBannerAd, NativeBannerAdViewType type, NativeAdViewAttributes attributes); - - ////////////////////////////////////////////////////////////////////////////// - // From @interface FBNativeBannerAdView (FBNativeAdViewAttributes) Category // - ////////////////////////////////////////////////////////////////////////////// - - // +(instancetype _Nonnull)defaultAttributesForBannerType:(FBNativeBannerAdViewType)type; - [Static] - [Export ("defaultAttributesForBannerType:")] - NativeAdViewAttributes Create (NativeBannerAdViewType type); - } - - // @interface FBRewardedVideoAd : NSObject - [DisableDefaultCtor] - [BaseType (typeof (NSObject), Name = "FBRewardedVideoAd")] - interface RewardedVideoAd - { - // @property (readonly, copy, nonatomic) NSString * _Nonnull placementID; - [Export ("placementID")] - string PlacementId { get; } - - // @property (readonly, assign, nonatomic) CMTime duration; - [Export ("duration", ArgumentSemantic.Assign)] - CMTime Duration { get; } - - // @property (nonatomic, weak) id _Nullable delegate; - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - IRewardedVideoAdDelegate Delegate { get; set; } - - // @property (readonly, getter = isAdValid, nonatomic) BOOL adValid; - [Export ("adValid")] - bool AdValid { [Bind ("isAdValid")] get; } - - // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; - [NullAllowed] - [Export ("extraHint", ArgumentSemantic.Strong)] - AdExtraHint ExtraHint { get; set; } - - // @property (copy, nonatomic) FBAdExperienceConfig * _Nullable adExperienceConfig; - [NullAllowed, Export ("adExperienceConfig", ArgumentSemantic.Copy)] - AdExperienceConfig AdExperienceConfig { get; set; } - - // -(instancetype _Nonnull)initWithPlacementID:(NSString * _Nonnull)placementID; - [Export ("initWithPlacementID:")] - IntPtr Constructor (string placementId); - - // -(instancetype _Nonnull)initWithPlacementID:(NSString * _Nonnull)placementID withUserID:(NSString * _Nullable)userID withCurrency:(NSString * _Nullable)currency; - [Export ("initWithPlacementID:withUserID:withCurrency:")] - IntPtr Constructor (string placementId, [NullAllowed] string userId, [NullAllowed] string currency); - - // -(void)loadAd; - [Export ("loadAd")] - void LoadAd (); - - // - (void) loadAdWithBidPayload:(NSString*) bidPayload; - [Export ("loadAdWithBidPayload:")] - void LoadAd (string bidPayload); - - // - (BOOL)setRewardDataWithUserID:(NSString *)userID withCurrency:(NSString*) currency; - [Export ("setRewardDataWithUserID:withCurrency:")] - bool SetRewardData (string userId, string currency); - - // -(BOOL)showAdFromRootViewController:(UIViewController * _Nonnull)rootViewController; - [Export ("showAdFromRootViewController:")] - bool ShowAd (UIViewController rootViewController); - - // -(BOOL)showAdFromRootViewController:(UIViewController * _Nonnull)rootViewController animated:(BOOL)flag; - [Export ("showAdFromRootViewController:animated:")] - bool ShowAd (UIViewController rootViewController, bool flag); - } - - interface IRewardedVideoAdDelegate { } - - // @protocol FBRewardedVideoAdDelegate - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "FBRewardedVideoAdDelegate")] - interface RewardedVideoAdDelegate - { - // @optional -(void)rewardedVideoAdDidClick:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; - [Export ("rewardedVideoAdDidClick:")] - void RewardedVideoAdDidClick (RewardedVideoAd rewardedVideoAd); - - // @optional -(void)rewardedVideoAdDidLoad:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; - [Export ("rewardedVideoAdDidLoad:")] - void RewardedVideoAdDidLoad (RewardedVideoAd rewardedVideoAd); - - // @optional -(void)rewardedVideoAdDidClose:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; - [Export ("rewardedVideoAdDidClose:")] - void RewardedVideoAdDidClose (RewardedVideoAd rewardedVideoAd); - - // @optional -(void)rewardedVideoAdWillClose:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; - [Export ("rewardedVideoAdWillClose:")] - void RewardedVideoAdWillClose (RewardedVideoAd rewardedVideoAd); - - // @optional -(void)rewardedVideoAd:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd didFailWithError:(NSError * _Nonnull)error; - [Export ("rewardedVideoAd:didFailWithError:")] - void RewardedVideoAdDidFail (RewardedVideoAd rewardedVideoAd, NSError error); - - // @optional -(void)rewardedVideoAdVideoComplete:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; - [Export ("rewardedVideoAdVideoComplete:")] - void RewardedVideoAdVideoComplete (RewardedVideoAd rewardedVideoAd); - - // @optional -(void)rewardedVideoAdWillLogImpression:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; - [Export ("rewardedVideoAdWillLogImpression:")] - void RewardedVideoAdWillLogImpression (RewardedVideoAd rewardedVideoAd); - - // @optional -(void)rewardedVideoAdServerSuccess:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; - [Export ("rewardedVideoAdServerRewardDidSucceed:")] - void RewardedVideoAdServerRewardDidSuccess (RewardedVideoAd rewardedVideoAd); - - // @optional -(void)rewardedVideoAdServerFailed:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; - [Export ("rewardedVideoAdServerRewardDidFail:")] - void RewardedVideoAdServerRewardDidFail (RewardedVideoAd rewardedVideoAd); - } - - // @interface FBNativeAdViewTag (UIView) - [Category] - [BaseType (typeof (UIView))] - interface UIView_NativeAdViewTag { - // @property (assign, nonatomic) FBNativeAdViewTag nativeAdViewTag; - [Export ("nativeAdViewTag")] - NativeAdViewTag GetNativeAdViewTag (); - - [Export ("setNativeAdViewTag:")] - void SetNativeAdViewTag (NativeAdViewTag nativeAdViewTag); - } -} diff --git a/Facebook.iOS/source/AudienceNetwork/AudienceNetwork.csproj b/Facebook.iOS/source/AudienceNetwork/AudienceNetwork.csproj deleted file mode 100644 index 600e291a..00000000 --- a/Facebook.iOS/source/AudienceNetwork/AudienceNetwork.csproj +++ /dev/null @@ -1,73 +0,0 @@ - - - - Xamarin.iOS10 - true - Facebook.AudienceNetwork - Facebook.AudienceNetwork - 1.0.0.0 - 5.10.1 - Resources - true - true - - - - Xamarin.Facebook.AudienceNetwork.iOS - Facebook Audience Network SDK for Xamarin iOS - C# bindings for Facebook Audience Network's official SDK - C# bindings for Facebook Audience Network's official SDK - Microsoft - Microsoft - © Microsoft Corporation. All rights reserved. - https://go.microsoft.com/fwlink/?linkid=865579 - https://go.microsoft.com/fwlink/?linkid=865583 - true - 5.10.1 - - - - - - - - - - - - - - - - - FBAudienceNetwork.framework - - - - - - - Framework - True - AudioToolbox AVFoundation CoreGraphics CoreImage CoreMedia OpenGLES Security StoreKit UIKit Foundation CoreVideo QuartzCore - AdSupport CoreMotion SafariServices WebKit - -ObjC -lc++ -lxml2 - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Facebook.iOS/source/AudienceNetwork/Enums.cs b/Facebook.iOS/source/AudienceNetwork/Enums.cs deleted file mode 100644 index 10d20a1c..00000000 --- a/Facebook.iOS/source/AudienceNetwork/Enums.cs +++ /dev/null @@ -1,303 +0,0 @@ -// -// StructsAndEnums.cs: Bindings to the Facebook iOS SDK. -// -// Authors: -// Miguel de Icaza (miguel@xamarin.com) -// Alex Soto (alex.soto@xamarin.com) -// Israel Soto (israel.soto@xamarin.com) -// - -using ObjCRuntime; -using Foundation; -using System; - -namespace Facebook.AudienceNetwork -{ - public enum AdExtraHintKeyword { - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordAccessories; - [Field ("FBAdExtraHintKeywordAccessories", "__Internal")] - Accessories, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordArtHistory; - [Field ("FBAdExtraHintKeywordArtHistory", "__Internal")] - ArtHistory, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordAutomotive; - [Field ("FBAdExtraHintKeywordAutomotive", "__Internal")] - Automotive, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBeauty; - [Field ("FBAdExtraHintKeywordBeauty", "__Internal")] - Beauty, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBiology; - [Field ("FBAdExtraHintKeywordBiology", "__Internal")] - Biology, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBoardGames; - [Field ("FBAdExtraHintKeywordBoardGames", "__Internal")] - BoardGames, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBusinessSoftware; - [Field ("FBAdExtraHintKeywordBusinessSoftware", "__Internal")] - BusinessSoftware, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBuyingSellingHomes; - [Field ("FBAdExtraHintKeywordBuyingSellingHomes", "__Internal")] - BuyingSellingHomes, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordCats; - [Field ("FBAdExtraHintKeywordCats", "__Internal")] - Cats, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordCelebrities; - [Field ("FBAdExtraHintKeywordCelebrities", "__Internal")] - Celebrities, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordClothing; - [Field ("FBAdExtraHintKeywordClothing", "__Internal")] - Clothing, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordComicBooks; - [Field ("FBAdExtraHintKeywordComicBooks", "__Internal")] - ComicBooks, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordDesktopVideo; - [Field ("FBAdExtraHintKeywordDesktopVideo", "__Internal")] - DesktopVideo, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordDogs; - [Field ("FBAdExtraHintKeywordDogs", "__Internal")] - Dogs, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordEducation; - [Field ("FBAdExtraHintKeywordEducation", "__Internal")] - Education, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordEmail; - [Field ("FBAdExtraHintKeywordEmail", "__Internal")] - Email, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordEntertainment; - [Field ("FBAdExtraHintKeywordEntertainment", "__Internal")] - Entertainment, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFamilyParenting; - [Field ("FBAdExtraHintKeywordFamilyParenting", "__Internal")] - FamilyParenting, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFashion; - [Field ("FBAdExtraHintKeywordFashion", "__Internal")] - Fashion, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFineArt; - [Field ("FBAdExtraHintKeywordFineArt", "__Internal")] - FineArt, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFoodDrink; - [Field ("FBAdExtraHintKeywordFoodDrink", "__Internal")] - FoodDrink, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFrenchCuisine; - [Field ("FBAdExtraHintKeywordFrenchCuisine", "__Internal")] - FrenchCuisine, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordGovernment; - [Field ("FBAdExtraHintKeywordGovernment", "__Internal")] - Government, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHealthFitness; - [Field ("FBAdExtraHintKeywordHealthFitness", "__Internal")] - HealthFitness, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHobbies; - [Field ("FBAdExtraHintKeywordHobbies", "__Internal")] - Hobbies, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHomeGarden; - [Field ("FBAdExtraHintKeywordHomeGarden", "__Internal")] - HomeGarden, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHumor; - [Field ("FBAdExtraHintKeywordHumor", "__Internal")] - Humor, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordInternetTechnology; - [Field ("FBAdExtraHintKeywordInternetTechnology", "__Internal")] - InternetTechnology, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLargeAnimals; - [Field ("FBAdExtraHintKeywordLargeAnimals", "__Internal")] - LargeAnimals, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLaw; - [Field ("FBAdExtraHintKeywordLaw", "__Internal")] - Law, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLegalIssues; - [Field ("FBAdExtraHintKeywordLegalIssues", "__Internal")] - LegalIssues, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLiterature; - [Field ("FBAdExtraHintKeywordLiterature", "__Internal")] - Literature, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordMarketing; - [Field ("FBAdExtraHintKeywordMarketing", "__Internal")] - Marketing, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordMovies; - [Field ("FBAdExtraHintKeywordMovies", "__Internal")] - Movies, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordMusic; - [Field ("FBAdExtraHintKeywordMusic", "__Internal")] - Music, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordNews; - [Field ("FBAdExtraHintKeywordNews", "__Internal")] - News, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPersonalFinance; - [Field ("FBAdExtraHintKeywordPersonalFinance", "__Internal")] - PersonalFinance, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPets; - [Field ("FBAdExtraHintKeywordPets", "__Internal")] - Pets, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPhotography; - [Field ("FBAdExtraHintKeywordPhotography", "__Internal")] - Photography, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPolitics; - [Field ("FBAdExtraHintKeywordPolitics", "__Internal")] - Politics, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordRealEstate; - [Field ("FBAdExtraHintKeywordRealEstate", "__Internal")] - RealEstate, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordRoleplayingGames; - [Field ("FBAdExtraHintKeywordRoleplayingGames", "__Internal")] - RoleplayingGames, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordScience; - [Field ("FBAdExtraHintKeywordScience", "__Internal")] - Science, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordShopping; - [Field ("FBAdExtraHintKeywordShopping", "__Internal")] - Shopping, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordSociety; - [Field ("FBAdExtraHintKeywordSociety", "__Internal")] - Society, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordSports; - [Field ("FBAdExtraHintKeywordSports", "__Internal")] - Sports, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordTechnology; - [Field ("FBAdExtraHintKeywordTechnology", "__Internal")] - Technology, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordTelevision; - [Field ("FBAdExtraHintKeywordTelevision", "__Internal")] - Television, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordTravel; - [Field ("FBAdExtraHintKeywordTravel", "__Internal")] - Travel, - - // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordVideoComputerGames; - [Field ("FBAdExtraHintKeywordVideoComputerGames", "__Internal")] - VideoComputerGames - } - - [Native] - public enum AdLogLevel : long - { - None, - Notification, - Error, - Warning, - Log, - Debug, - Verbose - } - - [Native] - public enum AdTestAdType : long - { - Default, - Img16x9AppInstall, - Img16x9Link, - VidHD16x9_46sAppInstall, - VidHD16x9_46sLink, - VidHD16x9_15sAppInstall, - VidHD16x9_15sLink, - VidHD9x16_39sAppInstall, - VidHD9x16_39sLink, - CarouselImgSquareAppInstall, - CarouselImgSquareLink, - CarouselVidSquareLink, - Playable - - } - - [Native] - public enum AdFormatTypeName : long { - Unknown = 0, - Banner, - Interstitial, - Native, - NativeBanner, - RewardedVideo - } - - [Native] - public enum AdFormatType : long { - Unknown = 0, - Image, - Video, - Carousel - } - - [Native] - public enum NativeAdsCachePolicy : long - { - None, - All - } - - [Native] - public enum NativeAdViewType : long - { - GenericHeight300 = 3, - GenericHeight400 = 4, - Dynamic = 6 - } - - [Native] - public enum NativeBannerAdViewType : long - { - GenericHeight100 = 1, - GenericHeight120 = 2, - GenericHeight50 = 5 - } - - [Native] - public enum NativeAdViewTag : ulong - { - Icon = 5, - Title, - CoverImage, - Subtitle, - Body, - CallToAction, - SocialContext, - ChoicesIcon, - Media - } -} diff --git a/Facebook.iOS/source/AudienceNetwork/License.md b/Facebook.iOS/source/AudienceNetwork/License.md deleted file mode 100644 index 5197f9c7..00000000 --- a/Facebook.iOS/source/AudienceNetwork/License.md +++ /dev/null @@ -1,15 +0,0 @@ -### Xamarin Component for Facebook Audience Network iOS SDK - -**The MIT License (MIT)** - -Copyright (c) .NET Foundation Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -20160923 - - diff --git a/Facebook.iOS/source/AudienceNetwork/Structs.cs b/Facebook.iOS/source/AudienceNetwork/Structs.cs deleted file mode 100644 index 321eb5d7..00000000 --- a/Facebook.iOS/source/AudienceNetwork/Structs.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -using CoreGraphics; - -namespace Facebook.AudienceNetwork { - [StructLayout (LayoutKind.Sequential)] - public struct AdSize { - public CGSize Size; - - public AdSize (CGSize size) - { - Size = size; - } - } - - [StructLayout (LayoutKind.Sequential)] - public struct AdStarRating { - public nfloat Value; - public nint Scale; - - public AdStarRating (nfloat value, nint scale) - { - Value = value; - Scale = scale; - } - } -} diff --git a/Facebook.iOS/source/AudienceNetwork/extensions.cs b/Facebook.iOS/source/AudienceNetwork/extensions.cs deleted file mode 100644 index 7dfe96d5..00000000 --- a/Facebook.iOS/source/AudienceNetwork/extensions.cs +++ /dev/null @@ -1,120 +0,0 @@ -// -// extensions.cs: Convenience methods. -// -// Authors: -// Alex Soto (alex.soto@xamarin.com) -// Israel Soto (israel.soto@xamarin.com) -// - -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; - -using Foundation; -using ObjCRuntime; -using UIKit; - -namespace Facebook.AudienceNetwork -{ - [Preserve (AllMembers = true)] - public static partial class AdSizes - { - static AdSize? size320x50; - - [Obsolete] - public static AdSize Size320x50 { - get { - if (size320x50 != null) - return size320x50.Value; - - IntPtr RTLD_MAIN_ONLY = Dlfcn.dlopen (null, 0); - IntPtr ptr = Dlfcn.dlsym (RTLD_MAIN_ONLY, "kFBAdSize320x50"); - size320x50 = (AdSize)Marshal.PtrToStructure (ptr, typeof (AdSize)); - Dlfcn.dlclose (RTLD_MAIN_ONLY); - - return size320x50.Value; - } - } - - static AdSize? bannerHeight50; - - public static AdSize BannerHeight50 { - get { - if (bannerHeight50 != null) - return bannerHeight50.Value; - - IntPtr RTLD_MAIN_ONLY = Dlfcn.dlopen (null, 0); - IntPtr ptr = Dlfcn.dlsym (RTLD_MAIN_ONLY, "kFBAdSizeHeight50Banner"); - bannerHeight50 = (AdSize)Marshal.PtrToStructure (ptr, typeof (AdSize)); - Dlfcn.dlclose (RTLD_MAIN_ONLY); - - return bannerHeight50.Value; - } - } - - static AdSize? bannerHeight90; - - public static AdSize BannerHeight90 { - get { - if (bannerHeight90 != null) - return bannerHeight90.Value; - - IntPtr RTLD_MAIN_ONLY = Dlfcn.dlopen (null, 0); - IntPtr ptr = Dlfcn.dlsym (RTLD_MAIN_ONLY, "kFBAdSizeHeight90Banner"); - bannerHeight90 = (AdSize)Marshal.PtrToStructure (ptr, typeof (AdSize)); - Dlfcn.dlclose (RTLD_MAIN_ONLY); - - return bannerHeight90.Value; - } - } - - static AdSize? interstitial; - - public static AdSize Interstitial { - get { - if (interstitial != null) - return interstitial.Value; - - IntPtr RTLD_MAIN_ONLY = Dlfcn.dlopen (null, 0); - IntPtr ptr = Dlfcn.dlsym (RTLD_MAIN_ONLY, "kFBAdSizeInterstitial"); - interstitial = (AdSize)Marshal.PtrToStructure (ptr, typeof (AdSize)); - Dlfcn.dlclose (RTLD_MAIN_ONLY); - - return interstitial.Value; - } - } - - static AdSize? interstital; - - [Obsolete ("Use Interstitial instead.")] - public static AdSize Interstital { - get { - if (interstital != null) - return interstital.Value; - - IntPtr RTLD_MAIN_ONLY = Dlfcn.dlopen (null, 0); - IntPtr ptr = Dlfcn.dlsym (RTLD_MAIN_ONLY, "kFBAdSizeInterstitial"); - interstital = (AdSize)Marshal.PtrToStructure (ptr, typeof (AdSize)); - Dlfcn.dlclose (RTLD_MAIN_ONLY); - - return interstital.Value; - } - } - - static AdSize? rectangleHeight250; - - public static AdSize RectangleHeight250 { - get { - if (rectangleHeight250 != null) - return rectangleHeight250.Value; - - IntPtr RTLD_MAIN_ONLY = Dlfcn.dlopen (null, 0); - IntPtr ptr = Dlfcn.dlsym (RTLD_MAIN_ONLY, "kFBAdSizeHeight250Rectangle"); - rectangleHeight250 = (AdSize)Marshal.PtrToStructure (ptr, typeof (AdSize)); - Dlfcn.dlclose (RTLD_MAIN_ONLY); - - return rectangleHeight250.Value; - } - } - } -} \ No newline at end of file diff --git a/Facebook.iOS/source/CoreKit/CoreKit.csproj b/Facebook.iOS/source/CoreKit/CoreKit.csproj index 565d1605..fe7615d2 100644 --- a/Facebook.iOS/source/CoreKit/CoreKit.csproj +++ b/Facebook.iOS/source/CoreKit/CoreKit.csproj @@ -6,7 +6,7 @@ Facebook.CoreKit Facebook.CoreKit 1.0.0.0 - 7.1.1 + 9.0.1.5 Resources true true @@ -23,7 +23,7 @@ https://go.microsoft.com/fwlink/?linkid=2007135 https://go.microsoft.com/fwlink/?linkid=2007136 true - 7.1.1 + 9.0.1.5 diff --git a/Facebook.iOS/source/FacebookSdks/FacebookSdks.csproj b/Facebook.iOS/source/FacebookSdks/FacebookSdks.csproj index 0a66cd05..8ca851af 100644 --- a/Facebook.iOS/source/FacebookSdks/FacebookSdks.csproj +++ b/Facebook.iOS/source/FacebookSdks/FacebookSdks.csproj @@ -5,7 +5,7 @@ Facebook Facebook 1.0.0.0 - 7.1.1 + 9.0.1.5 Resources false @@ -21,7 +21,7 @@ https://go.microsoft.com/fwlink/?linkid=865580 https://go.microsoft.com/fwlink/?linkid=865584 true - 7.1.1 + 9.0.1.5 @@ -43,9 +43,8 @@ - - + \ No newline at end of file diff --git a/Facebook.iOS/source/LoginKit/LoginKit.csproj b/Facebook.iOS/source/LoginKit/LoginKit.csproj index e1a3cec0..1e405e04 100644 --- a/Facebook.iOS/source/LoginKit/LoginKit.csproj +++ b/Facebook.iOS/source/LoginKit/LoginKit.csproj @@ -6,7 +6,7 @@ Facebook.LoginKit Facebook.LoginKit 1.0.0.0 - 7.1.1 + 9.0.1.5 Resources true true @@ -23,7 +23,7 @@ https://go.microsoft.com/fwlink/?linkid=2007321 https://go.microsoft.com/fwlink/?linkid=2007137 true - 7.1.1 + 9.0.1.5 diff --git a/Facebook.iOS/source/MarketingKit/ApiDefinition.cs b/Facebook.iOS/source/MarketingKit/ApiDefinition.cs deleted file mode 100644 index 7eb83c6d..00000000 --- a/Facebook.iOS/source/MarketingKit/ApiDefinition.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -using UIKit; -using Foundation; -using ObjCRuntime; -using CoreGraphics; - -namespace Facebook.MarketingKit { - // @interface FBSDKAutoLog : NSObject - [BaseType (typeof (NSObject), Name = "FBSDKAutoLog")] - interface AutoLog { - } -} diff --git a/Facebook.iOS/source/MarketingKit/Enums.cs b/Facebook.iOS/source/MarketingKit/Enums.cs deleted file mode 100644 index 68e89342..00000000 --- a/Facebook.iOS/source/MarketingKit/Enums.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -using ObjCRuntime; - -namespace Facebook.MarketingKit { - [Native] - public enum FBSDKAppEventsFlushBehavior : ulong - { - Auto = 0, - ExplicitOnly - } -} diff --git a/Facebook.iOS/source/MarketingKit/Extensions.cs b/Facebook.iOS/source/MarketingKit/Extensions.cs deleted file mode 100644 index ff88e1b8..00000000 --- a/Facebook.iOS/source/MarketingKit/Extensions.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; -namespace Facebook.MarketingKit { - public class Marketing { - Marketing () { } - - public static void Configure () => Loader.ForceLoad (); - } -} diff --git a/Facebook.iOS/source/MarketingKit/License.md b/Facebook.iOS/source/MarketingKit/License.md deleted file mode 100644 index dc496d48..00000000 --- a/Facebook.iOS/source/MarketingKit/License.md +++ /dev/null @@ -1,13 +0,0 @@ -### Xamarin Component for Facebook MarketingKit iOS SDK - -**The MIT License (MIT)** - -Copyright (c) .NET Foundation Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -20180727 diff --git a/Facebook.iOS/source/MarketingKit/Loader.cs b/Facebook.iOS/source/MarketingKit/Loader.cs deleted file mode 100644 index edb1a284..00000000 --- a/Facebook.iOS/source/MarketingKit/Loader.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; - -namespace Facebook.MarketingKit -{ - public class Loader - { - static Loader () - { - Facebook.CoreKit.Loader.ForceLoad (); - } - - public static void ForceLoad () { } - } -} - -namespace ApiDefinition -{ - partial class Messaging - { - static Messaging () - { - Facebook.MarketingKit.Loader.ForceLoad (); - } - } -} diff --git a/Facebook.iOS/source/MarketingKit/MarketingKit.csproj b/Facebook.iOS/source/MarketingKit/MarketingKit.csproj deleted file mode 100644 index 1b54a974..00000000 --- a/Facebook.iOS/source/MarketingKit/MarketingKit.csproj +++ /dev/null @@ -1,72 +0,0 @@ - - - - Xamarin.iOS10 - true - Facebook.MarketingKit - Facebook.MarketingKit - 1.0.0.0 - 5.11.1 - Resources - true - - - - Xamarin.Facebook.MarketingKit.iOS - Facebook LoginKit SDK for Xamarin iOS - C# binding for Facebook MarketingKit's official SDK - C# binding for Facebook MarketingKit's official SDK - Microsoft - Microsoft - © Microsoft Corporation. All rights reserved. - https://go.microsoft.com/fwlink/?linkid=2007141 - https://go.microsoft.com/fwlink/?linkid=2007142 - true - 5.11.1 - - - - - - - - - - - - - - - - - FBSDKMarketingKit.framework - - - - - - - Framework - True - -ObjC - - - - - - - - - - - - - - - - - - - - - diff --git a/Facebook.iOS/source/MessengerShareKit/ApiDefinition.cs b/Facebook.iOS/source/MessengerShareKit/ApiDefinition.cs deleted file mode 100644 index f461c069..00000000 --- a/Facebook.iOS/source/MessengerShareKit/ApiDefinition.cs +++ /dev/null @@ -1,233 +0,0 @@ -using System; - -using Foundation; -using ObjCRuntime; -using UIKit; - -namespace Facebook.MessengerShareKit { - // @interface FBSDKMessengerBroadcastContext : FBSDKMessengerContext - [BaseType (typeof (MessengerContext), Name = "FBSDKMessengerBroadcastContext")] - interface MessengerBroadcastContext { - - } - - // @interface FBSDKMessengerShareButton : NSObject - [DisableDefaultCtor] - [BaseType (typeof (NSObject), Name = "FBSDKMessengerShareButton")] - interface MessengerShareButton { - - // +(UIButton *)rectangularButtonWithStyle:(FBSDKMessengerShareButtonStyle)style; - [Static] - [Export ("rectangularButtonWithStyle:")] - UIButton RectangularButton (MessengerShareButtonStyle style); - - // +(UIButton *)circularButtonWithStyle:(FBSDKMessengerShareButtonStyle)style width:(CGFloat)width; - [Static] - [Export ("circularButtonWithStyle:width:")] - UIButton CircularButton (MessengerShareButtonStyle style, nfloat width); - - // +(UIButton *)circularButtonWithStyle:(FBSDKMessengerShareButtonStyle)style; - [Static] - [Export ("circularButtonWithStyle:")] - UIButton CircularButton (MessengerShareButtonStyle style); - } - - // @interface FBSDKMessengerContext : NSObject - [BaseType (typeof (NSObject), Name = "FBSDKMessengerContext")] - interface MessengerContext : INSSecureCoding { - - } - - // @interface FBSDKMessengerShareOptions : NSObject - [BaseType (typeof (NSObject), Name = "FBSDKMessengerShareOptions")] - interface MessengerShareOptions { - - // @property (readwrite, copy, nonatomic) NSString * metadata; - [Export ("metadata", ArgumentSemantic.Copy)] - string Metadata { get; set; } - - // @property (readwrite, copy, nonatomic) NSURL * sourceURL; - [NullAllowed] - [Export ("sourceURL", ArgumentSemantic.Copy)] - NSUrl SourceUrl { get; set; } - - // @property (nonatomic, readwrite, assign) BOOL renderAsSticker; - [Export ("renderAsSticker")] - bool RenderAsSticker { get; set; } - - // @property (readwrite, nonatomic, strong) FBSDKMessengerContext * contextOverride; - [NullAllowed] - [Export ("contextOverride", ArgumentSemantic.Strong)] - MessengerContext ContextOverride { get; set; } - } - - // @interface FBSDKMessengerSharer : NSObject - [DisableDefaultCtor] - [BaseType (typeof (NSObject), Name = "FBSDKMessengerSharer")] - interface MessengerSharer { - - // +(FBSDKMessengerPlatformCapability)messengerPlatformCapabilities; - [Obsolete ("This is deprecated as of iOS 9. If you use this, you must configure your plist as described in https://developers.facebook.com/docs/ios/ios9")] - [Static] - [Export ("messengerPlatformCapabilities")] - MessengerPlatformCapability MessengerPlatformCapabilities { get; } - - // +(void)openMessenger; - [Static] - [Export ("openMessenger")] - void OpenMessenger (); - - // +(void)shareImage:(UIImage *)image withMetadata:(NSString *)metadata withContext:(FBSDKMessengerContext *)context __attribute__((deprecated("use use shareImage:withOptions: instead"))); - [Obsolete ("Use ShareImage (UIImage, MessengerShareOptions) instead")] - [Static] - [Export ("shareImage:withMetadata:withContext:")] - void ShareImage ([NullAllowed] UIImage image, string metadata, [NullAllowed] MessengerContext context); - - // +(void)shareImage:(UIImage *)image withOptions:(FBSDKMessengerShareOptions *)options; - [Static] - [Export ("shareImage:withOptions:")] - void ShareImage ([NullAllowed] UIImage image, [NullAllowed] MessengerShareOptions options); - - // +(void)shareAnimatedGIF:(NSData *)animatedGIFData withMetadata:(NSString *)metadata withContext:(FBSDKMessengerContext *)context __attribute__((deprecated("use use shareAnimatedGIF:withOptions: instead"))); - [Obsolete ("Use ShareAnimatedGif (NSData, MessengerShareOptions) instead")] - [Static] - [Export ("shareAnimatedGIF:withMetadata:withContext:")] - void ShareAnimatedGif ([NullAllowed] NSData animatedGIFData, string metadata, [NullAllowed] MessengerContext context); - - // +(void)shareAnimatedGIF:(NSData *)animatedGIFData withOptions:(FBSDKMessengerShareOptions *)options; - [Static] - [Export ("shareAnimatedGIF:withOptions:")] - void ShareAnimatedGif ([NullAllowed] NSData animatedGIFData, [NullAllowed] MessengerShareOptions options); - - // +(void)shareAnimatedWebP:(NSData *)animatedWebPData withMetadata:(NSString *)metadata withContext:(FBSDKMessengerContext *)context __attribute__((deprecated("use use shareAnimatedWebP:withOptions: instead"))); - [Obsolete ("Use ShareAnimatedWebP (NSData, MessengerShareOptions) instead")] - [Static] - [Export ("shareAnimatedWebP:withMetadata:withContext:")] - void ShareAnimatedWebP ([NullAllowed] NSData animatedWebPData, string metadata, [NullAllowed] MessengerContext context); - - // +(void)shareAnimatedWebP:(NSData *)animatedWebPData withOptions:(FBSDKMessengerShareOptions *)options; - [Static] - [Export ("shareAnimatedWebP:withOptions:")] - void ShareAnimatedWebP ([NullAllowed] NSData animatedWebPData, [NullAllowed] MessengerShareOptions options); - - // +(void)shareVideo:(NSData *)videoData withMetadata:(NSString *)metadata withContext:(FBSDKMessengerContext *)context __attribute__((deprecated("use use shareVideo:withOptions: instead"))); - [Obsolete ("Use ShareVideo (NSData, MessengerShareOptions) instead")] - [Static] - [Export ("shareVideo:withMetadata:withContext:")] - void ShareVideo ([NullAllowed] NSData videoData, string metadata, [NullAllowed] MessengerContext context); - - // +(void)shareVideo:(NSData *)videoData withOptions:(FBSDKMessengerShareOptions *)options; - [Static] - [Export ("shareVideo:withOptions:")] - void ShareVideo ([NullAllowed] NSData videoData, [NullAllowed] MessengerShareOptions options); - - // +(void)shareAudio:(NSData *)audioData withMetadata:(NSString *)metadata withContext:(FBSDKMessengerContext *)context __attribute__((deprecated("use use shareAudio:withOptions: instead"))); - [Obsolete ("Use ShareAudio (NSData, MessengerShareOptions) instead")] - [Static] - [Export ("shareAudio:withMetadata:withContext:")] - void ShareAudio ([NullAllowed] NSData audioData, string metadata, [NullAllowed] MessengerContext context); - - // +(void)shareAudio:(NSData *)audioData withOptions:(FBSDKMessengerShareOptions *)options; - [Static] - [Export ("shareAudio:withOptions:")] - void ShareAudio ([NullAllowed] NSData audioData, [NullAllowed] MessengerShareOptions options); - } - - interface IMessengerUrlHandlerDelegate { - - } - - // @protocol FBSDKMessengerURLHandlerDelegate - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "FBSDKMessengerURLHandlerDelegate")] - interface MessengerUrlHandlerDelegate { - - // @optional -(void)messengerURLHandler:(FBSDKMessengerURLHandler *)messengerURLHandler didHandleReplyWithContext:(FBSDKMessengerURLHandlerReplyContext *)context; - [EventArgs ("MessengerUrlHandlerReplyHandled")] - [EventName ("ReplyHandled")] - [Export ("messengerURLHandler:didHandleReplyWithContext:")] - void DidHandleReply (MessengerUrlHandler messengerURLHandler, MessengerUrlHandlerReplyContext context); - - // @optional -(void)messengerURLHandler:(FBSDKMessengerURLHandler *)messengerURLHandler didHandleOpenFromComposerWithContext:(FBSDKMessengerURLHandlerOpenFromComposerContext *)context; - [EventArgs ("MessengerUrlHandlerOpenHandledFromComposer")] - [EventName ("OpenHandledFromComposer")] - [Export ("messengerURLHandler:didHandleOpenFromComposerWithContext:")] - void DidHandleOpenFromComposer (MessengerUrlHandler messengerURLHandler, MessengerUrlHandlerOpenFromComposerContext context); - - // @optional -(void)messengerURLHandler:(FBSDKMessengerURLHandler *)messengerURLHandler didHandleCancelWithContext:(FBSDKMessengerURLHandlerCancelContext *)context; - [EventArgs ("MessengerUrlHandlerCancelHandled")] - [EventName ("CancelHandled")] - [Export ("messengerURLHandler:didHandleCancelWithContext:")] - void DidHandleCancel (MessengerUrlHandler messengerURLHandler, MessengerUrlHandlerCancelContext context); - } - - // @interface FBSDKMessengerURLHandler : NSObject - [BaseType (typeof (NSObject), - Name = "FBSDKMessengerURLHandler", - Delegates = new [] { "Delegate" }, - Events = new [] { typeof (MessengerUrlHandlerDelegate) })] - interface MessengerUrlHandler { - - // -(BOOL)canOpenURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication; - [Export ("canOpenURL:sourceApplication:")] - bool CanOpenUrl (NSUrl url, string sourceApplication); - - [Obsolete ("Use CanOpenUrl method instead. This will be removed in future versions.")] - [Wrap ("CanOpenUrl (url, sourceApplication)")] - bool CanOpenURL (NSUrl url, string sourceApplication); - - // -(BOOL)openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication; - [Export ("openURL:sourceApplication:")] - bool OpenUrl (NSUrl url, string sourceApplication); - - [Obsolete ("Use OpenUrl method instead. This will be removed in future versions.")] - [Wrap ("OpenUrl (url, sourceApplication)")] - bool OpenURL (NSUrl url, string sourceApplication); - - // @property (nonatomic, weak) id delegate; - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - IMessengerUrlHandlerDelegate Delegate { get; set; } - } - - // @interface FBSDKMessengerURLHandlerCancelContext : FBSDKMessengerContext - [BaseType (typeof (MessengerContext), Name = "FBSDKMessengerURLHandlerCancelContext")] - interface MessengerUrlHandlerCancelContext { - - } - - // @interface FBSDKMessengerURLHandlerOpenFromComposerContext : FBSDKMessengerContext - [DisableDefaultCtor] - [BaseType (typeof (MessengerContext), Name = "FBSDKMessengerURLHandlerOpenFromComposerContext")] - interface MessengerUrlHandlerOpenFromComposerContext { - - // @property (readonly, copy, nonatomic) NSString * metadata; - [Export ("metadata", ArgumentSemantic.Copy)] - string Metadata { get; } - - // @property (readonly, copy, nonatomic) NSSet * userIDs; - [Export ("userIDs", ArgumentSemantic.Copy)] - NSSet UserIds { get; } - - [Obsolete ("Use UserIds property instead. This will be removed in future versions.")] - [Wrap ("UserIds")] - NSSet UserIDs { get; } - } - - // @interface FBSDKMessengerURLHandlerReplyContext : FBSDKMessengerContext - [BaseType (typeof (MessengerContext), Name = "FBSDKMessengerURLHandlerReplyContext")] - interface MessengerUrlHandlerReplyContext { - // @property (readonly, copy, nonatomic) NSString * metadata; - [Export ("metadata", ArgumentSemantic.Copy)] - string Metadata { get; } - - // @property (readonly, copy, nonatomic) NSSet * userIDs; - [Export ("userIDs", ArgumentSemantic.Copy)] - NSSet UserIds { get; } - - [Obsolete ("Use UserIds property instead. This will be removed in future versions.")] - [Wrap ("UserIds")] - NSSet UserIDs { get; } - } -} diff --git a/Facebook.iOS/source/MessengerShareKit/Enums.cs b/Facebook.iOS/source/MessengerShareKit/Enums.cs deleted file mode 100644 index b3a77416..00000000 --- a/Facebook.iOS/source/MessengerShareKit/Enums.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; - -using ObjCRuntime; - -namespace Facebook.MessengerShareKit -{ - [Native] - public enum MessengerShareButtonStyle : ulong - { - Blue = 0, - White = 1, - WhiteBordered = 2 - } - - [Flags] - [Native] - public enum MessengerPlatformCapability : ulong - { - None = 0, - Open = 1 << 0, - Image = 1 << 1, - AnimatedGIF = 1 << 2, - AnimatedWebP = 1 << 3, - Video = 1 << 4, - Audio = 1 << 5, - RenderAsSticker = 1 << 6 - } -} diff --git a/Facebook.iOS/source/MessengerShareKit/License.md b/Facebook.iOS/source/MessengerShareKit/License.md deleted file mode 100644 index 60de3e52..00000000 --- a/Facebook.iOS/source/MessengerShareKit/License.md +++ /dev/null @@ -1,15 +0,0 @@ -### Xamarin Component for Facebook Messenger ShareKit iOS SDK - -**The MIT License (MIT)** - -Copyright (c) .NET Foundation Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -20180713 - - diff --git a/Facebook.iOS/source/MessengerShareKit/Loader.cs b/Facebook.iOS/source/MessengerShareKit/Loader.cs deleted file mode 100644 index b47280ac..00000000 --- a/Facebook.iOS/source/MessengerShareKit/Loader.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Facebook.MessengerShareKit -{ - public class Loader - { - static Loader () - { - } - - public static void ForceLoad () { } - } -} - -namespace ApiDefinition -{ - partial class Messaging - { - static Messaging () - { - Facebook.MessengerShareKit.Loader.ForceLoad (); - } - } -} diff --git a/Facebook.iOS/source/MessengerShareKit/MessengerShareKit.csproj b/Facebook.iOS/source/MessengerShareKit/MessengerShareKit.csproj deleted file mode 100644 index 8aba408c..00000000 --- a/Facebook.iOS/source/MessengerShareKit/MessengerShareKit.csproj +++ /dev/null @@ -1,69 +0,0 @@ - - - - Xamarin.iOS10 - true - Facebook.MessengerShareKit - Facebook.MessengerShareKit - 1.0.0.0 - 1.3.2.1 - Resources - true - - - - Xamarin.Facebook.MessengerShareKit.iOS - Facebook Messenger ShareKit SDK for Xamarin iOS - C# binding for Facebook Messenger ShareKit's official SDK - C# binding for Facebook Messenger ShareKit's official SDK - Microsoft - Microsoft - © Microsoft Corporation. All rights reserved. - https://go.microsoft.com/fwlink/?linkid=2007139 - https://go.microsoft.com/fwlink/?linkid=2007138 - true - 1.3.2.1 - - - - - - - - - - - - - - - - - FBSDKMessengerShareKit.framework - - - - - - - Framework - True - -ObjC - Accounts CoreLocation Social Security QuartzCore CoreGraphics UIKit Foundation AudioToolbox - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Facebook.iOS/source/Notifications/ApiDefinition.cs b/Facebook.iOS/source/Notifications/ApiDefinition.cs deleted file mode 100644 index b29e525a..00000000 --- a/Facebook.iOS/source/Notifications/ApiDefinition.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; - -using UIKit; -using Foundation; -using ObjCRuntime; -using CoreGraphics; - -namespace Facebook.Notifications { - interface ICardViewControllerDelegate { } - - // @protocol FBNCardViewControllerDelegate - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "FBNCardViewControllerDelegate")] - interface CardViewControllerDelegate { - // @optional -(void)pushCardViewController:(FBNCardViewController * _Nonnull)controller willDismissWithOpenURL:(NSURL * _Nonnull)url; - [Export ("pushCardViewController:willDismissWithOpenURL:")] - void WillDismiss (CardViewController controller, NSUrl url); - - // @optional -(void)pushCardViewControllerWillDismiss:(FBNCardViewController * _Nonnull)controller; - [Export ("pushCardViewControllerWillDismiss:")] - void WillDismiss (CardViewController controller); - } - - // @interface FBNCardViewController : UIViewController - [DisableDefaultCtor] - [BaseType (typeof (UIViewController), Name = "FBNCardViewController")] - interface CardViewController { - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - ICardViewControllerDelegate Delegate { get; set; } - } - - // typedef void (^FBNCardContentPreparationCompletion)(NSDictionary * _Nullable, NSError * _Nullable); - delegate void CardContentPreparationCompletionHandler ([NullAllowed] NSDictionary payload, [NullAllowed] NSError error); - - // typedef void (^FBNCardPresentationCompletion)(FBNCardViewController * _Nullable, NSError * _Nullable); - delegate void CardPresentationCompletionHandler ([NullAllowed] CardViewController viewController, [NullAllowed] NSError error); - - // typedef void (^FBNLocalNotificationCreationCompletion)(UILocalNotification * _Nullable, NSError * _Nullable); - delegate void LocalNotificationCreationCompletionHandler ([NullAllowed] UILocalNotification notification, [NullAllowed] NSError error); - - // @interface FBNotificationsManager : NSObject - [DisableDefaultCtor] - [BaseType (typeof (NSObject), Name = "FBNotificationsManager")] - interface NotificationsManager { - // extern NSString * _Nonnull FBNotificationsErrorDomain; - [Field ("FBNotificationsErrorDomain", "__Internal")] - NSString ErrorDomain { get; } - - // extern NSString * _Nonnull FBNotificationsCardFormatVersionString; - [Field ("FBNotificationsCardFormatVersionString", "__Internal")] - NSString VersionString { get; } - - // +(instancetype _Nonnull)sharedManager; - [Static] - [Export ("sharedManager")] - NotificationsManager SharedInstance { get; } - - // -(void)preparePushCardContentForRemoteNotificationPayload:(NSDictionary * _Nonnull)payload completion:(FBNCardContentPreparationCompletion _Nullable)completion; - [Async] - [Export ("preparePushCardContentForRemoteNotificationPayload:completion:")] - void PreparePushCardContent (NSDictionary payload, [NullAllowed] CardContentPreparationCompletionHandler completion); - - // -(void)presentPushCardForRemoteNotificationPayload:(NSDictionary * _Nonnull)payload fromViewController:(UIViewController * _Nullable)viewController completion:(FBNCardPresentationCompletion _Nullable)completion; - [Async] - [Export ("presentPushCardForRemoteNotificationPayload:fromViewController:completion:")] - void PresentPushCard (NSDictionary payload, [NullAllowed] UIViewController viewController, [NullAllowed] CardPresentationCompletionHandler completion); - - // -(BOOL)canPresentPushCardFromRemoteNotificationPayload:(NSDictionary * _Nullable)payload; - [Export ("canPresentPushCardFromRemoteNotificationPayload:")] - bool CanPresentPushCard ([NullAllowed] NSDictionary payload); - - // -(void)createLocalNotificationFromRemoteNotificationPayload:(NSDictionary * _Nonnull)payload completion:(FBNLocalNotificationCreationCompletion _Nonnull)completion; - [Async] - [Export ("createLocalNotificationFromRemoteNotificationPayload:completion:")] - void CreateLocalNotification (NSDictionary payload, LocalNotificationCreationCompletionHandler completion); - - // -(void)presentPushCardForLocalNotification:(UILocalNotification * _Nonnull)notification fromViewController:(UIViewController * _Nullable)viewController completion:(FBNCardPresentationCompletion _Nullable)completion; - [Async] - [Export ("presentPushCardForLocalNotification:fromViewController:completion:")] - void PresentPushCard (UILocalNotification notification, [NullAllowed] UIViewController viewController, [NullAllowed] CardPresentationCompletionHandler completion); - - // -(BOOL)canPresentPushCardFromLocalNotification:(UILocalNotification * _Nonnull)notification; - [Export ("canPresentPushCardFromLocalNotification:")] - bool CanPresentPushCard (UILocalNotification notification); - } -} diff --git a/Facebook.iOS/source/Notifications/License.md b/Facebook.iOS/source/Notifications/License.md deleted file mode 100644 index ceb3195a..00000000 --- a/Facebook.iOS/source/Notifications/License.md +++ /dev/null @@ -1,15 +0,0 @@ -### Xamarin Component for Facebook Notifications for iOS - -**The MIT License (MIT)** - -Copyright (c) .NET Foundation Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -20180730 - - diff --git a/Facebook.iOS/source/Notifications/Loader.cs b/Facebook.iOS/source/Notifications/Loader.cs deleted file mode 100644 index 51aa78c0..00000000 --- a/Facebook.iOS/source/Notifications/Loader.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Facebook.Notifications -{ - public class Loader - { - static Loader () - { - } - - public static void ForceLoad () { } - } -} - -namespace ApiDefinition -{ - partial class Messaging - { - static Messaging () - { - Facebook.Notifications.Loader.ForceLoad (); - } - } -} diff --git a/Facebook.iOS/source/Notifications/Notifications.csproj b/Facebook.iOS/source/Notifications/Notifications.csproj deleted file mode 100644 index cdc6f893..00000000 --- a/Facebook.iOS/source/Notifications/Notifications.csproj +++ /dev/null @@ -1,69 +0,0 @@ - - - - Xamarin.iOS10 - true - Facebook.Notifications - Facebook.Notifications - 1.0.0.0 - 1.0.1.1 - Resources - true - - - - Xamarin.Facebook.Notifications.iOS - Facebook Notifications SDK for Xamarin iOS - C# binding for Facebook Notifications's official SDK - C# binding for Facebook Notifications's official SDK - Microsoft - Microsoft - © Microsoft Corporation. All rights reserved. - https://go.microsoft.com/fwlink/?linkid=2007047 - https://go.microsoft.com/fwlink/?linkid=2007163 - true - 1.0.1.1 - - - - - - - - - - - - - - - - - FBNotifications.framework - - - - - - - Framework - True - ImageIO MobileCoreServices - Accounts CoreLocation Social Security QuartzCore CoreGraphics UIKit Foundation AudioToolbox - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Facebook.iOS/source/Notifications/Structs.cs b/Facebook.iOS/source/Notifications/Structs.cs deleted file mode 100644 index 68f73194..00000000 --- a/Facebook.iOS/source/Notifications/Structs.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -using ObjCRuntime; - -namespace Facebook.Notifications { - [Native] - public enum NotificationsErrorCode : ulong - { - InvalidPayload = 1 - } -} diff --git a/Facebook.iOS/source/PlacesKit/ApiDefinition.cs b/Facebook.iOS/source/PlacesKit/ApiDefinition.cs deleted file mode 100644 index a1b3e42b..00000000 --- a/Facebook.iOS/source/PlacesKit/ApiDefinition.cs +++ /dev/null @@ -1,401 +0,0 @@ -using System; - -using UIKit; -using Foundation; -using ObjCRuntime; -using CoreGraphics; -using CoreLocation; - -namespace Facebook.PlacesKit { - [Static] - interface FieldConstants { - // extern NSString *const FBSDKPlacesFieldKeyAbout; - [Obsolete ("Use PlacesFieldKey.About enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.About.GetConstant ()")] - NSString About { get; } - - // extern NSString *const FBSDKPlacesFieldKeyAppLinks; - [Obsolete ("Use PlacesFieldKey.AppLinks enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.AppLinks.GetConstant ()")] - NSString AppLinks { get; } - - // extern NSString *const FBSDKPlacesFieldKeyCategories; - [Obsolete ("Use PlacesFieldKey.Categories enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Categories.GetConstant ()")] - NSString Categories { get; } - - // extern NSString *const FBSDKPlacesFieldKeyCheckins; - [Obsolete ("Use PlacesFieldKey.Checkins enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Checkins.GetConstant ()")] - NSString Checkins { get; } - - // extern NSString *const FBSDKPlacesFieldKeyConfidence; - [Obsolete ("Use PlacesFieldKey.Confidence enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Confidence.GetConstant ()")] - NSString Confidence { get; } - - // extern NSString *const FBSDKPlacesFieldKeyCoverPhoto; - [Obsolete ("Use PlacesFieldKey.CoverPhoto enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.CoverPhoto.GetConstant ()")] - NSString CoverPhoto { get; } - - // extern NSString *const FBSDKPlacesFieldKeyDescription; - [Obsolete ("Use PlacesFieldKey.Description enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Description.GetConstant ()")] - NSString Description { get; } - - // extern NSString *const FBSDKPlacesFieldKeyEngagement; - [Obsolete ("Use PlacesFieldKey.Engagement enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Engagement.GetConstant ()")] - NSString Engagement { get; } - - // extern NSString *const FBSDKPlacesFieldKeyHours; - [Obsolete ("Use PlacesFieldKey.Hours enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Hours.GetConstant ()")] - NSString Hours { get; } - - // extern NSString *const FBSDKPlacesFieldKeyIsAlwaysOpen; - [Obsolete ("Use PlacesFieldKey.IsAlwaysOpen enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.IsAlwaysOpen.GetConstant ()")] - NSString IsAlwaysOpen { get; } - - // extern NSString *const FBSDKPlacesFieldKeyIsPermanentlyClosed; - [Obsolete ("Use PlacesFieldKey.IsPermanentlyClosed enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.IsPermanentlyClosed.GetConstant ()")] - NSString IsPermanentlyClosed { get; } - - // extern NSString *const FBSDKPlacesFieldKeyIsVerified; - [Obsolete ("Use PlacesFieldKey.IsVerified enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.IsVerified.GetConstant ()")] - NSString IsVerified { get; } - - // extern NSString *const FBSDKPlacesFieldKeyLocation; - [Obsolete ("Use PlacesFieldKey.Location enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Location.GetConstant ()")] - NSString Location { get; } - - // extern NSString *const FBSDKPlacesFieldKeyLink; - [Obsolete ("Use PlacesFieldKey.Link enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Link.GetConstant ()")] - NSString Link { get; } - - // extern NSString *const FBSDKPlacesFieldKeyName; - [Obsolete ("Use PlacesFieldKey.Name enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Name.GetConstant ()")] - NSString Name { get; } - - // extern NSString *const FBSDKPlacesFieldKeyOverallStarRating; - [Obsolete ("Use PlacesFieldKey.OverallStarRating enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.OverallStarRating.GetConstant ()")] - NSString OverallStarRating { get; } - - // extern NSString *const FBSDKPlacesFieldKeyPage; - [Obsolete ("Use PlacesFieldKey.Page enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Page.GetConstant ()")] - NSString Page { get; } - - // extern NSString *const FBSDKPlacesFieldKeyParking; - [Obsolete ("Use PlacesFieldKey.Parking enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Parking.GetConstant ()")] - NSString Parking { get; } - - // extern NSString *const FBSDKPlacesFieldKeyPaymentOptions; - [Obsolete ("Use PlacesFieldKey.PaymentOptions enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.PaymentOptions.GetConstant ()")] - NSString PaymentOptions { get; } - - // extern NSString *const FBSDKPlacesFieldKeyPlaceID; - [Obsolete ("Use PlacesFieldKey.PlaceID enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.PlaceId.GetConstant ()")] - NSString PlaceId { get; } - - // extern NSString *const FBSDKPlacesFieldKeyPhone; - [Obsolete ("Use PlacesFieldKey.Phone enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Phone.GetConstant ()")] - NSString Phone { get; } - - // extern NSString *const FBSDKPlacesFieldKeyPhotos; - [Obsolete ("Use PlacesFieldKey.Photos enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Photos.GetConstant ()")] - NSString Photos { get; } - - // extern NSString *const FBSDKPlacesFieldKeyPriceRange; - [Obsolete ("Use PlacesFieldKey.PriceRange enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.PriceRange.GetConstant ()")] - NSString PriceRange { get; } - - // extern NSString *const FBSDKPlacesFieldKeyProfilePhoto; - [Obsolete ("Use PlacesFieldKey.ProfilePhoto enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.ProfilePhoto.GetConstant ()")] - NSString ProfilePhoto { get; } - - // extern NSString *const FBSDKPlacesFieldKeyRatingCount; - [Obsolete ("Use PlacesFieldKey.RatingCount enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.RatingCount.GetConstant ()")] - NSString RatingCount { get; } - - // extern NSString *const FBSDKPlacesFieldKeyRestaurantServices; - [Obsolete ("Use PlacesFieldKey.RestaurantServices enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.RestaurantServices.GetConstant ()")] - NSString RestaurantServices { get; } - - // extern NSString *const FBSDKPlacesFieldKeyRestaurantSpecialties; - [Obsolete ("Use PlacesFieldKey.RestaurantSpecialties enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.RestaurantSpecialties.GetConstant ()")] - NSString RestaurantSpecialties { get; } - - // extern NSString *const FBSDKPlacesFieldKeySingleLineAddress; - [Obsolete ("Use PlacesFieldKey.SingleLineAddress enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.SingleLineAddress.GetConstant ()")] - NSString SingleLineAddress { get; } - - // extern NSString *const FBSDKPlacesFieldKeyWebsite; - [Obsolete ("Use PlacesFieldKey.Website enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Website.GetConstant ()")] - NSString Website { get; } - - // extern NSString *const FBSDKPlacesFieldKeyWorkflows; - [Obsolete ("Use PlacesFieldKey.Workflows enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesFieldKey.Workflows.GetConstant ()")] - NSString Workflows { get; } - } - - [Static] - interface ResponseConstants { - // extern NSString *const FBSDKPlacesResponseKeyCity; - [Obsolete ("Use PlacesResponseKey.City enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.City.GetConstant ()")] - NSString City { get; } - - // extern NSString *const FBSDKPlacesResponseKeyCityID; - [Obsolete ("Use PlacesResponseKey.CityID enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.CityId.GetConstant ()")] - NSString CityId { get; } - - // extern NSString *const FBSDKPlacesResponseKeyCountry; - [Obsolete ("Use PlacesResponseKey.Country enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.Country.GetConstant ()")] - NSString Country { get; } - - // extern NSString *const FBSDKPlacesResponseKeyCountryCode; - [Obsolete ("Use PlacesResponseKey.CountryCode enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.CountryCode.GetConstant ()")] - NSString CountryCode { get; } - - // extern NSString *const FBSDKPlacesResponseKeyLatitude; - [Obsolete ("Use PlacesResponseKey.Latitude enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.Latitude.GetConstant ()")] - NSString Latitude { get; } - - // extern NSString *const FBSDKPlacesResponseKeyLongitude; - [Obsolete ("Use PlacesResponseKey.Longitude enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.Longitude.GetConstant ()")] - NSString Longitude { get; } - - // extern NSString *const FBSDKPlacesResponseKeyRegion; - [Obsolete ("Use PlacesResponseKey.Region enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.Region.GetConstant ()")] - NSString Region { get; } - - // extern NSString *const FBSDKPlacesResponseKeyRegionID; - [Obsolete ("Use PlacesResponseKey.RegionID enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.RegionId.GetConstant ()")] - NSString RegionId { get; } - - // extern NSString *const FBSDKPlacesResponseKeyState; - [Obsolete ("Use PlacesResponseKey.State enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.State.GetConstant ()")] - NSString State { get; } - - // extern NSString *const FBSDKPlacesResponseKeyStreet; - [Obsolete ("Use PlacesResponseKey.Street enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.Street.GetConstant ()")] - NSString Street { get; } - - // extern NSString *const FBSDKPlacesResponseKeyZip; - [Obsolete ("Use PlacesResponseKey.Zip enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.Zip.GetConstant ()")] - NSString Zip { get; } - - // extern NSString *const FBSDKPlacesResponseKeyMatchedCategories; - [Obsolete ("Use PlacesResponseKey.MatchedCategories enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.MatchedCategories.GetConstant ()")] - NSString MatchedCategories { get; } - - // extern NSString *const FBSDKPlacesResponseKeyPhotoSource; - [Obsolete ("Use PlacesResponseKey.PhotoSource enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.PhotoSource.GetConstant ()")] - NSString PhotoSource { get; } - - // extern NSString *const FBSDKPlacesResponseKeyData; - [Obsolete ("Use PlacesResponseKey.Data enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.Data.GetConstant ()")] - NSString Data { get; } - - // extern NSString *const FBSDKPlacesResponseKeyUrl; - [Obsolete ("Use PlacesResponseKey.Url enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesResponseKey.Url.GetConstant ()")] - NSString Url { get; } - } - - [Static] - interface ParameterConstants { - // extern NSString *const FBSDKPlacesParameterKeySummary; - [Obsolete ("Use PlacesParameterKey.Summary enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesParameterKey.Summary.GetConstant ()")] - NSString Summary { get; } - } - - [Static] - interface SummaryConstants { - // extern NSString *const FBSDKPlacesSummaryKeyTracking; - [Obsolete ("Use PlacesSummaryKey.Tracking enum instead. This will be removed in future versions.")] - [Static] - [Wrap ("PlacesSummaryKey.Tracking.GetConstant ()")] - NSString Tracking { get; } - } - - // typedef void (^FBSDKPlaceGraphRequestBlock)(FBSDKGraphRequest * _Nullable, CLLocation * _Nullable, NSError * _Nullable); - delegate void PlaceGraphRequestBlockHandler ([NullAllowed] CoreKit.GraphRequest graphRequest, [NullAllowed] CLLocation location, [NullAllowed] NSError error); - - // typedef void (^FBSDKCurrentPlaceGraphRequestBlock)(FBSDKGraphRequest * _Nullable, NSError * _Nullable); - delegate void CurrentPlaceGraphRequestBlockHandler ([NullAllowed] CoreKit.GraphRequest graphRequest, [NullAllowed] NSError error); - - // @interface FBSDKPlacesManager : NSObject - [BaseType (typeof (NSObject), Name = "FBSDKPlacesManager")] - interface PlacesManager { - // -(void)generatePlaceSearchRequestForSearchTerm:(NSString * _Nullable)searchTerm categories:(NSArray * _Nonnull)categories fields:(NSArray * _Nonnull)fields distance:(CLLocationDistance)distance cursor:(NSString * _Nullable)cursor completion:(FBSDKPlaceGraphRequestBlock _Nonnull)completion __attribute__((swift_name("generatePlaceSearchRequest(for:categories:fields:distance:cursor:completion:)"))); - //[Async (ResultTypeName = "PlaceGraphRequestResult")] - [Internal] - [Export ("generatePlaceSearchRequestForSearchTerm:categories:fields:distance:cursor:completion:")] - void _GeneratePlaceSearchRequest ([NullAllowed] string searchTerm, string [] categories, NSArray fields, double distance, [NullAllowed] string cursor, PlaceGraphRequestBlockHandler completion); - - [Async (ResultTypeName = "PlaceGraphRequestResult")] - [Wrap ("_GeneratePlaceSearchRequest (searchTerm, categories, NSArray.FromNSObjects (fields), distance, cursor, completion)")] - void GeneratePlaceSearchRequest ([NullAllowed] string searchTerm, string [] categories, NSString [] fields, double distance, [NullAllowed] string cursor, PlaceGraphRequestBlockHandler completion); - - [Async (ResultTypeName = "PlaceGraphRequestResult")] - [Wrap ("_GeneratePlaceSearchRequest (searchTerm, categories, NSArray.FromNSObjects (f => f.GetConstant (), fields), distance, cursor, completion)")] - void GeneratePlaceSearchRequest ([NullAllowed] string searchTerm, string [] categories, PlacesFieldKey [] fields, double distance, [NullAllowed] string cursor, PlaceGraphRequestBlockHandler completion); - - [Async (ResultTypeName = "PlaceGraphRequestResult")] - [Wrap ("_GeneratePlaceSearchRequest (searchTerm, categories, NSArray.FromObjects (fields), distance, cursor, completion)")] - void GeneratePlaceSearchRequest ([NullAllowed] string searchTerm, string [] categories, string [] fields, double distance, [NullAllowed] string cursor, PlaceGraphRequestBlockHandler completion); - - // -(FBSDKGraphRequest * _Nullable)placeSearchRequestForLocation:(CLLocation * _Nullable)location searchTerm:(NSString * _Nullable)searchTerm categories:(NSArray * _Nullable)categories fields:(NSArray * _Nullable)fields distance:(CLLocationDistance)distance cursor:(NSString * _Nullable)cursor; - [Internal] - [return: NullAllowed] - [Export ("placeSearchRequestForLocation:searchTerm:categories:fields:distance:cursor:")] - CoreKit.GraphRequest _GeneratePlaceSearchRequest ([NullAllowed] CLLocation location, [NullAllowed] string searchTerm, string [] categories, NSArray fields, double distance, [NullAllowed] string cursor); - - [return: NullAllowed] - [Wrap ("_GeneratePlaceSearchRequest (location, searchTerm, categories, NSArray.FromNSObjects (fields), distance, cursor)")] - CoreKit.GraphRequest GeneratePlaceSearchRequest ([NullAllowed] CLLocation location, [NullAllowed] string searchTerm, string [] categories, NSString [] fields, double distance, [NullAllowed] string cursor); - - [return: NullAllowed] - [Wrap ("_GeneratePlaceSearchRequest (location, searchTerm, categories, NSArray.FromNSObjects (f => f.GetConstant (), fields), distance, cursor)")] - CoreKit.GraphRequest GeneratePlaceSearchRequest ([NullAllowed] CLLocation location, [NullAllowed] string searchTerm, string [] categories, PlacesFieldKey [] fields, double distance, [NullAllowed] string cursor); - - [return: NullAllowed] - [Wrap ("_GeneratePlaceSearchRequest (location, searchTerm, categories, NSArray.FromObjects (fields), distance, cursor)")] - CoreKit.GraphRequest GeneratePlaceSearchRequest ([NullAllowed] CLLocation location, [NullAllowed] string searchTerm, string [] categories, string [] fields, double distance, [NullAllowed] string cursor); - - // -(void)generateCurrentPlaceRequestWithMinimumConfidenceLevel:(FBSDKPlaceLocationConfidence)minimumConfidence fields:(NSArray * _Nullable)fields completion:(FBSDKCurrentPlaceGraphRequestCompletion _Nonnull)completion; - [Internal] - [Export ("generateCurrentPlaceRequestWithMinimumConfidenceLevel:fields:completion:")] - void _GenerateCurrentPlaceRequest (PlaceLocationConfidence minimumConfidence, NSArray fields, CurrentPlaceGraphRequestBlockHandler completion); - - [Async] - [Wrap ("_GenerateCurrentPlaceRequest (minimumConfidence, NSArray.FromNSObjects (fields), completion)")] - void GenerateCurrentPlaceRequest (PlaceLocationConfidence minimumConfidence, NSString [] fields, CurrentPlaceGraphRequestBlockHandler completion); - - [Async] - [Wrap ("_GenerateCurrentPlaceRequest (minimumConfidence, NSArray.FromNSObjects (f => f.GetConstant (), fields), completion)")] - void GenerateCurrentPlaceRequest (PlaceLocationConfidence minimumConfidence, PlacesFieldKey [] fields, CurrentPlaceGraphRequestBlockHandler completion); - - [Async] - [Wrap ("_GenerateCurrentPlaceRequest (minimumConfidence, NSArray.FromObjects (fields), completion)")] - void GenerateCurrentPlaceRequest (PlaceLocationConfidence minimumConfidence, string [] fields, CurrentPlaceGraphRequestBlockHandler completion); - - // -(void)generateCurrentPlaceRequestForCurrentLocation:(CLLocation * _Nonnull)currentLocation withMinimumConfidenceLevel:(FBSDKPlaceLocationConfidence)minimumConfidence fields:(NSArray * _Nullable)fields completion:(FBSDKCurrentPlaceGraphRequestCompletion _Nonnull)completion; - [Internal] - [Export ("generateCurrentPlaceRequestForCurrentLocation:withMinimumConfidenceLevel:fields:completion:")] - void _GenerateCurrentPlaceRequest (CLLocation currentLocation, PlaceLocationConfidence minimumConfidence, NSArray fields, CurrentPlaceGraphRequestBlockHandler completion); - - [Async] - [Wrap ("_GenerateCurrentPlaceRequest (currentLocation, minimumConfidence, NSArray.FromNSObjects (fields), completion)")] - void GenerateCurrentPlaceRequest (CLLocation currentLocation, PlaceLocationConfidence minimumConfidence, NSString [] fields, CurrentPlaceGraphRequestBlockHandler completion); - - [Async] - [Wrap ("_GenerateCurrentPlaceRequest (currentLocation, minimumConfidence, NSArray.FromNSObjects (f => f.GetConstant (), fields), completion)")] - void GenerateCurrentPlaceRequest (CLLocation currentLocation, PlaceLocationConfidence minimumConfidence, PlacesFieldKey [] fields, CurrentPlaceGraphRequestBlockHandler completion); - - [Async] - [Wrap ("_GenerateCurrentPlaceRequest (currentLocation, minimumConfidence, NSArray.FromObjects (fields), completion)")] - void GenerateCurrentPlaceRequest (CLLocation currentLocation, PlaceLocationConfidence minimumConfidence, string [] fields, CurrentPlaceGraphRequestBlockHandler completion); - - // -(FBSDKGraphRequest * _Nonnull)currentPlaceFeedbackRequestForPlaceID:(NSString * _Nonnull)placeID tracking:(NSString * _Nonnull)tracking wasHere:(BOOL)wasHere; - [Export ("currentPlaceFeedbackRequestForPlaceID:tracking:wasHere:")] - CoreKit.GraphRequest GenerateCurrentPlaceFeedbackRequest (string placeId, string tracking, bool wasHere); - - // -(FBSDKGraphRequest * _Nonnull)placeInfoRequestForPlaceID:(NSString * _Nonnull)placeID fields:(NSArray * _Nullable)fields; - [Internal] - [Export ("placeInfoRequestForPlaceID:fields:")] - CoreKit.GraphRequest _GeneratePlaceInfoRequest (string placeId, NSArray fields); - - [Wrap ("_GeneratePlaceInfoRequest (placeId, NSArray.FromNSObjects (fields))")] - CoreKit.GraphRequest GeneratePlaceInfoRequest (string placeId, NSString [] fields); - - [Wrap ("_GeneratePlaceInfoRequest (placeId, NSArray.FromNSObjects (f => f.GetConstant (), fields))")] - CoreKit.GraphRequest GeneratePlaceInfoRequest (string placeId, PlacesFieldKey [] fields); - - [Wrap ("_GeneratePlaceInfoRequest (placeId, NSArray.FromObjects (fields))")] - CoreKit.GraphRequest GeneratePlaceInfoRequest (string placeId, string [] fields); - } -} diff --git a/Facebook.iOS/source/PlacesKit/Enums.cs b/Facebook.iOS/source/PlacesKit/Enums.cs deleted file mode 100644 index 1663af7a..00000000 --- a/Facebook.iOS/source/PlacesKit/Enums.cs +++ /dev/null @@ -1,212 +0,0 @@ -using System; - -using Foundation; -using ObjCRuntime; - -namespace Facebook.PlacesKit -{ - public enum PlacesFieldKey { - // extern NSString *const FBSDKPlacesFieldKeyAbout; - [Field ("FBSDKPlacesFieldKeyAbout", "__Internal")] - About, - - // extern NSString *const FBSDKPlacesFieldKeyAppLinks; - [Field ("FBSDKPlacesFieldKeyAppLinks", "__Internal")] - AppLinks, - - // extern NSString *const FBSDKPlacesFieldKeyCategories; - [Field ("FBSDKPlacesFieldKeyCategories", "__Internal")] - Categories, - - // extern NSString *const FBSDKPlacesFieldKeyCheckins; - [Field ("FBSDKPlacesFieldKeyCheckins", "__Internal")] - Checkins, - - // extern NSString *const FBSDKPlacesFieldKeyConfidence; - [Field ("FBSDKPlacesFieldKeyConfidence", "__Internal")] - Confidence, - - // extern NSString *const FBSDKPlacesFieldKeyCoverPhoto; - [Field ("FBSDKPlacesFieldKeyCoverPhoto", "__Internal")] - CoverPhoto, - - // extern NSString *const FBSDKPlacesFieldKeyDescription; - [Field ("FBSDKPlacesFieldKeyDescription", "__Internal")] - Description, - - // extern NSString *const FBSDKPlacesFieldKeyEngagement; - [Field ("FBSDKPlacesFieldKeyEngagement", "__Internal")] - Engagement, - - // extern NSString *const FBSDKPlacesFieldKeyHours; - [Field ("FBSDKPlacesFieldKeyHours", "__Internal")] - Hours, - - // extern NSString *const FBSDKPlacesFieldKeyIsAlwaysOpen; - [Field ("FBSDKPlacesFieldKeyIsAlwaysOpen", "__Internal")] - IsAlwaysOpen, - - // extern NSString *const FBSDKPlacesFieldKeyIsPermanentlyClosed; - [Field ("FBSDKPlacesFieldKeyIsPermanentlyClosed", "__Internal")] - IsPermanentlyClosed, - - // extern NSString *const FBSDKPlacesFieldKeyIsVerified; - [Field ("FBSDKPlacesFieldKeyIsVerified", "__Internal")] - IsVerified, - - // extern NSString *const FBSDKPlacesFieldKeyLocation; - [Field ("FBSDKPlacesFieldKeyLocation", "__Internal")] - Location, - - // extern NSString *const FBSDKPlacesFieldKeyLink; - [Field ("FBSDKPlacesFieldKeyLink", "__Internal")] - Link, - - // extern NSString *const FBSDKPlacesFieldKeyName; - [Field ("FBSDKPlacesFieldKeyName", "__Internal")] - Name, - - // extern NSString *const FBSDKPlacesFieldKeyOverallStarRating; - [Field ("FBSDKPlacesFieldKeyOverallStarRating", "__Internal")] - OverallStarRating, - - // extern NSString *const FBSDKPlacesFieldKeyPage; - [Field ("FBSDKPlacesFieldKeyPage", "__Internal")] - Page, - - // extern NSString *const FBSDKPlacesFieldKeyParking; - [Field ("FBSDKPlacesFieldKeyParking", "__Internal")] - Parking, - - // extern NSString *const FBSDKPlacesFieldKeyPaymentOptions; - [Field ("FBSDKPlacesFieldKeyPaymentOptions", "__Internal")] - PaymentOptions, - - // extern NSString *const FBSDKPlacesFieldKeyPlaceID; - [Field ("FBSDKPlacesFieldKeyPlaceID", "__Internal")] - PlaceId, - - // extern NSString *const FBSDKPlacesFieldKeyPhone; - [Field ("FBSDKPlacesFieldKeyPhone", "__Internal")] - Phone, - - // extern NSString *const FBSDKPlacesFieldKeyPhotos; - [Field ("FBSDKPlacesFieldKeyPhotos", "__Internal")] - Photos, - - // extern NSString *const FBSDKPlacesFieldKeyPriceRange; - [Field ("FBSDKPlacesFieldKeyPriceRange", "__Internal")] - PriceRange, - - // extern NSString *const FBSDKPlacesFieldKeyProfilePhoto; - [Field ("FBSDKPlacesFieldKeyProfilePhoto", "__Internal")] - ProfilePhoto, - - // extern NSString *const FBSDKPlacesFieldKeyRatingCount; - [Field ("FBSDKPlacesFieldKeyRatingCount", "__Internal")] - RatingCount, - - // extern NSString *const FBSDKPlacesFieldKeyRestaurantServices; - [Field ("FBSDKPlacesFieldKeyRestaurantServices", "__Internal")] - RestaurantServices, - - // extern NSString *const FBSDKPlacesFieldKeyRestaurantSpecialties; - [Field ("FBSDKPlacesFieldKeyRestaurantSpecialties", "__Internal")] - RestaurantSpecialties, - - // extern NSString *const FBSDKPlacesFieldKeySingleLineAddress; - [Field ("FBSDKPlacesFieldKeySingleLineAddress", "__Internal")] - SingleLineAddress, - - // extern NSString *const FBSDKPlacesFieldKeyWebsite; - [Field ("FBSDKPlacesFieldKeyWebsite", "__Internal")] - Website, - - // extern NSString *const FBSDKPlacesFieldKeyWorkflows; - [Field ("FBSDKPlacesFieldKeyWorkflows", "__Internal")] - Workflows - } - - public enum PlacesResponseKey { - // extern NSString *const FBSDKPlacesResponseKeyCity; - [Field ("FBSDKPlacesResponseKeyCity", "__Internal")] - City, - - // extern NSString *const FBSDKPlacesResponseKeyCityID; - [Field ("FBSDKPlacesResponseKeyCityID", "__Internal")] - CityId, - - // extern NSString *const FBSDKPlacesResponseKeyCountry; - [Field ("FBSDKPlacesResponseKeyCountry", "__Internal")] - Country, - - // extern NSString *const FBSDKPlacesResponseKeyCountryCode; - [Field ("FBSDKPlacesResponseKeyCountryCode", "__Internal")] - CountryCode, - - // extern NSString *const FBSDKPlacesResponseKeyLatitude; - [Field ("FBSDKPlacesResponseKeyLatitude", "__Internal")] - Latitude, - - // extern NSString *const FBSDKPlacesResponseKeyLongitude; - [Field ("FBSDKPlacesResponseKeyLongitude", "__Internal")] - Longitude, - - // extern NSString *const FBSDKPlacesResponseKeyRegion; - [Field ("FBSDKPlacesResponseKeyRegion", "__Internal")] - Region, - - // extern NSString *const FBSDKPlacesResponseKeyRegionID; - [Field ("FBSDKPlacesResponseKeyRegionID", "__Internal")] - RegionId, - - // extern NSString *const FBSDKPlacesResponseKeyState; - [Field ("FBSDKPlacesResponseKeyState", "__Internal")] - State, - - // extern NSString *const FBSDKPlacesResponseKeyStreet; - [Field ("FBSDKPlacesResponseKeyStreet", "__Internal")] - Street, - - // extern NSString *const FBSDKPlacesResponseKeyZip; - [Field ("FBSDKPlacesResponseKeyZip", "__Internal")] - Zip, - - // extern NSString *const FBSDKPlacesResponseKeyMatchedCategories; - [Field ("FBSDKPlacesResponseKeyMatchedCategories", "__Internal")] - MatchedCategories, - - // extern NSString *const FBSDKPlacesResponseKeyPhotoSource; - [Field ("FBSDKPlacesResponseKeyPhotoSource", "__Internal")] - PhotoSource, - - // extern NSString *const FBSDKPlacesResponseKeyData; - [Field ("FBSDKPlacesResponseKeyData", "__Internal")] - Data, - - // extern NSString *const FBSDKPlacesResponseKeyUrl; - [Field ("FBSDKPlacesResponseKeyUrl", "__Internal")] - Url - } - - public enum PlacesParameterKey { - // extern NSString *const FBSDKPlacesParameterKeySummary; - [Field ("FBSDKPlacesParameterKeySummary", "__Internal")] - Summary - } - - public enum PlacesSummaryKey { - // extern NSString *const FBSDKPlacesSummaryKeyTracking; - [Field ("FBSDKPlacesSummaryKeyTracking", "__Internal")] - Tracking - } - - [Native] - public enum PlaceLocationConfidence : long - { - NotApplicable, - Low, - Medium, - High - } -} diff --git a/Facebook.iOS/source/PlacesKit/License.md b/Facebook.iOS/source/PlacesKit/License.md deleted file mode 100644 index fd1ddf2f..00000000 --- a/Facebook.iOS/source/PlacesKit/License.md +++ /dev/null @@ -1,15 +0,0 @@ -### Xamarin Component for Facebook PlacesKit iOS SDK - -**The MIT License (MIT)** - -Copyright (c) .NET Foundation Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -20180713 - - diff --git a/Facebook.iOS/source/PlacesKit/Loader.cs b/Facebook.iOS/source/PlacesKit/Loader.cs deleted file mode 100644 index 3edbfc05..00000000 --- a/Facebook.iOS/source/PlacesKit/Loader.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; - -namespace Facebook.PlacesKit -{ - public class Loader - { - static Loader () - { - Facebook.CoreKit.Loader.ForceLoad (); - } - - public static void ForceLoad () { } - } -} - -namespace ApiDefinition -{ - partial class Messaging - { - static Messaging () - { - Facebook.PlacesKit.Loader.ForceLoad (); - } - } -} diff --git a/Facebook.iOS/source/PlacesKit/PlacesKit.csproj b/Facebook.iOS/source/PlacesKit/PlacesKit.csproj deleted file mode 100644 index 8a6dd8c2..00000000 --- a/Facebook.iOS/source/PlacesKit/PlacesKit.csproj +++ /dev/null @@ -1,71 +0,0 @@ - - - - Xamarin.iOS10 - true - Facebook.PlacesKit - Facebook.PlacesKit - 1.0.0.0 - 5.12.0 - Resources - true - true - - - - Xamarin.Facebook.PlacesKit.iOS - Facebook PlacesKit SDK for Xamarin iOS - C# binding for Facebook PlacesKit's official SDK - C# binding for Facebook PlacesKit's official SDK - Microsoft - Microsoft - © Microsoft Corporation. All rights reserved. - https://go.microsoft.com/fwlink/?linkid=2007047 - https://go.microsoft.com/fwlink/?linkid=2007163 - true - 5.12.0 - - - - - - - - - - - - - - - - - FBSDKPlacesKit.framework - - - - - - - Framework - True - Accounts CoreLocation Social Security Foundation - -ObjC - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Facebook.iOS/source/ShareKit/ShareKit.csproj b/Facebook.iOS/source/ShareKit/ShareKit.csproj index e16a8b05..7e0c8aed 100644 --- a/Facebook.iOS/source/ShareKit/ShareKit.csproj +++ b/Facebook.iOS/source/ShareKit/ShareKit.csproj @@ -6,7 +6,7 @@ Facebook.ShareKit Facebook.ShareKit 1.0.0.0 - 7.1.1 + 9.0.1.5 Resources true @@ -22,7 +22,7 @@ https://go.microsoft.com/fwlink/?linkid=2007033 https://go.microsoft.com/fwlink/?linkid=2007140 true - 7.1.1 + 9.0.1.5 diff --git a/Facebook.iOS/source/Sources.sln b/Facebook.iOS/source/Sources.sln index 5a24498d..219841d0 100644 --- a/Facebook.iOS/source/Sources.sln +++ b/Facebook.iOS/source/Sources.sln @@ -1,48 +1,26 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AccountKit", "AccountKit\AccountKit.csproj", "{EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AudienceNetwork", "AudienceNetwork\AudienceNetwork.csproj", "{54FF3FE1-B984-4642-8131-16A4E8335A0D}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreKit", "CoreKit\CoreKit.csproj", "{5B88D7C7-6E76-4D0D-8DBE-B3F0A5D6B8A0}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FacebookSdks", "FacebookSdks\FacebookSdks.csproj", "{B8A416D8-45F1-4CD5-9469-5436304E3CBA}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoginKit", "LoginKit\LoginKit.csproj", "{8C6EFD7E-1512-4976-8E47-CF189BF6CB90}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MarketingKit", "MarketingKit\MarketingKit.csproj", "{6ADBEE9E-5804-4362-85E9-811024EFAA15}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlacesKit", "PlacesKit\PlacesKit.csproj", "{30556F40-CE2F-413B-9031-5A7A037AE1C9}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShareKit", "ShareKit\ShareKit.csproj", "{170FAF51-4DF1-4271-B843-3257D285E864}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GamingServicesKit", "GamingServicesKit\GamingServicesKit.csproj", "{F10EB76C-1E5A-4BA9-8EF3-DB7B9A34DDFB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EBD6BF8D-69F1-4611-A778-6A2C2E8D79BF}.Release|Any CPU.Build.0 = Release|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|Any CPU.Build.0 = Release|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Debug|Any CPU.Build.0 = Debug|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Release|Any CPU.ActiveCfg = Release|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Release|Any CPU.Build.0 = Release|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6ADBEE9E-5804-4362-85E9-811024EFAA15}.Release|Any CPU.Build.0 = Release|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {30556F40-CE2F-413B-9031-5A7A037AE1C9}.Release|Any CPU.Build.0 = Release|Any CPU {170FAF51-4DF1-4271-B843-3257D285E864}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {170FAF51-4DF1-4271-B843-3257D285E864}.Debug|Any CPU.Build.0 = Debug|Any CPU {170FAF51-4DF1-4271-B843-3257D285E864}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -55,5 +33,9 @@ Global {B8A416D8-45F1-4CD5-9469-5436304E3CBA}.Debug|Any CPU.Build.0 = Debug|Any CPU {B8A416D8-45F1-4CD5-9469-5436304E3CBA}.Release|Any CPU.ActiveCfg = Release|Any CPU {B8A416D8-45F1-4CD5-9469-5436304E3CBA}.Release|Any CPU.Build.0 = Release|Any CPU + {F10EB76C-1E5A-4BA9-8EF3-DB7B9A34DDFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F10EB76C-1E5A-4BA9-8EF3-DB7B9A34DDFB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F10EB76C-1E5A-4BA9-8EF3-DB7B9A34DDFB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F10EB76C-1E5A-4BA9-8EF3-DB7B9A34DDFB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal From 2ef2cf712fad15e9c88eb5d1ac96502828837432 Mon Sep 17 00:00:00 2001 From: Alex Soto Date: Sat, 27 Feb 2021 21:41:44 -0500 Subject: [PATCH 2/4] [Facebook.iOS] Update all the ApiDefinitions to v9.0.1 --- Facebook.iOS/source/CoreKit/ApiDefinition.cs | 59 ++++++++-- Facebook.iOS/source/CoreKit/Enums.cs | 5 +- .../source/GamingServicesKit/ApiDefinition.cs | 109 ++++++++++++++++++ .../GamingServicesKit.csproj | 66 +++++++++++ .../source/GamingServicesKit/License.md | 13 +++ .../source/GamingServicesKit/Loader.cs | 25 ++++ Facebook.iOS/source/LoginKit/ApiDefinition.cs | 83 ++++++++++++- Facebook.iOS/source/LoginKit/Enums.cs | 10 +- 8 files changed, 358 insertions(+), 12 deletions(-) create mode 100644 Facebook.iOS/source/GamingServicesKit/ApiDefinition.cs create mode 100644 Facebook.iOS/source/GamingServicesKit/GamingServicesKit.csproj create mode 100644 Facebook.iOS/source/GamingServicesKit/License.md create mode 100644 Facebook.iOS/source/GamingServicesKit/Loader.cs diff --git a/Facebook.iOS/source/CoreKit/ApiDefinition.cs b/Facebook.iOS/source/CoreKit/ApiDefinition.cs index 7656d572..3ca88e95 100644 --- a/Facebook.iOS/source/CoreKit/ApiDefinition.cs +++ b/Facebook.iOS/source/CoreKit/ApiDefinition.cs @@ -96,7 +96,7 @@ interface AccessToken : Copying, INSSecureCoding { [Wrap ("UserId")] string UserID { get; } - // @property (readonly, copy, nonatomic) NSString * _Nonnull graphDomain; + [Obsolete ("Use the 'GraphDomain' property on 'AuthenticationToken' instead. This will be removed in future versions.")] [Export ("graphDomain")] string GraphDomain { get; } @@ -114,6 +114,7 @@ interface AccessToken : Copying, INSSecureCoding { IntPtr Constructor (string tokenString, string [] permissions, string [] declinedPermissions, string [] expiredPermissions, string appId, string userId, [NullAllowed] NSDate expirationDate, [NullAllowed] NSDate refreshDate, [NullAllowed] NSDate dataAccessExpirationDate); // -(instancetype _Nonnull)initWithTokenString:(NSString * _Nonnull)tokenString permissions:(NSArray * _Nonnull)permissions declinedPermissions:(NSArray * _Nonnull)declinedPermissions expiredPermissions:(NSArray * _Nonnull)expiredPermissions appID:(NSString * _Nonnull)appID userID:(NSString * _Nonnull)userID expirationDate:(NSDate * _Nullable)expirationDate refreshDate:(NSDate * _Nullable)refreshDate dataAccessExpirationDate:(NSDate * _Nullable)dataAccessExpirationDate graphDomain:(NSString * _Nullable)graphDomain; + [Obsolete ("Use initializers that do not take in 'graphDomain' domain instead.")] [Export ("initWithTokenString:permissions:declinedPermissions:expiredPermissions:appID:userID:expirationDate:refreshDate:dataAccessExpirationDate:graphDomain:")] IntPtr Constructor (string tokenString, string[] permissions, string[] declinedPermissions, string[] expiredPermissions, string appId, string userId, [NullAllowed] NSDate expirationDate, [NullAllowed] NSDate refreshDate, [NullAllowed] NSDate dataAccessExpirationDate, [NullAllowed] string graphDomain); @@ -1096,10 +1097,13 @@ interface Profile : INSCopying, INSSecureCoding { NSString NewProfileKey { get; } // -(instancetype)initWithUserID:(NSString *)userID firstName:(NSString *)firstName middleName:(NSString *)middleName lastName:(NSString *)lastName name:(NSString *)name linkURL:(NSURL *)linkURL refreshDate:(NSDate *)refreshDate __attribute__((objc_designated_initializer)); - [DesignatedInitializer] [Export ("initWithUserID:firstName:middleName:lastName:name:linkURL:refreshDate:")] IntPtr Constructor (string userId, [NullAllowed] string firstName,[NullAllowed] string middleName,[NullAllowed] string lastName,[NullAllowed] string name, [NullAllowed] NSUrl linkUrl, [NullAllowed] NSDate refreshDate); + [Export ("initWithUserID:firstName:middleName:lastName:name:linkURL:refreshDate:imageURL:email:")] + [DesignatedInitializer] + IntPtr Constructor (string userId, [NullAllowed] string firstName, [NullAllowed] string middleName, [NullAllowed] string lastName, [NullAllowed] string name, [NullAllowed] NSUrl linkUrl, [NullAllowed] NSDate refreshDate, [NullAllowed] NSUrl imageUrl, [NullAllowed] string email); + // @property (nonatomic, strong, class) FBSDKProfile * _Nullable currentProfile; [Static] [NullAllowed] @@ -1140,6 +1144,13 @@ interface Profile : INSCopying, INSSecureCoding { [Export ("refreshDate")] NSDate RefreshDate { get; } + [NullAllowed, Export ("imageURL")] + NSUrl ImageUrl { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable email; + [NullAllowed, Export ("email")] + string Email { get; } + // +(void)enableUpdatesOnAccessTokenChange:(BOOL)enable; [Static] [Export ("enableUpdatesOnAccessTokenChange:")] @@ -1154,7 +1165,7 @@ interface Profile : INSCopying, INSSecureCoding { // - (NSURL *)imageURLForPictureMode:(FBSDKProfilePictureMode)mode size:(CGSize)size; [return: NullAllowed] [Export ("imageURLForPictureMode:size:")] - NSUrl ImageUrl (ProfilePictureMode mode, CGSize size); + NSUrl GetImageUrl (ProfilePictureMode mode, CGSize size); // -(BOOL)isEqualToProfile:(FBSDKProfile *)profile; [Export ("isEqualToProfile:")] @@ -1207,11 +1218,6 @@ interface Settings { [Export ("JPEGCompressionQuality")] nfloat JpegCompressionQuality { get; set; } - // @property (getter = isAutoInitEnabled, assign, nonatomic, class) BOOL autoInitEnabled; - [Static] - [Export ("autoInitEnabled")] - bool AutoInitEnabled { [Bind ("isAutoInitEnabled")] get; set; } - // @property (getter = isAutoLogAppEventsEnabled, assign, nonatomic, class) BOOL autoLogAppEventsEnabled; [Static] [Export ("autoLogAppEventsEnabled")] @@ -1227,6 +1233,10 @@ interface Settings { [Export ("advertiserIDCollectionEnabled")] bool AdvertiserIdCollectionEnabled { [Bind ("isAdvertiserIDCollectionEnabled")] get; set; } + [Static] + [Export ("SKAdNetworkReportEnabled")] + bool SKAdNetworkReportEnabled { [Bind ("isSKAdNetworkReportEnabled")] get; set; } + // @property (getter = shouldLimitEventAndDataUsage, assign, nonatomic, class) BOOL limitEventAndDataUsage; [Static] [Export ("limitEventAndDataUsage")] @@ -1278,6 +1288,10 @@ interface Settings { [Export ("graphAPIVersion")] string GraphApiVersion { get; set; } + [Static] + [Export ("advertiserTrackingEnabled")] + bool AdvertiserTrackingEnabled { [Bind ("isAdvertiserTrackingEnabled")] get; set; } + // +(void)setDataProcessingOptions:(NSArray * _Nullable)options; [Static] [Export ("setDataProcessingOptions:")] @@ -1453,4 +1467,33 @@ interface WebViewAppLinkResolver : AppLinkResolving { [Export ("sharedInstance", ArgumentSemantic.Strong)] WebViewAppLinkResolver SharedInstance { get; } } + + [DisableDefaultCtor] + [BaseType (typeof (NSObject), Name = "FBSDKAppLinkResolverRequestBuilder")] + interface AppLinkResolverRequestBuilder { + + [Export ("requestForURLs:")] + GraphRequest GetRequest (NSUrl[] urls); + + [NullAllowed, Export ("getIdiomSpecificField")] + string IdiomSpecificField { get; } + } + + [BaseType (typeof (NSObject), Name = "FBSDKAuthenticationToken")] + [DisableDefaultCtor] + interface AuthenticationToken { + + [Static] + [NullAllowed, Export ("currentAuthenticationToken", ArgumentSemantic.Copy)] + AuthenticationToken CurrentAuthenticationToken { get; set; } + + [Export ("tokenString")] + string TokenString { get; } + + [Export ("nonce")] + string Nonce { get; } + + [Export ("graphDomain")] + string GraphDomain { get; } + } } diff --git a/Facebook.iOS/source/CoreKit/Enums.cs b/Facebook.iOS/source/CoreKit/Enums.cs index c34e2c8e..fb34830a 100644 --- a/Facebook.iOS/source/CoreKit/Enums.cs +++ b/Facebook.iOS/source/CoreKit/Enums.cs @@ -430,6 +430,9 @@ public enum GraphRequestError : ulong { public enum ProfilePictureMode : ulong { Square, - Normal + Normal, + Album, + Small, + Large, } } diff --git a/Facebook.iOS/source/GamingServicesKit/ApiDefinition.cs b/Facebook.iOS/source/GamingServicesKit/ApiDefinition.cs new file mode 100644 index 00000000..802b9209 --- /dev/null +++ b/Facebook.iOS/source/GamingServicesKit/ApiDefinition.cs @@ -0,0 +1,109 @@ +using System; +using Foundation; +using ObjCRuntime; +using UIKit; + +namespace Facebook.GamingServicesKit { + + // typedef void (^FBSDKGamingServiceCompletionHandler)(BOOL, NSError * _Nullable); + delegate void GamingServiceCompletionHandler (bool success, [NullAllowed] NSError error); + + // typedef void (^FBSDKGamingServiceResultCompletionHandler)(BOOL, NSString * _Nullable, NSError * _Nullable); + delegate void GamingServiceResultCompletionHandler (bool success, [NullAllowed] string result, [NullAllowed] NSError error); + + // typedef void (^FBSDKGamingServiceProgressHandler)(int64_t, int64_t, int64_t); + delegate void GamingServiceProgressHandler (long bytesSent, long totalBytesSent, long totalBytesExpectedToSend); + + // @interface FBSDKFriendFinderDialog : NSObject + [BaseType (typeof (NSObject), Name = "FBSDKFriendFinderDialog")] + [DisableDefaultCtor] + interface FriendFinderDialog { + + // +(void)launchFriendFinderDialogWithCompletionHandler:(FBSDKGamingServiceCompletionHandler _Nonnull)completionHandler; + [Static] + [Export ("launchFriendFinderDialogWithCompletionHandler:")] + void LaunchDialog (GamingServiceCompletionHandler completionHandler); + } + + // @interface FBSDKGamingGroupIntegration : NSObject + [BaseType (typeof (NSObject), Name = "FBSDKGamingGroupIntegration")] + interface GamingGroupIntegration { + + // +(void)openGroupPageWithCompletionHandler:(FBSDKGamingServiceCompletionHandler _Nonnull)completionHandler; + [Static] + [Export ("openGroupPageWithCompletionHandler:")] + void OpenGroupPage (GamingServiceCompletionHandler completionHandler); + } + + // @interface FBSDKGamingImageUploader : NSObject + [BaseType (typeof (NSObject), Name = "FBSDKGamingImageUploader")] + [DisableDefaultCtor] + interface GamingImageUploader { + + // +(void)uploadImageWithConfiguration:(FBSDKGamingImageUploaderConfiguration * _Nonnull)configuration andResultCompletionHandler:(FBSDKGamingServiceResultCompletionHandler _Nonnull)completionHandler; + [Static] + [Export ("uploadImageWithConfiguration:andResultCompletionHandler:")] + void UploadImage (GamingImageUploaderConfiguration configuration, GamingServiceResultCompletionHandler completionHandler); + + // +(void)uploadImageWithConfiguration:(FBSDKGamingImageUploaderConfiguration * _Nonnull)configuration completionHandler:(FBSDKGamingServiceResultCompletionHandler _Nonnull)completionHandler andProgressHandler:(FBSDKGamingServiceProgressHandler _Nullable)progressHandler; + [Static] + [Export ("uploadImageWithConfiguration:completionHandler:andProgressHandler:")] + void UploadImage (GamingImageUploaderConfiguration configuration, GamingServiceResultCompletionHandler completionHandler, [NullAllowed] GamingServiceProgressHandler progressHandler); + } + + // @interface FBSDKGamingImageUploaderConfiguration : NSObject + [BaseType (typeof (NSObject), Name = "FBSDKGamingImageUploaderConfiguration")] + [DisableDefaultCtor] + interface GamingImageUploaderConfiguration { + + // @property (readonly, nonatomic, strong) UIImage * _Nonnull image; + [Export ("image", ArgumentSemantic.Strong)] + UIImage Image { get; } + + // @property (readonly, nonatomic, strong) NSString * _Nullable caption; + [NullAllowed, Export("caption", ArgumentSemantic.Strong)] + string Caption { get; } + + // @property (readonly, assign, nonatomic) BOOL shouldLaunchMediaDialog; + [Export ("shouldLaunchMediaDialog")] + bool ShouldLaunchMediaDialog { get; } + + // -(instancetype _Nonnull)initWithImage:(UIImage * _Nonnull)image caption:(NSString * _Nullable)caption shouldLaunchMediaDialog:(BOOL)shouldLaunchMediaDialog; + [Export ("initWithImage:caption:shouldLaunchMediaDialog:")] + IntPtr Constructor (UIImage image, [NullAllowed] string caption, bool shouldLaunchMediaDialog); + } + + // @interface FBSDKGamingVideoUploader : NSObject + [BaseType (typeof (NSObject), Name = "FBSDKGamingVideoUploader")] + [DisableDefaultCtor] + interface GamingVideoUploader { + + // +(void)uploadVideoWithConfiguration:(FBSDKGamingVideoUploaderConfiguration * _Nonnull)configuration andResultCompletionHandler:(FBSDKGamingServiceResultCompletionHandler _Nonnull)completionHandler; + [Static] + [Export ("uploadVideoWithConfiguration:andResultCompletionHandler:")] + void UploadVideo (GamingVideoUploaderConfiguration configuration, GamingServiceResultCompletionHandler completionHandler); + + // +(void)uploadVideoWithConfiguration:(FBSDKGamingVideoUploaderConfiguration * _Nonnull)configuration completionHandler:(FBSDKGamingServiceResultCompletionHandler _Nonnull)completionHandler andProgressHandler:(FBSDKGamingServiceProgressHandler _Nullable)progressHandler; + [Static] + [Export ("uploadVideoWithConfiguration:completionHandler:andProgressHandler:")] + void UploadVideo (GamingVideoUploaderConfiguration configuration, GamingServiceResultCompletionHandler completionHandler, [NullAllowed] GamingServiceProgressHandler progressHandler); + } + + // @interface FBSDKGamingVideoUploaderConfiguration : NSObject + [BaseType (typeof (NSObject), Name = "FBSDKGamingVideoUploaderConfiguration")] + [DisableDefaultCtor] + interface GamingVideoUploaderConfiguration { + + // @property (readonly, nonatomic, strong) NSURL * _Nonnull videoURL; + [Export ("videoURL", ArgumentSemantic.Strong)] + NSUrl VideoUrl { get; } + + // @property (readonly, nonatomic, strong) NSString * _Nullable caption; + [NullAllowed, Export("caption", ArgumentSemantic.Strong)] + string Caption { get; } + + // -(instancetype _Nonnull)initWithVideoURL:(NSURL * _Nonnull)videoURL caption:(NSString * _Nullable)caption; + [Export ("initWithVideoURL:caption:")] + IntPtr Constructor (NSUrl videoUrl, [NullAllowed] string caption); + } +} diff --git a/Facebook.iOS/source/GamingServicesKit/GamingServicesKit.csproj b/Facebook.iOS/source/GamingServicesKit/GamingServicesKit.csproj new file mode 100644 index 00000000..766dd301 --- /dev/null +++ b/Facebook.iOS/source/GamingServicesKit/GamingServicesKit.csproj @@ -0,0 +1,66 @@ + + + + Xamarin.iOS10 + true + Facebook.GamingServicesKit + Xamarin.Facebook.GamingServicesKit + 1.0.0.0 + 9.0.1.5 + Resources + true + + + + Xamarin.Facebook.GamingServicesKit.iOS + Facebook GamingServicesKit SDK for Xamarin iOS + C# binding for Facebook GamingServicesKit's official SDK + C# binding for Facebook GamingServicesKit's official SDK + Microsoft + Microsoft + © Microsoft Corporation. All rights reserved. + https://go.microsoft.com/fwlink/?linkid=2007033 + https://go.microsoft.com/fwlink/?linkid=2007140 + true + 9.0.1.5 + + + + + + + + + + + + + + + + + FBSDKGamingServicesKit.framework + + + + + + + Framework + True + -ObjC + Accounts AudioToolbox CoreGraphics CoreLocation Foundation QuartzCore Security Social UIKit + + + + + + + + + + + + + + diff --git a/Facebook.iOS/source/GamingServicesKit/License.md b/Facebook.iOS/source/GamingServicesKit/License.md new file mode 100644 index 00000000..68b1beaa --- /dev/null +++ b/Facebook.iOS/source/GamingServicesKit/License.md @@ -0,0 +1,13 @@ +### Xamarin Component for Facebook GamingServicesKit iOS SDK + +**The MIT License (MIT)** + +Copyright (c) .NET Foundation Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +20210126 diff --git a/Facebook.iOS/source/GamingServicesKit/Loader.cs b/Facebook.iOS/source/GamingServicesKit/Loader.cs new file mode 100644 index 00000000..f8fd0307 --- /dev/null +++ b/Facebook.iOS/source/GamingServicesKit/Loader.cs @@ -0,0 +1,25 @@ +using System; + +namespace Facebook.GamingServicesKit +{ + public class Loader + { + static Loader () + { + Facebook.CoreKit.Loader.ForceLoad (); + } + + public static void ForceLoad () { } + } +} + +namespace ApiDefinition +{ + partial class Messaging + { + static Messaging () + { + Facebook.GamingServicesKit.Loader.ForceLoad (); + } + } +} diff --git a/Facebook.iOS/source/LoginKit/ApiDefinition.cs b/Facebook.iOS/source/LoginKit/ApiDefinition.cs index 33b52ff5..f79759ff 100644 --- a/Facebook.iOS/source/LoginKit/ApiDefinition.cs +++ b/Facebook.iOS/source/LoginKit/ApiDefinition.cs @@ -133,6 +133,12 @@ interface LoginButton { // @property (assign, nonatomic) FBSDKTooltipColorStyle tooltipColorStyle; [Export ("tooltipColorStyle", ArgumentSemantic.Assign)] TooltipColorStyle TooltipColorStyle { get; set; } + + [Export ("loginTracking", ArgumentSemantic.Assign)] + LoginTracking LoginTracking { get; set; } + + [NullAllowed, Export ("nonce")] + string Nonce { get; set; } } interface ILoginButtonDelegate { @@ -185,6 +191,12 @@ interface LoginManager { [Export ("logInWithPermissions:fromViewController:handler:")] void LogIn (string [] permissions, [NullAllowed] UIViewController fromViewController, [NullAllowed] LoginManagerLoginResultBlockHandler handler); + [Export ("logInFromViewController:configuration:completion:")] + void LogIn ([NullAllowed] UIViewController fromViewController, LoginConfiguration configuration, LoginManagerLoginResultBlockHandler completion); + + [Export ("logInWithURL:handler:")] + void LogIn (NSUrl url, [NullAllowed] LoginManagerLoginResultBlockHandler handler); + // -(void)reauthorizeDataAccess:(UIViewController *)fromViewController handler:(FBSDKLoginManagerLoginResultBlockHandler)handler; [Export ("reauthorizeDataAccess:handler:")] void ReauthorizeDataAccess (UIViewController fromViewController, LoginManagerLoginResultBlockHandler handler); @@ -204,6 +216,9 @@ interface LoginManagerLoginResult { [Export ("token", ArgumentSemantic.Copy)] CoreKit.AccessToken Token { get; set; } + [NullAllowed, Export ("authenticationToken", ArgumentSemantic.Copy)] + CoreKit.AuthenticationToken AuthenticationToken { get; set; } + // @property (readonly, nonatomic) BOOL isCancelled; [Export ("isCancelled")] bool IsCancelled { get; } @@ -220,8 +235,8 @@ interface LoginManagerLoginResult { // -(instancetype)initWithToken:(FBSDKAccessToken *)token isCancelled:(BOOL)isCancelled grantedPermissions:(NSSet *)grantedPermissions declinedPermissions:(NSSet *)declinedPermissions __attribute__((objc_designated_initializer)); [DesignatedInitializer] - [Export ("initWithToken:isCancelled:grantedPermissions:declinedPermissions:")] - IntPtr Constructor ([NullAllowed] CoreKit.AccessToken token, bool isCancelled, [NullAllowed] NSSet grantedPermissions, [NullAllowed] NSSet declinedPermissions); + [Export ("initWithToken:authenticationToken:isCancelled:grantedPermissions:declinedPermissions:")] + IntPtr Constructor ([NullAllowed] CoreKit.AccessToken token, [NullAllowed] CoreKit.AuthenticationToken authenticationToken, bool isCancelled, [NullAllowed] NSSet grantedPermissions, [NullAllowed] NSSet declinedPermissions); } // @interface FBSDKLoginTooltipView : FBSDKTooltipView @@ -312,4 +327,68 @@ interface TooltipView { [Export ("dismiss")] void Dismiss (); } + + [BaseType (typeof (NSObject), Name = "FBSDKLoginConfiguration")] + [DisableDefaultCtor] + interface LoginConfiguration { + + [Export ("nonce")] + string Nonce { get; } + + [Export ("tracking")] + LoginTracking Tracking { get; } + + [Export ("requestedPermissions", ArgumentSemantic.Copy)] + NSSet RequestedPermissions { get; } + + [Export ("initWithPermissions:tracking:nonce:")] + IntPtr Constructor (string[] permissions, LoginTracking tracking, string nonce); + + [Export ("initWithPermissions:tracking:")] + IntPtr Constructor (string[] permissions, LoginTracking tracking); + + [Export ("initWithTracking:")] + IntPtr Constructor (LoginTracking tracking); + } + + [BaseType (typeof (NSObject), Name = "FBSDKReferralCode")] + [DisableDefaultCtor] + interface ReferralCode { + + [Export ("value", ArgumentSemantic.Strong)] + string Value { get; set; } + + [Static] + [Export ("initWithString:")] + [return: NullAllowed] + ReferralCode Create (string @string); + } + + delegate void ReferralManagerResultBlockHandler ([NullAllowed] ReferralManagerResult result, [NullAllowed] NSError error); + + [BaseType (typeof (NSObject), Name = "FBSDKReferralManager")] + interface ReferralManager { + + [Export ("initWithViewController:")] + IntPtr Constructor ([NullAllowed] UIViewController viewController); + + [Async] + [Export ("startReferralWithCompletionHandler:")] + void StartReferral ([NullAllowed] ReferralManagerResultBlockHandler handler); + } + + [BaseType (typeof (NSObject), Name = "FBSDKReferralManagerResult")] + [DisableDefaultCtor] + interface ReferralManagerResult { + + [Export ("isCancelled")] + bool IsCancelled { get; } + + [Export ("referralCodes", ArgumentSemantic.Copy)] + ReferralCode [] ReferralCodes { get; set; } + + [Export ("initWithReferralCodes:isCancelled:")] + [DesignatedInitializer] + IntPtr Constructor ([NullAllowed] ReferralCode [] referralCodes, bool isCancelled); + } } diff --git a/Facebook.iOS/source/LoginKit/Enums.cs b/Facebook.iOS/source/LoginKit/Enums.cs index 0b37d8e6..c76ee753 100644 --- a/Facebook.iOS/source/LoginKit/Enums.cs +++ b/Facebook.iOS/source/LoginKit/Enums.cs @@ -33,7 +33,9 @@ public enum LoginError : long { UnconfirmedUser, SystemAccountAppDisabled, SystemAccountUnavailable, - BadChallengeString + BadChallengeString, + InvalidIdToken, + MissingAccessToken, } [Native] @@ -65,4 +67,10 @@ public enum TooltipColorStyle : ulong FriendlyBlue = 0, NeutralGray = 1 } + + [Native] + public enum LoginTracking : ulong { + Enabled, + Limited, + } } From b9ddfff49f9ef1deb7b1c39fc72a2df8a8aef59e Mon Sep 17 00:00:00 2001 From: Alex Soto Date: Wed, 3 Mar 2021 21:25:15 -0500 Subject: [PATCH 3/4] Bring back AudienceNetwork --- Facebook.iOS/build.cake | 2 + Facebook.iOS/components.cake | 8 + Facebook.iOS/docs/AudienceNetwork/Details.md | 16 + .../docs/AudienceNetwork/GettingStarted.md | 881 ++++++++ .../FBAudienceNetworkSample/AdPlacementIds.cs | 19 + .../AdsViewController.cs | 334 +++ .../AdsViewController.designer.cs | 40 + .../FBAudienceNetworkSample/AppDelegate.cs | 42 + .../LaunchImage.launchimage/Contents.json | 17 + .../FBAudienceNetworkSample/CustomNativeAd.cs | 19 + .../Entitlements.plist | 6 + .../FBAudienceNetworkSample.csproj | 144 ++ .../FBAudienceNetworkSample/Info.plist | 67 + .../LaunchScreen.storyboard | 27 + .../samples/FBAudienceNetworkSample/Main.cs | 26 + .../MainStoryboard.storyboard | 225 ++ .../NativeAdTableViewCell.cs | 41 + .../NativeAdTableViewCell.designer.cs | 100 + .../NativeAdTemplateTableViewCell.cs | 19 + .../NativeAdTemplateTableViewCell.designer.cs | 27 + Facebook.iOS/samples/Samples.sln | 38 + .../source/AudienceNetwork/ApiDefinition.cs | 1875 +++++++++++++++++ .../AudienceNetwork/AudienceNetwork.csproj | 73 + Facebook.iOS/source/AudienceNetwork/Enums.cs | 303 +++ .../source/AudienceNetwork/License.md | 15 + .../source/AudienceNetwork/Structs.cs | 28 + .../source/AudienceNetwork/extensions.cs | 120 ++ Facebook.iOS/source/Sources.sln | 6 + 28 files changed, 4518 insertions(+) create mode 100644 Facebook.iOS/docs/AudienceNetwork/Details.md create mode 100644 Facebook.iOS/docs/AudienceNetwork/GettingStarted.md create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/AdPlacementIds.cs create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.cs create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.designer.cs create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/AppDelegate.cs create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/Assets.xcassets/LaunchImage.launchimage/Contents.json create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/CustomNativeAd.cs create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/Entitlements.plist create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/FBAudienceNetworkSample.csproj create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/Info.plist create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/LaunchScreen.storyboard create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/Main.cs create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/MainStoryboard.storyboard create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.cs create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.designer.cs create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.cs create mode 100644 Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.designer.cs create mode 100644 Facebook.iOS/source/AudienceNetwork/ApiDefinition.cs create mode 100644 Facebook.iOS/source/AudienceNetwork/AudienceNetwork.csproj create mode 100644 Facebook.iOS/source/AudienceNetwork/Enums.cs create mode 100644 Facebook.iOS/source/AudienceNetwork/License.md create mode 100644 Facebook.iOS/source/AudienceNetwork/Structs.cs create mode 100644 Facebook.iOS/source/AudienceNetwork/extensions.cs diff --git a/Facebook.iOS/build.cake b/Facebook.iOS/build.cake index a775747f..1b33f765 100644 --- a/Facebook.iOS/build.cake +++ b/Facebook.iOS/build.cake @@ -123,6 +123,8 @@ Task ("externals") // Call here custom methods created at custom_externals_download.cake file // to download frameworks and/or bundles for the artifact + if (ARTIFACTS_TO_BUILD.Contains (AUDIENCE_NETWORK_ARTIFACT)) + DownloadAudienceNetwork (AUDIENCE_NETWORK_ARTIFACT); }); Task ("ci-setup") diff --git a/Facebook.iOS/components.cake b/Facebook.iOS/components.cake index 3864207e..2e589d3e 100644 --- a/Facebook.iOS/components.cake +++ b/Facebook.iOS/components.cake @@ -6,6 +6,7 @@ var FACEBOOK_SDKS_VERSION = FACEBOOK_SDK_VERSION; var LOGIN_KIT_VERSION = FACEBOOK_SDK_VERSION; var SHARE_KIT_VERSION = FACEBOOK_SDK_VERSION; var GAMINGSERVICES_KIT_VERSION = FACEBOOK_SDK_VERSION; +var AUDIENCE_NETWORK_VERSION = "5.10.1"; var CORE_KIT_NUGET_VERSION = NUGET_VERSION; var FACEBOOK_SDKS_NUGET_VERSION = NUGET_VERSION; @@ -19,8 +20,10 @@ Artifact FACEBOOK_SDKS_ARTIFACT = new Artifact ("FacebookSdks", FACEBO Artifact LOGIN_KIT_ARTIFACT = new Artifact ("LoginKit", LOGIN_KIT_NUGET_VERSION, "9.0"); Artifact SHARE_KIT_ARTIFACT = new Artifact ("ShareKit", SHARE_KIT_NUGET_VERSION, "9.0"); Artifact GAMINGSERVICES_KIT_ARTIFACT = new Artifact ("GamingServicesKit", GAMINGSERVICES_KIT_NUGET_VERSION, "9.0"); +Artifact AUDIENCE_NETWORK_ARTIFACT = new Artifact ("AudienceNetwork", AUDIENCE_NETWORK_VERSION, "9.0"); var ARTIFACTS = new Dictionary { + { "AudienceNetwork", AUDIENCE_NETWORK_ARTIFACT }, { "CoreKit", CORE_KIT_ARTIFACT }, { "FacebookSdks", FACEBOOK_SDKS_ARTIFACT }, { "LoginKit", LOGIN_KIT_ARTIFACT }, @@ -30,6 +33,7 @@ var ARTIFACTS = new Dictionary { void SetArtifactsDependencies () { + AUDIENCE_NETWORK_ARTIFACT.Dependencies = null; CORE_KIT_ARTIFACT.Dependencies = null; FACEBOOK_SDKS_ARTIFACT.Dependencies = new [] { CORE_KIT_ARTIFACT, LOGIN_KIT_ARTIFACT, SHARE_KIT_ARTIFACT, GAMINGSERVICES_KIT_ARTIFACT }; LOGIN_KIT_ARTIFACT.Dependencies = new [] { CORE_KIT_ARTIFACT }; @@ -39,6 +43,9 @@ void SetArtifactsDependencies () void SetArtifactsPodSpecs () { + AUDIENCE_NETWORK_ARTIFACT.PodSpecs = new [] { + PodSpec.Create ("FBAudienceNetwork", AUDIENCE_NETWORK_VERSION, frameworkSource: FrameworkSource.Custom) + }; CORE_KIT_ARTIFACT.PodSpecs = new [] { PodSpec.Create ("FBSDKCoreKit", CORE_KIT_VERSION) }; @@ -62,6 +69,7 @@ void SetArtifactsExtraPodfileLines () void SetArtifactsSamples () { + AUDIENCE_NETWORK_ARTIFACT.Samples = new [] { "FBAudienceNetworkSample" }; CORE_KIT_ARTIFACT.Samples = null; FACEBOOK_SDKS_ARTIFACT.Samples = new [] { "HelloFacebook", "FacebookiOSSample" }; LOGIN_KIT_ARTIFACT.Samples = null; diff --git a/Facebook.iOS/docs/AudienceNetwork/Details.md b/Facebook.iOS/docs/AudienceNetwork/Details.md new file mode 100644 index 00000000..a204fc34 --- /dev/null +++ b/Facebook.iOS/docs/AudienceNetwork/Details.md @@ -0,0 +1,16 @@ +Facebook's Audience Network allows you to monetize your iOS apps with targeted ads. Audience Network gives you a powerful way to make more money and grow your business with Facebook ads while you keep users engaged. + +## How Audience Network Helps You Monetize Your App + +* **Facebook Targeting Based on Real People:** Show highly targeted ads that match the interests of your users. +* **Better Ads, Better User Experience:** Native ads that fit your app make for a great experience. +* **More Money for You:** Earn more revenue when your users engage with ads. + +## Flexible, High-Performing Formats + +Drive better performance with ads people want to see. With Audience Network, you can deliver compelling ads to your users. You choose how they look and where they appear in the user flow: + +* **Native:** Ads that you design to fit your app, seamlessly. +* **Interstitial:** Full-screen ads that capture attention and become part of the experience. +* **Banner:** Traditional formats in a variety of placements. +* **In-Stream Video:** Show ad content during a video for high revenue potential. diff --git a/Facebook.iOS/docs/AudienceNetwork/GettingStarted.md b/Facebook.iOS/docs/AudienceNetwork/GettingStarted.md new file mode 100644 index 00000000..840e534e --- /dev/null +++ b/Facebook.iOS/docs/AudienceNetwork/GettingStarted.md @@ -0,0 +1,881 @@ +# Getting Started with the Facebook Audience Network + +Facebook's Audience Network allows you to monetize your iOS app with targeted ads. Please, follow [this guide][1] to walks you through steps to get started on Audience Network. + +--- + +# Preparing Your Audience Network Integration For App Transport Security (ATS) + +[App Transport Security (ATS)][11] is a privacy feature introduced in iOS 9. It's enabled by default for new applications and enforces secure connections. This guide will review actions you should take to ensure you are prepared when using the Facebook SDK for iOS. + +## Audience Network SDK is built to be 100% compliant. + +Part of being compliant is leveraging `SFSafariViewController` for displaying content. `SFSafariViewController` by default disables ATS. You do not need to enable any exceptions in your configuration for ads to be delivered from Audience Network. + +--- + +# Adding the Native Ad API in iOS + +The Native Ad API allows you to build a customized experience for the ads you show in your app. When using the Native Ad API, instead of receiving an ad ready to be displayed, you will receive a group of ad properties such as a title, an image, a call to action, and you will have to use them to construct a custom `UIView` where the ad is shown. + +> ![information_icon] _Please consult our [guidelines for native ads][2] when designing native ads in your app._ + +Let's implement the following native ad placement. You will create the following views to our native ad. + +* **View #1:** advertiser icon +* **View #2:** ad title +* **View #3:** sponsored label +* **View #4:** advertiser choice +* **View #5:** ad media view +* **View #6:** social context +* **View #7:** ad body +* **View #8:** ad call to action button + +![adImage](https://scontent.fgdl4-1.fna.fbcdn.net/v/t39.2365-6/15119831_604335559772201_4765472987522531328_n.png?_nc_cat=0&oh=6c08c32196ca96a990c82218896875ce&oe=5C134D88) + +## Step 1: Create Native Ad Views in Storyboard + +> ![information_icon] _When designing native ads and banner ads, ensure you have followed [iOS layout guideline][3] for optimal user experience._ + +> ![information_icon] _If you want to use the Xcode designer instead of Visual Studio designer to create the Native Ad View, plaese, read the first step of this [guide][4]._ + +1. Open the **MainStoryboard.storyboard** file in Visual Studio and add a `UIView` element to the main View element and name it to `AdUIView`. In addition, add an `AdIconView` (FBAdIconView), `LblAdTitle` (UILabel), `AdCoverMediaView` (FBMediaView), `LblAdSocialContext` (UILabel), `BtnAdCallToActiona` (UIButton), `AdChoiceView` (FBAdChoicesView), `LblAdBody` (UILabel), `LblSponsored` (UILabel) under `AdUIView` as illustrated in the image below. + + + +2. Add the necessary constraints to the view. +3. Build and run the project. You should see from your device or simulator empty content as follows: + + + +Now that you have created all the UI elements to show native ads, the next step is to load the native ad and bind the contents to the UI elements. + +## Step 2: Load and Show Native Ad + +1. Now, in your View Controller file, import the `Facebook.AudienceNetwork` namespace, declare that `ViewController` implements the `INativeAdDelegate` protocol and add a nativeAd instance variable: + + ```csharp + using Facebook.AudienceNetwork; + + namespace YourApp + { + public partial class ViewController : UIViewController, INativeAdDelegate + { + NativeAd nativeAd; + } + } + ``` + +2. In `ViewDidLoad` method, add the following lines of code to load native ad content: + + ```csharp + public override void ViewDidLoad () + { + base.ViewDidLoad (); + // Perform any additional setup after loading the view, typically from a nib. + + // Instantiate a NativeAd object. + // NOTE: the placement ID will eventually identify this as your App, you can ignore it for + // now, while you are testing and replace it later when you have signed up. + // While you are using this temporary code you will only get test ads and if you release + // your code like this to the App Store your users will not receive ads (you will get a no fill error). + + nativeAd = new NativeAd ("Native_Placement_Id") { Delegate = this }; + nativeAd.LoadAd (); + } + ``` + + Replace `Native_Placement_Id` with your own placement id string. If you don't have a placement id or don't know how to get one, you can refer to the [Getting Started Guide][5]. + +3. The next step is to show ad when content is ready. You would need to implement `NativeAdDidLoad` method in `ViewController` file: + + ```csharp + [Export ("nativeAdDidLoad:")] + public void NativeAdDidLoad (NativeAd nativeAd) + { + this.nativeAd = nativeAd; + + if (this.nativeAd != null && this.nativeAd.IsAdValid) + nativeAd.UnregisterView (); + + // Wire up UIView with the native ad; only call to action button and media view will be clickable. + nativeAd.RegisterView (AdUIView, AdCoverMediaView, AdIconView, this, new UIView [] { BtnAdCallToAction, AdCoverMediaView }); + + // Render native ads onto UIView + LblAdTitle.Text = this.nativeAd.AdvertiserName; + LblAdBody.Text = this.nativeAd.BodyText; + LblAdSocialContext.Text = this.nativeAd.SocialContext; + LblSponsored.Text = this.nativeAd.SponsoredTranslation; + BtnAdCallToAction.SetTitle (this.nativeAd.CallToAction, UIControlState.Normal); + AdChoiceView.NativeAd = this.nativeAd; + AdChoiceView.Corner = UIRectCorner.TopRight; + } + ``` + + First, you will need to check if there is an existing `nativeAd` object. If there is, you will need to call `UnregisterView` method. Then you will call `nativeAd.RegisterView` method. + + What `RegisterView` mainly does is register what views will be tappable and what the delegate is to notify when a registered view is tapped. In this case, `BtnAdCallToAction` and `AdCoverMediaView` will be tappable and when the view is tapped, ViewController will be notified through `INativeAdDelegate` interface. + + ### Controlling Clickable Area + + > ![information_icon] _For a better user experience and better results, you should always consider controlling the clickable area of your ad to avoid unintentional clicks. Please refer to [Audience Network SDK Policy][6] page for more details about white space unclickable enforcement._ + + For finer control of what is clickable, you can use the `nativeAd.RegisterView (UIView, UIViewController, UIView [])` overload method to register a list of views that can be clicked. + +4. Choose your build target to be device and run the above code, you should see something like this: + + + +> ![information_icon] _When running ads in the simulator, change the setting to test mode to view test ads. Please go to [How to Use Test Mode][7] for more information._ + +## Step 3: How to Get the Aspect Ratio of the Content and Apply Natural Width and Height + +In the example above, the media content of the ad is shown in `AdCoverMediaView` and its object type is `MediaView`. From previous step, we have shown how to use `MediaView` to load media content from a given `NativeAd` object. This view takes the place of manually loading a cover image. When creating the `MediaView`, its width and height can be either determined by the auto layout constraints set in the storyboard, or they can be hard-coded. However, the width and height of the view may not be fit with the actual cover image of the ad downloaded later. To fix this, the example following shows how to get the aspect ratio of the content and apply natural width and height: + +1. In your `ViewController`, declare that `ViewController` implements the `IMediaViewDelegate` interface as follows: + + ```csharp + public partial class ViewController : UIViewController, INativeAdDelegate, IMediaViewDelegate + ``` + +2. When the native ad is loaded, set the delegate of `MediaView` object to be the controller self as follows: + + ```csharp + [Export ("nativeAdDidLoad:")] + public void NativeAdDidLoad (NativeAd nativeAd) + { + // ... + AdCoverMediaView.Delegate = this; + // ... + } + ``` + +3. Implement `MediaViewDidLoad` method in `ViewController` as follows: + + ```csharp + [Export ("mediaViewDidLoad:")] + public void MediaViewDidLoad (MediaView mediaView) + { + var currentAspect = mediaView.Frame.Width / mediaView.Frame.Height; + Console.WriteLine ($"Current aspect of media view: {currentAspect}"); + + var actualAspect = mediaView.AspectRatio; + Console.WriteLine ($"Current aspect of media view: {actualAspect}"); + } + ``` + + `mediaView.AspectRatio` returns a positive `nfloat`, or `0.0` if no ad is currently loaded. Its value is valid after media view is loaded. There are convenience methods that will set the width and height of the `MediaView` object respecting its apsect ratio of the media content loaded. You can call `ApplyNaturalWidth` or `ApplyNaturalHeight` methods to update the `MediaView` object's width or height to respect the media content's aspect ratio. + +## Step 4: Verify Impression and Click Logging + +Optionally, you can add the following functions to handle the cases where the native ad is closed or when the user clicks on it: + +```csharp +[Export ("nativeAdDidClick:")] +public void NativeAdDidClick (NativeAd nativeAd) +{ + Console.WriteLine ("Native ad was clicked."); +} + +[Export ("nativeAdDidFinishHandlingClick:")] +public void NativeAdDidFinishHandlingClick (NativeAd nativeAd) +{ + Console.WriteLine ("Native ad did finish click handling."); +} + +[Export ("nativeAdWillLogImpression:")] +public void NativeAdWillLogImpression (NativeAd nativeAd) +{ + Console.WriteLine ("Native ad impression is being captured."); +} +``` + +## Step 5: How to Debug When Ad Not Shown + +Add and implement the following function in your `ViewController` to handle ad loading failures and completions: + +```csharp +[Export ("nativeAd:didFailWithError:")] +public void NativeAdDidFail (NativeAd nativeAd, NSError error) +{ + Console.WriteLine ($"Native ad failed to load with error: {error.LocalizedDescription}"); +} +``` + +## Step 6: Load Ad without Auto Cache + +1. We strongly recommend to leave media caching on by default in all cases. However, we allow you to override the default. Please be very careful if you decide to override our default media caching. + + ```csharp + public partial class ViewController : UIViewController, INativeAdDelegate, IMediaViewDelegate { + + public override void ViewDidLoad () + { + base.ViewDidLoad (); + // Perform any additional setup after loading the view, typically from a nib. + + // Instantiate a NativeAd object. + // NOTE: the placement ID will eventually identify this as your App, you can ignore it for + // now, while you are testing and replace it later when you have signed up. + // While you are using this temporary code you will only get test ads and if you release + // your code like this to the App Store your users will not receive ads (you will get a no fill error). + + nativeAd = new NativeAd ("Native_Placement_Id") { Delegate = this }; + nativeAd.LoadAd (NativeAdsCachePolicy.None); + } + + } + ``` + +2. First, you will need to manually download all media for the native ad. + + ```csharp + [Export ("nativeAdDidLoad:")] + public void NativeAdDidLoad (NativeAd nativeAd) + { + AdCoverMediaView.Delegate = this; + nativeAd.DownloadMedia (); + this.nativeAd = nativeAd; + } + ``` + +3. Next, you should only call `RegisterView` and display ad after `MediaViewDidLoad` callback. All media has to be loaded and displayed for an eligible impression. + + ```csharp + [Export ("nativeAdDidLoad:")] + public void NativeAdDidLoad (NativeAd nativeAd) + { + if (this.nativeAd != null && this.nativeAd.IsAdValid) + this.nativeAd.UnregisterView (); + + // Wire up UIView with the native ad; only call to action button and media view will be clickable. + nativeAd.RegisterView (AdUIView, AdCoverMediaView, AdIconView, this, new UIView [] { BtnAdCallToAction, AdCoverMediaView }); + + // Render native ads onto UIView + LblAdTitle.Text = this.nativeAd.AdvertiserName; + LblAdBody.Text = this.nativeAd.BodyText; + LblAdSocialContext.Text = this.nativeAd.SocialContext; + LblSponsored.Text = this.nativeAd.SponsoredTranslation; + BtnAdCallToAction.SetTitle (this.nativeAd.CallToAction, UIControlState.Normal); + AdChoiceView.NativeAd = this.nativeAd; + AdChoiceView.Corner = UIRectCorner.TopRight; + } + ``` + +--- + +# Native Ads Template + +Publishers seeking a more hands off approach when integrating Native Ads can leverage a custom Audience Network Native Ads template. Customize a native ad's size, color, and font to match the look and feel of your app. + +## Step 1: Implementation + +In your `ViewController`, import the `Facebook.AudienceNetwork` namespace and declare that you implement the `INativeAdDelegate` interface: + +```csharp +using Facebook.AudienceNetwork; + +namespace YourApp +{ + public partial class ViewController : UIViewController, INativeAdDelegate + { + + } +} +``` + +Then, add a method in your `ViewController` that initializes a `NativeAd` and request an ad to load: + +```csharp +public override void ViewDidLoad () +{ + base.ViewDidLoad (); + // Perform any additional setup after loading the view, typically from a nib. + + nativeAd = new NativeAd ("Native_Placement_Id") { Delegate = this }; + nativeAd.LoadAd (); +} +``` + +Replace `Native_Placement_`Id with your own placement id string. If you don't have a placement id or don't know how to get one, you can refer to the [Getting Started Guide][5]. + +Now that you have added the code to load the ad, add the following functions to construct the ad once it has loaded: + +```csharp +[Export ("nativeAdDidLoad:")] +public void NativeAdDidLoad (NativeAd nativeAd) +{ + var adView = NativeAdView.From (nativeAd, NativeAdViewType.GenericHeight300); + + View.AddSubview (adView); + + var size = View.Bounds.Size; + var xOffset = size.Width / 2 - 160; + var yOffset = size.Height > size.Width ? 100 : 20; + adView.Frame = new CGRect (xOffset, yOffset, 320, 300); +} +``` + +Choose your build target to be device and run the above code, you should see something like this: + + + +Custom Ad Formats come in four templates: + +| Template View Type | Height | Width | Attributes Included | +|---------------------------------------|--------|----------------|------------------------------------------------------------------| +| **NativeAdViewType.GenericHeight100** | 100dp | Flexible width | Icon, title, context, and CTA button | +| **NativeAdViewType.GenericHeight120** | 120dp | Flexible width | Icon, title, context, description and CTA button | +| **NativeAdViewType.GenericHeight300** | 300dp | Flexible width | Image, icon, title, context, description and CTA button | +| **NativeAdViewType.GenericHeight400** | 400dp | Flexible width | Image, icon, title, subtitle context, description and CTA button | + +Native ad templates can also be used in tandem with a Horizontal Scroll View. See [here][8] for details. + +## Step 2: Further Customization + +With a native custom template, you can customize the following elements: + +* Height +* Width +* Background Color +* Title Color +* Title Font +* Description Color +* Description Font +* Button Color +* Button Title Color +* Button Title Font +* Button Border Color + +If you want to customize certain elements, then it is recommended to use a design that fits in with your app's layouts and themes. + +You will need to build `NativeAdViewAttributes` object and provide a loaded native ad to render these elements: + +```csharp +[Export ("nativeAdDidLoad:")] +public void NativeAdDidLoad (NativeAd nativeAd) +{ + var attributes = new NativeAdViewAttributes { + BackgroundColor = UIColor.FromRGBA (.9f, .9f, .9f, 1), + ButtonColor = UIColor.FromRGBA (66f / 255, 108f / 255, 173f / 255, 1), + ButtonTitleColor = UIColor.White + }; + + var adView = NativeAdView.From (nativeAd, NativeAdViewType.GenericHeight300, attributes); + + View.AddSubview (adView); + + var size = View.Bounds.Size; + var xOffset = size.Width / 2 - 160; + var yOffset = size.Height > size.Width ? 100 : 20; + adView.Frame = new CGRect (xOffset, yOffset, 320, 300); +} +``` + +The above code will render an ad that looks like this: + + + +--- + +# Adding Interstitial Ad to your iOS app + +The Audience Network allows you to monetize your iOS apps with Facebook ads. An interstitial ad is a full screen ad that you can show in your app. Follow this guide to display this type of ad unit. + +Let's implement the following interstitial ad placement. + + + +## Step 1: Load and Show Interstitial Ad View + +1. In your `ViewController`, import the `Facebook.AudienceNetwork` namespace and declare that `ViewController` implements the `IInterstitialAdDelegate` interface and add an instance variable for the interstitial ad unit: + + ```csharp + using Facebook.AudienceNetwork; + + namespace YourApp + { + public partial class ViewController : UIViewController, IInterstitialAdDelegate + { + InterstitialAd interstitialAd; + } + } + ``` + +2. Next, implement `ViewDidLoad` method and `InterstitialAdDidLoad` in `ViewController` file. + + ```csharp + public override void ViewDidLoad () + { + base.ViewDidLoad (); + // Perform any additional setup after loading the view, typically from a nib. + + interstitialAd = new InterstitialAd ("Interstitial_Placement_Id") { Delegate = this }; + // For auto play video ads, it's recommended to load the ad + // at least 30 seconds before it is shown + interstitialAd.LoadAd (); + } + + [Export ("interstitialAdDidLoad:")] + public void InterstitialAdDidLoad (InterstitialAd interstitialAd) + { + Console.WriteLine ("Ad is loaded and ready to be displayed"); + + // You can now display the full screen ad using this code: + interstitialAd.ShowAd (this); + } + ``` + +3. Replace `Interstitial_Placement_Id` with your own placement id string. If you don't have a placement id or don't know how to get one, refer to the [Getting Started Guide][5]. Choose your build target to be device and run the above code, you should see something like this: + + + +> ![information_icon] _When running ads in the simulator, change the setting to test mode to view test ads. Please go to [How to Use Test Mode][7] for more information._ + +## Step 2: Verify Impression and Click Logging + +Optionally, you can add the following functions to handle the cases when the ad is shown, clicked or closed by users: + +```csharp +[Export ("interstitialAdWillLogImpression:")] +public void InterstitialAdWillLogImpression (InterstitialAd interstitialAd) +{ + Console.WriteLine ("The user sees the add"); + // Use this function as indication for a user's impression on the ad. +} + +[Export ("interstitialAdDidClick:")] +public void InterstitialAdDidClick (InterstitialAd interstitialAd) +{ + Console.WriteLine ("The user clicked on the ad and will be taken to its destination"); + // Use this function as indication for a user's click on the ad. +} + +[Export ("interstitialAdWillClose:")] +public void InterstitialAdWillClose (InterstitialAd interstitialAd) +{ + Console.WriteLine ("The user clicked on the close button, the ad is just about to close"); + // Consider to add code here to resume your app's flow +} + +[Export ("interstitialAdDidClose:")] +public void InterstitialAdDidClose (InterstitialAd interstitialAd) +{ + Console.WriteLine ("Interstitial had been closed"); + // Consider to add code here to resume your app's flow +} +``` + +## Step 3: Debugging When Ad Is Not Shown + +Add and implement the following function in your `ViewController` to handle ad loading failures and completions: + +```csharp +[Export ("interstitialAd:didFailWithError:")] +public void IntersitialDidFail (InterstitialAd interstitialAd, NSError error) +{ + Console.WriteLine ("Ad failed to load"); +} +``` + +> ![information_icon] When there is no ad to show, the `IntersitialDidFail` method will be called with `error.Code` set to `1001`. If you use your own custom reporting or mediation layer you might want to check the code value and detect this case. You can fallback to another ad network in this case, but do not re-request an ad immediately after. + +--- + +# Adding Ad Banners to your iOS app + +The Audience Network allows you to monetize your iOS apps with Facebook ads. This guide explains how to create an iOS app that shows banner ads. + +Let's implement the following banner ad placement. + + + +## Step 1: Load and Show Banner Ad View + +> ![information_icon] _When designing native ads and banner ads, ensure you have followed [iOS layout guideline][3] for optimal user experience._ + +1. In your `ViewController` import the `Facebook.AudienceNetwork` namespace and declare that `ViewController` implements the `IAdViewDelegate` interface: + + ```csharp + using Facebook.AudienceNetwork; + + namespace YourApp + { + public partial class ViewController : UIViewController, IAdViewDelegate + { + + } + } + ``` + +2. Next, implement `ViewDidLoad` and add the code below to create a new instance of `AdView` and add it to the view. `AdView` is a subclass of `UIView`. You can add it to your view hierarchy just like any other view: + + ```csharp + public override void ViewDidLoad () + { + base.ViewDidLoad (); + // Perform any additional setup after loading the view, typically from a nib. + + var adView = new AdView ("Banner_Placement_Id", AdSizes.BannerHeight50, this) { Delegate = this }; + adView.Frame = new CGRect (0, 20, adView.Bounds.Width, adView.Bounds.Height); + adView.LoadAd (); + View.AddSubview (adView); + } + ``` + + Audience Network supports three ad sizes to be used in your `AdView`. The Banner unit's width is flexible with a minimum of 320px, and only the height is defined. + + | Ad Format | AdSize Reference | Size | Recommendation | + |------------------|--------------------------------|---------|-------------------------------------------------------------------------| + | Standard Banner | **AdSizes.BannerHeight50** | 320x50 | This banner is best suited to phones | + | Large Banner | **AdSizes.BannerHeight90** | 320x90 | This banner is best suited to tablets and larger devices | + | Medium Rectangle | **AdSizes.RectangleHeight250** | 300x250 | This format is best suited for scrollable feeds or end-of-level screens | + +3. Replace `Banner_Placement_Id` with your own placement id string. If you don't have a placement id or don't know how to get one, refer to the [Getting Started Guide][5]. Choose your build target to be device and run the above code, you should see something like this: + + + + > ![information_icon] _When running ads in the simulator, change the setting to test mode to view test ads. Please go to [How to Use Test Mode][7] for more information._ + +## Step 2: Verify Impression and Click Logging + +Optionally, you can add the following functions to handle the cases where the banner ad is closed or when the user clicks on it: + +```csharp +[Export ("adViewDidClick:")] +public void AdViewDidClick (AdView adView) +{ + Console.WriteLine ("Banner ad was clicked."); +} + +[Export ("adViewDidFinishHandlingClick:")] +public void AdViewDidFinishHandlingClick (AdView adView) +{ + Console.WriteLine ("Banner ad did finish click handling."); +} + +[Export ("adViewWillLogImpression:")] +public void AdViewWillLogImpression (AdView adView) +{ + Console.WriteLine ("Banner ad impression is being captured."); +} +``` + +## Step 3: How to Debug When Ad Not Shown + +Add and implement the following two functions in your View Controller implementation file to handle ad loading failures and completions: + +```csharp +[Export ("adViewDidLoad:")] +public void AdViewDidLoad (AdView adView) +{ + Console.WriteLine ("Ad was loaded and ready to be displayed"); +} + +[Export ("adView:didFailWithError:")] +public void AdViewDidFail (AdView adView, NSError error) +{ + Console.WriteLine ("Ad failed to load"); +} +``` + +> ![information_icon] _When there is no ad to show, the `AdViewDidFail` method will be called with `error.Code` set to `1001`. If you use your own custom reporting or mediation layer, you may want to check the code value and detect this case. You can fallback to another ad network in this case, but do not re-request an ad immediately after._ + +--- + +# Adding In-stream Video Ads to your iOS app + +Video publishers can now use Audience Network's In-stream solution to deliver video ads to their global audience across mobile and desktop environments in pre-roll and mid-roll settings. Follow this guide to display this type of ad unit for iOS-based video content. + +## Requirements + +Please refer to the "In-Stream Video Requirements" section of the [Design Guidelines for Audience Network Ads][9]. + +## Implementation + +This guide will walk you through implementing in-stream video ads on iOS following these steps: + +## Step 1: Apply for Audience Network In-stream Video + +Go to your app dashboard and from the Audience Network menu on the left side of the screen, select Apps and Websites. Then, go to the "Apply for in-stream video ads" section. Please review the Requirements and, if applicable, click on the Apply button and follow the on screen instructions. + +## Step 2: Create Placements + +Audience Network offers 4 types of ad units: banner, interstitial (app only), native ads, and In-stream Video. You will see In-stream Video as a Display Format type after you have been approved for In-stream Video. Each ad unit in your app or website is identified using a unique placement ID. Follow this [step][10] to learn how to create this identifier. + +## Step 3: Load and Show In-stream Video Ad + +Now, in your `ViewController` import the `Facebook.AudienceNetwork` namespace, declare that you implement the `IInstreamAdViewDelegate` protocol and add an instance variable for the interstitial ad unit: + +```csharp +using Facebook.AudienceNetwork; + +namespace YourApp +{ + public partial class ViewController : UIViewController, IInstreamAdViewDelegate + { + InstreamAdView adView; + } +} +``` + +Initialize and load an in-stream ad view when it's time to show an ad. This can also be done ahead of time, to pre-cache an ad. In place of `Instream_Placement_Id`, use the id of the in-stream video placement you created earlier. + +```csharp +void LoadInstreamAd () +{ + adView = new InstreamAdView ("Instream_Placement_Id") { Delegate = this }; + adView.LoadAd (); +} +``` + +Now that you have added the code to load the ad add the necessary delegate implementation to display the ad, and handle failures: + +> ![information_icon] _When there is no ad to show, the adView:didFailWithError: will be called with error.code set to 1001. You should detect this and return to the content._ + +```csharp +public void AdViewDidLoad (InstreamAdView adView) +{ + Console.WriteLine ("Ad is loaded and ready to be displayed"); + + // The ad can now be added to the layout and shown + this.adView.Frame = View.Bounds; + this.adView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; + View.AddSubview (adView); + this.adView.ShowAd (this); +} + +public void AdViewDidEnd (InstreamAdView adView) +{ + Console.WriteLine ("Ad ended"); + this.adView.RemoveFromSuperview (); + this.adView.Dispose (); + this.adView = null; + + // The app should now proceed to content +} + +public void AdViewDidFail (InstreamAdView adView, NSError error) +{ + Console.WriteLine ($"Ad failed: {error.LocalizedDescription}"); + this.adView.RemoveFromSuperview (); + this.adView.Dispose (); + this.adView = null; + + // The app should now proceed to content +} +``` + +Once you run the above code and present the in-stream ad, you should see something like this: + + + +## Step 4: Handle Impressions and Clicks + +Optionally, you can add the following functions to handle ad clicks and impressions: + +```csharp +[Export ("adViewDidClick:")] +public void AdViewDidClick (InstreamAdView adView) +{ + Console.WriteLine ("Ad clicked"); + // Called when the user clicks on the "Learn More" button. +} + +[Export ("adViewWillLogImpression:")] +public void AdViewWillLogImpression (InstreamAdView adView) +{ + Console.WriteLine ("Ad impression"); + // Called when the ad logs an impression +} +``` + +> ![information_icon] _When running ads in the simulator, change the setting to test mode to view test ads. Please go to [How to Use Test Mode][7] for more information._ + +--- + +# Rewarded Video for iOS + +Rewarded video ads are a full screen experience where users opt-in to view a video ad in exchange for something of value, such as virtual currency, in-app items, exclusive content, and more. The ad experience is 15-30 second non-skippable and contains an end card with a call to action. Upon completion of the full video, you will receive a callback to grant the suggested reward to the user. + +> ![information_icon] _Please note, Rewarded Video is only supported for iOS 8 and above._ + +## Implementation + +Now, in your `ViewController` import the `Facebook.AudienceNetwork` namespace, declare that you implement the `IRewardedVideoAdDelegate` interface and add an instance variable for the rewarded video ad unit: + +```csharp +using Facebook.AudienceNetwork; + +namespace YourApp +{ + public partial class ViewController : UIViewController, IRewardedVideoAdDelegate + { + RewardedVideoAd rewardedVideoAd; + } +} +``` + +Add a function in your `ViewController` that initializes the rewarded video object and caches the video creative ahead of the time you want to show it. + +```csharp +public override void ViewDidLoad () +{ + base.ViewDidLoad (); + // Perform any additional setup after loading the view, typically from a nib. + + LoadRewardedVideoAd (); +} + +void LoadRewardedVideoAd () +{ + rewardedVideoAd = new RewardedVideoAd ("Rewarded_Video_Placement_Id") { Delegate = this }; + rewardedVideoAd.LoadAd (); +} +``` + +Replace `Rewarded_Video_Placement_Id` with your own placement id string. If you don't have a placement id or don't know how to get one, you can refer to the [Getting Started Guide][5]. + +Now that you have added the code to load the ad, you can add functions which will handle various events. For example: + +* `RewardedVideoAdDidLoad` ensures your app is aware when the ad is cached and ready to be displayed +* `RewardedVideoAdComplete` lets you know when to deliver your reward to the user after a completed video view + +```csharp +[Export ("rewardedVideoAdDidLoad:")] +public void RewardedVideoAdDidLoad (RewardedVideoAd rewardedVideoAd) +{ + Console.WriteLine ("Video ad is loaded and ready to be displayed"); +} + +[Export ("rewardedVideoAd:didFailWithError:")] +public void RewardedVideoAdDidFail (RewardedVideoAd rewardedVideoAd, NSError error) +{ + Console.WriteLine ($"Rewarded video ad failed to load: {error.LocalizedDescription}"); +} + +[Export ("rewardedVideoAdDidClick:")] +public void RewardedVideoAdDidClick (RewardedVideoAd rewardedVideoAd) +{ + Console.WriteLine ("Video ad clicked"); +} + +[Export ("rewardedVideoAdComplete:")] +public void RewardedVideoAdComplete (RewardedVideoAd rewardedVideoAd) +{ + Console.WriteLine ("Rewarded Video ad complete - this is called after a full video view, before the ad end card is shown.You can use this event to initialize your reward"); +} + +[Export ("rewardedVideoAdDidClose:")] +public void RewardedVideoAdDidClose (RewardedVideoAd rewardedVideoAd) +{ + Console.WriteLine ("Rewarded Video ad closed - this can be triggered by closing the application, or closing the video end card"); +} +``` + +Finally, when you are ready to show the rewarded video ad you can call the following code within your own reward function. + +```csharp +void ShowRewardedVideoAd () +{ + rewardedVideoAd.ShowAd (this); +} +``` + +The method to show a rewarded video ad includes an animated BOOLEAN flag which allows you to animate the presentation. By default it is set to `true`, but this can be overridden with the following. + +```csharp +rewardedVideoAd.ShowAd (this, false); +``` + +> ![information_icon] _When running ads in the simulator, change the setting to test mode to view test ads. Please go to [How to Use Test Mode][7] for more information._ + +Optionally, you can add the following additional functions to handle the cases where the rewarded video ad will close or when the rewarded video impression is being captured: + +```csharp +[Export ("rewardedVideoAdWillClose:")] +public void RewardedVideoAdWillClose (RewardedVideoAd rewardedVideoAd) +{ + Console.WriteLine ("The user clicked on the close button, the ad is just about to close"); +} + +[Export ("rewardedVideoAdWillLogImpression:")] +public void RewardedVideoAdWillLogImpression (RewardedVideoAd rewardedVideoAd) +{ + Console.WriteLine ("Rewarded Video impression is being captured"); +} +``` + +## Server Side Reward Validation + +### Overview + +If you manage your user rewards server-side, then Facebook offers a solution for carrying this out securely by using a validation technique. Our server will communicate with a specified endpoint to validate each ad impression and validate whether a reward should be granted. + +1. Audience Network SDK requests a rewarded video ad with the following parameters: + 1. Audience Network Placement ID + 2. Unique User ID - an attribute you use to identify a unique user. For example, a numeric identifier + 3. Reward Value - the value of the reward you would like to grant the user. For example, 100Coins specified end point, together with the [App Secret][12]. + +2. Upon receipt, the server validates the request and responds as follows: + 1. **200 response:** request is valid and the reward should be delivered + 2. **Non 200 response:** request is not valid, and the reward should not be delivered. + +3. Once the video is complete, the end card is presented and one of the following events will fire. + 1. onRewardServerSuccess - triggered only if a 200 response was received during step 3. + 2. onRewardServerFailed - triggered if a non 200 response was received during step 3. + +> ![information_icon] _An example of the URL which will hit your publisher end point, from Facebook's server._ +> +> https://www.your_end_point.com/?**token**=APP_SECRET&**puid**=USER_ID&**pc**=REWARD_ID&**ptid**=UNIQUE_TRANSACTION_ID + +> ![information_icon] Please provide your publisher end point to your Facebook representative in order to enable this feature. + + + +### SDK Implementation + +It is possible to set the Reward Data (`USER_ID` and `CURRENCY`) on initialization. This is demonstrated in the code snippet below: + +```csharp +void LoadRewardedVideoAd () +{ + //Set the rewarded ad data + rewardedVideoAd = new RewardedVideoAd ("Rewarded_Video_Placement_Id", "USER_ID", "CURRENCY") { Delegate = this }; + rewardedVideoAd.LoadAd (); +} +``` + +In addition to the functions noted above in the `IRewardedVideoAdDelegate`, the following events should be used to hande the granting of rewards in your app. The following can be used alongise the events monetioned above: + +```csharp +[Export ("rewardedVideoAdServerRewardDidSucceed:")] +void RewardedVideoAdServerRewardDidSuccess (RewardedVideoAd rewardedVideoAd) +{ + Console.WriteLine ("Rewarded video ad validated by server"); +} + +[Export ("rewardedVideoAdServerRewardDidFail:")] +void RewardedVideoAdServerRewardDidFail (RewardedVideoAd rewardedVideoAd) +{ + Console.WriteLine ("Rewarded video ad not validated, or no response from server"); +} +``` + +> ![information_icon] _Please note: the server validation callbacks will only occur after the end card has been dismissed by a user. You should not deallocate the rewarded video object until after one of these callbacks._ + +--- + +[1]: https://developers.facebook.com/docs/audience-network/getting-started +[2]: https://developers.facebook.com/docs/audience-network/guidelines/native-ads#native +[3]: https://developers.facebook.com/docs/audience-network/ios-layout-guideline +[4]: https://developers.facebook.com/docs/audience-network/ios-native#ui +[5]: https://developers.facebook.com/docs/audience-network/getting-started#placement_ids +[6]: https://developers.facebook.com/docs/audience-network/policy +[7]: https://developers.facebook.com/docs/audience-network/testing#testing-testAd +[8]: https://developers.facebook.com/docs/audience-network/ios/nativescroll +[9]: https://developers.facebook.com/docs/audience-network/guidelines/native-ads/ +[10]: https://developers.facebook.com/docs/audience-network/ios/instream-video#step2 +[11]: https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html +[12]: https://developers.facebook.com/docs/facebook-login/security#appsecret +[information_icon]: https://cdn1.iconfinder.com/data/icons/hawcons/32/699299-icon-29-information-20.png diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/AdPlacementIds.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/AdPlacementIds.cs new file mode 100644 index 00000000..f2658cd4 --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/AdPlacementIds.cs @@ -0,0 +1,19 @@ +using System; + +using Facebook.AudienceNetwork; + +namespace FBAudienceNetworkSample { + public static class AdPlacementIds { + public const string Banner = "Banner_Placement_Id"; + public const string Interstitial = "Interstitial_Placement_Id"; + public const string Native = "Interstitial_Placement_Id"; + public const string RewardedVideo = "Rewarded_Video_Placement_Id"; + + public static void AddTestDevices () + { + AdSettings.LogLevel = AdLogLevel.Log; + AdSettings.ClearTestDevices (); + AdSettings.AddTestDevice ("Hash_Device"); + } + } +} diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.cs new file mode 100644 index 00000000..577cabaf --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.cs @@ -0,0 +1,334 @@ +using System; + +using UIKit; +using Foundation; + +using Facebook.AudienceNetwork; +using CoreGraphics; +using System.Collections.Generic; +using ObjCRuntime; + +namespace FBAudienceNetworkSample +{ + public partial class AdsViewController : UIViewController, IUITableViewDataSource, IUITableViewDelegate, + INativeAdDelegate, IAdViewDelegate, IInterstitialAdDelegate, IRewardedVideoAdDelegate + { + #region Class Variables + + static object padlock = new object (); + + List customNativeAds; + NativeAd nativeAd; + NativeAd nativeAdTemplate; + AdView bannerAdView; + InterstitialAd interstitialAd; + RewardedVideoAd rewardedVideoAd; + + #endregion + + #region Constructors + + public AdsViewController (IntPtr handle) : base (handle) + { + } + + #endregion + + #region Controller Life Cycle + + public override void ViewDidLoad () + { + base.ViewDidLoad (); + // Perform any additional setup after loading the view, typically from a nib. + + customNativeAds = new List (); + } + + #endregion + + #region User Interactions + + partial void BtnShow_Click (NSObject sender) + { + var actionSheet = UIAlertController.Create (null, null, UIAlertControllerStyle.ActionSheet); + actionSheet.AddAction (UIAlertAction.Create ("Cancel", UIAlertActionStyle.Cancel, null)); + actionSheet.AddAction (UIAlertAction.Create ("Add Native ad to Table", UIAlertActionStyle.Default, AddNativeAd)); + actionSheet.AddAction (UIAlertAction.Create ("Add Native ad template to Table", UIAlertActionStyle.Default, AddNativeAdTemplate)); + actionSheet.AddAction (UIAlertAction.Create ("Show Banner ad", UIAlertActionStyle.Default, ShowBannerAd)); + actionSheet.AddAction (UIAlertAction.Create ("Show Interstitial ad", UIAlertActionStyle.Default, ShowInterstitialAd)); + actionSheet.AddAction (UIAlertAction.Create ("Show Rewarded Video Ad", UIAlertActionStyle.Default, ShowRewardedVideoAd)); + PresentViewController (actionSheet, true, null); + } + + void AddNativeAd (UIAlertAction obj) + { + nativeAd = new NativeAd (AdPlacementIds.Native) { Delegate = this }; + nativeAd.LoadAd (); + } + + void AddNativeAdTemplate (UIAlertAction obj) + { + nativeAdTemplate = new NativeAd (AdPlacementIds.Native) { Delegate = this }; + nativeAdTemplate.LoadAd (); + } + + void ShowBannerAd (UIAlertAction obj) + { + bannerAdView?.RemoveFromSuperview (); + bannerAdView?.Dispose (); + bannerAdView = null; + + bannerAdView = new AdView (AdPlacementIds.Banner, AdSizes.BannerHeight50, this) { Delegate = this }; + bannerAdView.Frame = new CGRect (0, 0, bannerAdView.Bounds.Width, bannerAdView.Bounds.Height); + bannerAdView.LoadAd (); + BannerView.AddSubview (bannerAdView); + } + + void ShowInterstitialAd (UIAlertAction obj) + { + interstitialAd?.Dispose (); + interstitialAd = null; + + interstitialAd = new InterstitialAd (AdPlacementIds.Interstitial) { Delegate = this }; + interstitialAd.LoadAd (); + } + + void ShowRewardedVideoAd (UIAlertAction obj) + { + rewardedVideoAd?.Dispose (); + rewardedVideoAd = null; + + rewardedVideoAd = new RewardedVideoAd (AdPlacementIds.RewardedVideo) { Delegate = this }; + rewardedVideoAd.LoadAd (); + } + + #endregion + + #region UITableView Data Source + + [Export ("numberOfSectionsInTableView:")] + public nint NumberOfSections (UITableView tableView) => 1; + public nint RowsInSection (UITableView tableView, nint section) => customNativeAds.Count; + + public UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) + { + var customNativeAd = customNativeAds [indexPath.Row]; + + if (customNativeAd.IsTemplate) { + var cell = tableView.DequeueReusableCell (NativeAdTemplateTableViewCell.Key, indexPath) as NativeAdTemplateTableViewCell; + var nativeAdView = NativeAdView.From (customNativeAd.NativeAd, NativeAdViewType.GenericHeight300); + nativeAdView.Frame = new CGRect (0, 0, cell.AdView.Frame.Width, 300); + cell.AdView.AddSubview (nativeAdView); + + return cell; + } else { + var cell = tableView.DequeueReusableCell (NativeAdTableViewCell.Key, indexPath) as NativeAdTableViewCell; + + customNativeAd.NativeAd.UnregisterView (); + + // Wire up UIView with the native ad; only call to action button and media view will be clickable. + customNativeAd.NativeAd.RegisterView (cell.AdView, cell.CoverMediaViewAd, cell.IconViewAd, this, new UIView [] { cell.CoverMediaViewAd, cell.AdCallToActionButton }); + + // Render native ads onto UIView + cell.AdTitle = customNativeAd.NativeAd.AdvertiserName; + cell.AdBody = customNativeAd.NativeAd.BodyText; + cell.AdSocialContext = customNativeAd.NativeAd.SocialContext; + cell.Sponsored = "Sponsored"; + cell.AdCallToActionButton.SetTitle (customNativeAd.NativeAd.CallToAction, UIControlState.Normal); + cell.ChoiceViewAd.NativeAd = customNativeAd.NativeAd; + cell.ChoiceViewAd.Corner = UIRectCorner.TopRight; + + return cell; + } + } + + #endregion + + #region UITableView Delegate + + [Export ("tableView:canEditRowAtIndexPath:")] + public bool CanEditRow (UITableView tableView, NSIndexPath indexPath) => true; + + [Export ("tableView:commitEditingStyle:forRowAtIndexPath:")] + public void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath) + { + switch (editingStyle) { + case UITableViewCellEditingStyle.Delete: + var customNativeAd = customNativeAds [indexPath.Row]; + customNativeAd.AdImage = null; + customNativeAd.NativeAd.Dispose (); + customNativeAd.NativeAd = null; + customNativeAds.RemoveAt (indexPath.Row); + tableView.DeleteRows (new [] { indexPath }, UITableViewRowAnimation.Automatic); + + break; + } + } + + #endregion + + #region Internal Functionality + + void InsertRow () + { + var newIndexPath = NSIndexPath.FromRowSection (customNativeAds.Count - 1, 0); + AdsTableView.InsertRows (new [] { newIndexPath }, UITableViewRowAnimation.Automatic); + AdsTableView.ScrollToRow (newIndexPath, UITableViewScrollPosition.Bottom, true); + } + + #endregion + + #region NativeAd Delegate + + [Export ("nativeAdDidLoad:")] + public void NativeAdDidLoad (NativeAd nativeAd) + { + CustomNativeAd customNativeAd; + lock (padlock) { + customNativeAd = new CustomNativeAd (nativeAd, nativeAdTemplate == nativeAd); + customNativeAds.Add (customNativeAd); + } + + InsertRow (); + + //if (!customNativeAd.IsTemplate) { + + // return; + //} + + //// Native Ad Template Logic + //var nativeAdView = NativeAdView.From (nativeAd, NativeAdViewType.GenericHeight300); + //customNativeAds.Add (nativeAdView); + + //// Register the native ad view and its view controller with the native ad instance + //nativeAd.RegisterView (nativeAdView, this); + + //var newIndexPath = NSIndexPath.FromRowSection (customNativeAds.Count - 1, 0); + //AdsTableView.InsertRows (new [] { newIndexPath }, UITableViewRowAnimation.Automatic); + //AdsTableView.ScrollToRow (newIndexPath, UITableViewScrollPosition.Bottom, true); + } + + [Export ("nativeAd:didFailWithError:")] + public void NativeAdDidFail (NativeAd nativeAd, NSError error) + { + Console.WriteLine ($"{nameof (NativeAdDidFail)} - Native ad failed to load with error: {error.LocalizedDescription}"); + AppDelegate.ShowMessage ("Native Ad Error", error.LocalizedDescription, NavigationController); + } + + [Export ("nativeAdDidClick:")] + public void NativeAdDidClick (NativeAd nativeAd) => + Console.WriteLine ($"{nameof (NativeAdDidClick)} - Native ad was clicked."); + + [Export ("nativeAdDidFinishHandlingClick:")] + public void NativeAdDidFinishHandlingClick (NativeAd nativeAd) => + Console.WriteLine ($"{nameof (NativeAdDidFinishHandlingClick)} - Native ad did finish click handling."); + + [Export ("nativeAdWillLogImpression:")] + public void NativeAdWillLogImpression (NativeAd nativeAd) => + Console.WriteLine ($"{nameof (NativeAdWillLogImpression)} - Native ad impression is being captured."); + + #endregion + + #region AdView Delegate + + [Export ("adViewDidLoad:")] + public void AdViewDidLoad (AdView adView) => + Console.WriteLine ($"{nameof (AdViewDidLoad)} - Ad was loaded and ready to be displayed"); + + [Export ("adView:didFailWithError:")] + public void AdViewDidFail (AdView adView, NSError error) + { + Console.WriteLine ($"{nameof (AdViewDidFail)} - Ad failed to load: {error.LocalizedDescription}"); + AppDelegate.ShowMessage ("Banner Ad Error", error.LocalizedDescription, NavigationController); + } + + [Export ("adViewDidClick:")] + public void AdViewDidClick (AdView adView) => + Console.WriteLine ($"{nameof (AdViewDidClick)} - Banner ad was clicked."); + + [Export ("adViewDidFinishHandlingClick:")] + public void AdViewDidFinishHandlingClick (AdView adView) => + Console.WriteLine ($"{nameof (AdViewDidFinishHandlingClick)} - Banner ad did finish click handling."); + + [Export ("adViewWillLogImpression:")] + public void AdViewWillLogImpression (AdView adView) => + Console.WriteLine ($"{nameof (AdViewWillLogImpression)} - Banner ad impression is being captured."); + + #endregion + + #region InterstitialAd Delegate + + [Export ("interstitialAdDidLoad:")] + public void InterstitialAdDidLoad (InterstitialAd interstitialAd) + { + Console.WriteLine ($"{nameof (InterstitialAdDidLoad)} - Ad is loaded and ready to be displayed"); + + // You can now display the full screen ad using this code: + interstitialAd.ShowAd (this); + } + + [Export ("interstitialAd:didFailWithError:")] + public void IntersitialDidFail (InterstitialAd interstitialAd, NSError error) + { + Console.WriteLine ($"{nameof (IntersitialDidFail)} - Ad failed to load: {error.LocalizedDescription}"); + AppDelegate.ShowMessage ("Interstitial Ad Error", error.LocalizedDescription, NavigationController); + } + + [Export ("interstitialAdWillLogImpression:")] + public void InterstitialAdWillLogImpression (InterstitialAd interstitialAd) => + Console.WriteLine ($"{nameof (InterstitialAdWillLogImpression)} - The user sees the add"); + + [Export ("interstitialAdDidClick:")] + public void InterstitialAdDidClick (InterstitialAd interstitialAd) => + Console.WriteLine ($"{nameof (InterstitialAdDidClick)} - The user clicked on the ad and will be taken to its destination"); + + [Export ("interstitialAdWillClose:")] + public void InterstitialAdWillClose (InterstitialAd interstitialAd) => + Console.WriteLine ($"{nameof (InterstitialAdWillClose)} - The user clicked on the close button, the ad is just about to close"); + + [Export ("interstitialAdDidClose:")] + public void InterstitialAdDidClose (InterstitialAd interstitialAd) => + Console.WriteLine ($"{nameof (InterstitialAdDidClose)} - Interstitial had been closed"); + + #endregion + + #region RewardedVideoAd Delegate + + [Export ("rewardedVideoAdDidLoad:")] + public void RewardedVideoAdDidLoad (RewardedVideoAd rewardedVideoAd) + { + Console.WriteLine ($"{nameof (RewardedVideoAdDidLoad)} - Video ad is loaded and ready to be displayed"); + + rewardedVideoAd.ShowAd (this); + } + + [Export ("rewardedVideoAd:didFailWithError:")] + public void RewardedVideoAdDidFail (RewardedVideoAd rewardedVideoAd, NSError error) + { + Console.WriteLine ($"{nameof (RewardedVideoAdDidFail)} - Rewarded video ad failed to load: {error.LocalizedDescription}"); + AppDelegate.ShowMessage ("Banner Ad Error", error.LocalizedDescription, NavigationController); + } + + [Export ("rewardedVideoAdDidClick:")] + public void RewardedVideoAdDidClick (RewardedVideoAd rewardedVideoAd) => + Console.WriteLine ($"{nameof (RewardedVideoAdDidClick)} - Video ad clicked"); + + [Export ("rewardedVideoAdComplete:")] + public void RewardedVideoAdComplete (RewardedVideoAd rewardedVideoAd) => + Console.WriteLine ($"{nameof (RewardedVideoAdComplete)} - Rewarded Video ad complete - this is called after a full video view, before the ad end card is shown.You can use this event to initialize your reward"); + + [Export ("rewardedVideoAdDidClose:")] + public void RewardedVideoAdDidClose (RewardedVideoAd rewardedVideoAd) => + Console.WriteLine ($"{nameof (RewardedVideoAdDidClose)} - Rewarded Video ad closed - this can be triggered by closing the application, or closing the video end card"); + + [Export ("rewardedVideoAdWillClose:")] + public void RewardedVideoAdWillClose (RewardedVideoAd rewardedVideoAd) => + Console.WriteLine ($"{nameof (RewardedVideoAdWillClose)} - The user clicked on the close button, the ad is just about to close"); + + [Export ("rewardedVideoAdWillLogImpression:")] + public void RewardedVideoAdWillLogImpression (RewardedVideoAd rewardedVideoAd) => + Console.WriteLine ($"{nameof (RewardedVideoAdWillLogImpression)} - Rewarded Video impression is being captured"); + + #endregion + } +} diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.designer.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.designer.cs new file mode 100644 index 00000000..818a3e52 --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/AdsViewController.designer.cs @@ -0,0 +1,40 @@ +// WARNING +// +// This file has been generated automatically by Visual Studio from the outlets and +// actions declared in your storyboard file. +// Manual changes to this file will not be maintained. +// +using Foundation; +using System; +using System.CodeDom.Compiler; + +namespace FBAudienceNetworkSample +{ + [Register ("AdsViewController")] + partial class AdsViewController + { + [Outlet] + UIKit.UITableView AdsTableView { get; set; } + + + [Outlet] + UIKit.UIView BannerView { get; set; } + + + [Action ("BtnShow_Click:")] + partial void BtnShow_Click (Foundation.NSObject sender); + + void ReleaseDesignerOutlets () + { + if (AdsTableView != null) { + AdsTableView.Dispose (); + AdsTableView = null; + } + + if (BannerView != null) { + BannerView.Dispose (); + BannerView = null; + } + } + } +} \ No newline at end of file diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/AppDelegate.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/AppDelegate.cs new file mode 100644 index 00000000..c89e6d6a --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/AppDelegate.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +using Foundation; +using UIKit; + +using Facebook.AudienceNetwork; + +namespace FBAudienceNetworkSample +{ + // The UIApplicationDelegate for the application. This class is responsible for launching the + // User Interface of the application, as well as listening (and optionally responding) to + // application events from iOS. + [Register ("AppDelegate")] + public partial class AppDelegate : UIApplicationDelegate + { + // class-level declarations + + public override UIWindow Window { + get; + set; + } + + public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) + { + UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent; + + AdPlacementIds.AddTestDevices (); + + return true; + } + + public static void ShowMessage (string title, string message, UIViewController fromViewController) + { + var alertController = UIAlertController.Create (title, message, UIAlertControllerStyle.Alert); + alertController.AddAction (UIAlertAction.Create ("Ok", UIAlertActionStyle.Cancel, null)); + fromViewController.PresentViewController (alertController, true, null); + } + } +} + diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/Assets.xcassets/LaunchImage.launchimage/Contents.json b/Facebook.iOS/samples/FBAudienceNetworkSample/Assets.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 00000000..ab0ab490 --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/Assets.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,17 @@ +{ + "images": [ + { + "orientation": "portrait", + "idiom": "iphone", + "extent": "full-screen", + "filename": "Default-568h@2x.png", + "size": "320x568", + "subtype": "retina4", + "scale": "2x" + } + ], + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/CustomNativeAd.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/CustomNativeAd.cs new file mode 100644 index 00000000..f8c4e2ff --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/CustomNativeAd.cs @@ -0,0 +1,19 @@ +using System; + +using UIKit; + +using Facebook.AudienceNetwork; + +namespace FBAudienceNetworkSample { + public class CustomNativeAd { + public NativeAd NativeAd { get; set; } + public bool IsTemplate { get; set; } + public UIImage AdImage { get; set; } + + public CustomNativeAd (NativeAd nativeAd, bool isTemplate) + { + NativeAd = nativeAd; + IsTemplate = isTemplate; + } + } +} diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/Entitlements.plist b/Facebook.iOS/samples/FBAudienceNetworkSample/Entitlements.plist new file mode 100644 index 00000000..9ae59937 --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/Entitlements.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/FBAudienceNetworkSample.csproj b/Facebook.iOS/samples/FBAudienceNetworkSample/FBAudienceNetworkSample.csproj new file mode 100644 index 00000000..bb75a534 --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/FBAudienceNetworkSample.csproj @@ -0,0 +1,144 @@ + + + + Debug + iPhoneSimulator + {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E} + Exe + FBAudienceNetworkSample + Resources + FBAudienceNetworkSample + obj\$(Platform)\$(Configuration) + + + true + full + false + bin\iPhoneSimulator\Debug + DEBUG; + prompt + 4 + false + None + Entitlements.plist + true + + + i386, x86_64 + true + + + full + true + bin\iPhoneSimulator\Release + prompt + 4 + None + false + Entitlements.plist + + + i386, x86_64 + + + true + full + false + bin\iPhone\Debug + DEBUG; + prompt + 4 + false + Entitlements.plist + true + iPhone Developer + + + + + ARMv7, ARM64 + true + + + full + true + bin\iPhone\Release + prompt + 4 + Entitlements.plist + false + iPhone Developer + + + ARMv7, ARM64 + + SdkOnly + + + full + true + bin\iPhone\Ad-Hoc + prompt + 4 + false + Entitlements.plist + true + Automatic:AdHoc + iPhone Distribution + + + full + true + bin\iPhone\AppStore + prompt + 4 + iPhone Distribution + Entitlements.plist + false + Automatic:AppStore + + + + + + + + + + + + + + + + + AdsViewController.cs + + + + NativeAdTemplateTableViewCell.cs + + + + NativeAdTableViewCell.cs + + + + + + + + + + + + + + + + {54FF3FE1-B984-4642-8131-16A4E8335A0D} + AudienceNetwork + + + diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/Info.plist b/Facebook.iOS/samples/FBAudienceNetworkSample/Info.plist new file mode 100644 index 00000000..a750160b --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/Info.plist @@ -0,0 +1,67 @@ + + + + + CFBundleDisplayName + FBAudienceNetworkSample + CFBundleIdentifier + com.xamarin.FBAudienceNetworkSample + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + MinimumOSVersion + 9.0 + UIDeviceFamily + + 1 + + UIMainStoryboardFile + MainStoryboard + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + NSAppTransportSecurity + + NSExceptionDomains + + facebook.com + + NSIncludesSubdomains + + NSThirdPartyExceptionRequiresForwardSecrecy + + + fbcdn.net + + NSIncludesSubdomains + + NSThirdPartyExceptionRequiresForwardSecrecy + + + akamaihd.net + + NSIncludesSubdomains + + NSThirdPartyExceptionRequiresForwardSecrecy + + + + + CFBundleName + FBAudienceNetworkSample + UILaunchStoryboardName + LaunchScreen + XSLaunchImageAssets + Assets.xcassets/LaunchImage.launchimage + UIViewControllerBasedStatusBarAppearance + + + diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/LaunchScreen.storyboard b/Facebook.iOS/samples/FBAudienceNetworkSample/LaunchScreen.storyboard new file mode 100644 index 00000000..7981a14b --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/Main.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/Main.cs new file mode 100644 index 00000000..ecadc558 --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/Main.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +#if __UNIFIED__ +using Foundation; +using UIKit; + +#else +using MonoTouch.Foundation; +using MonoTouch.UIKit; +#endif + +namespace FBAudienceNetworkSample +{ + public class Application + { + // This is the main entry point of the application. + static void Main (string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main (args, null, "AppDelegate"); + } + } +} \ No newline at end of file diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/MainStoryboard.storyboard b/Facebook.iOS/samples/FBAudienceNetworkSample/MainStoryboard.storyboard new file mode 100644 index 00000000..c87f1ff2 --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/MainStoryboard.storyboard @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.cs new file mode 100644 index 00000000..bc17cc8a --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.cs @@ -0,0 +1,41 @@ +using System; + +using Foundation; +using UIKit; + +using Facebook.AudienceNetwork; + +namespace FBAudienceNetworkSample +{ + public partial class NativeAdTableViewCell : UITableViewCell + { + public static readonly NSString Key = new NSString (nameof (NativeAdTableViewCell)); + + public UIView AdView { get => View; } + public MediaView CoverMediaViewAd { get => AdCoverMediaView; } + public AdChoicesView ChoiceViewAd { get => AdChoiceView; } + public UIButton AdCallToActionButton { get => BtnAdCallToAction; } + public AdIconView IconViewAd { get => AdIconView; } + public string AdTitle { + get => LblAdTitle.Text; + set => LblAdTitle.Text = value; + } + public string Sponsored { + get => LblSponsored.Text; + set => LblSponsored.Text = value; + } + public string AdSocialContext { + get => LblAdSocialContext.Text; + set => LblAdSocialContext.Text = value; + } + public string AdBody { + get => LblAdBody.Text; + set => LblAdBody.Text = value; + } + + protected NativeAdTableViewCell (IntPtr handle) : base (handle) + { + // Note: this .ctor should not contain any initialization logic. + } + } +} diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.designer.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.designer.cs new file mode 100644 index 00000000..3c7c7687 --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTableViewCell.designer.cs @@ -0,0 +1,100 @@ +// WARNING +// +// This file has been generated automatically by Visual Studio to store outlets and +// actions made in the UI designer. If it is removed, they will be lost. +// Manual changes to this file may not be handled correctly. +// +using Foundation; +using System.CodeDom.Compiler; + +namespace FBAudienceNetworkSample +{ + [Register ("NativeAdTableViewCell")] + partial class NativeAdTableViewCell + { + [Outlet] + Facebook.AudienceNetwork.AdChoicesView AdChoiceView { get; set; } + + [Outlet] + Facebook.AudienceNetwork.MediaView AdCoverMediaView { get; set; } + + [Outlet] + Facebook.AudienceNetwork.AdIconView AdIconView { get; set; } + + [Outlet] + UIKit.UIButton BtnAdCallToAction { get; set; } + + [Outlet] + UIKit.UILabel LblAdBody { get; set; } + + [Outlet] + UIKit.UILabel LblAdSocialContext { get; set; } + + [Outlet] + UIKit.UILabel LblAdTitle { get; set; } + + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIKit.UILabel LblSocialContext { get; set; } + + [Outlet] + UIKit.UILabel LblSponsored { get; set; } + + [Outlet] + [GeneratedCode ("iOS Designer", "1.0")] + UIKit.UIView View { get; set; } + + void ReleaseDesignerOutlets () + { + if (AdChoiceView != null) { + AdChoiceView.Dispose (); + AdChoiceView = null; + } + + if (AdCoverMediaView != null) { + AdCoverMediaView.Dispose (); + AdCoverMediaView = null; + } + + if (BtnAdCallToAction != null) { + BtnAdCallToAction.Dispose (); + BtnAdCallToAction = null; + } + + if (AdIconView != null) { + AdIconView.Dispose (); + AdIconView = null; + } + + if (LblAdBody != null) { + LblAdBody.Dispose (); + LblAdBody = null; + } + + if (LblAdSocialContext != null) { + LblAdSocialContext.Dispose (); + LblAdSocialContext = null; + } + + if (LblAdTitle != null) { + LblAdTitle.Dispose (); + LblAdTitle = null; + } + + if (LblSponsored != null) { + LblSponsored.Dispose (); + LblSponsored = null; + } + + if (LblSocialContext != null) { + LblSocialContext.Dispose (); + LblSocialContext = null; + } + + if (View != null) { + View.Dispose (); + View = null; + } + } + } +} diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.cs new file mode 100644 index 00000000..4fb62db4 --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.cs @@ -0,0 +1,19 @@ +using System; + +using Foundation; +using UIKit; + +namespace FBAudienceNetworkSample +{ + public partial class NativeAdTemplateTableViewCell : UITableViewCell + { + public static readonly NSString Key = new NSString (nameof (NativeAdTemplateTableViewCell)); + + public UIView AdView { get => View; } + + protected NativeAdTemplateTableViewCell (IntPtr handle) : base (handle) + { + // Note: this .ctor should not contain any initialization logic. + } + } +} diff --git a/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.designer.cs b/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.designer.cs new file mode 100644 index 00000000..a24bb285 --- /dev/null +++ b/Facebook.iOS/samples/FBAudienceNetworkSample/NativeAdTemplateTableViewCell.designer.cs @@ -0,0 +1,27 @@ +// WARNING +// +// This file has been generated automatically by Visual Studio from the outlets and +// actions declared in your storyboard file. +// Manual changes to this file will not be maintained. +// +using Foundation; +using System; +using System.CodeDom.Compiler; + +namespace FBAudienceNetworkSample +{ + [Register ("NativeAdTemplateTableViewCell")] + partial class NativeAdTemplateTableViewCell + { + [Outlet] + UIKit.UIView View { get; set; } + + void ReleaseDesignerOutlets () + { + if (View != null) { + View.Dispose (); + View = null; + } + } + } +} \ No newline at end of file diff --git a/Facebook.iOS/samples/Samples.sln b/Facebook.iOS/samples/Samples.sln index 8dc641a8..f746a01b 100644 --- a/Facebook.iOS/samples/Samples.sln +++ b/Facebook.iOS/samples/Samples.sln @@ -5,6 +5,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{97B7 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "source", "source", "{22223EF5-BB05-497A-9729-4257528ABD91}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AudienceNetwork", "..\source\AudienceNetwork\AudienceNetwork.csproj", "{54FF3FE1-B984-4642-8131-16A4E8335A0D}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreKit", "..\source\CoreKit\CoreKit.csproj", "{5B88D7C7-6E76-4D0D-8DBE-B3F0A5D6B8A0}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FacebookSdks", "..\source\FacebookSdks\FacebookSdks.csproj", "{B8A416D8-45F1-4CD5-9469-5436304E3CBA}" @@ -15,6 +17,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShareKit", "..\source\Share EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FacebookiOSSample", "FacebookiOSSample\FacebookiOSSample.csproj", "{FB530EE3-BAED-46B1-9703-D33D85E58A92}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FBAudienceNetworkSample", "FBAudienceNetworkSample\FBAudienceNetworkSample.csproj", "{EDDC7A9A-9BB2-4C37-B85B-3D151079029E}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloFacebook", "HelloFacebook\HelloFacebook.csproj", "{F622F5FE-A71F-4A3E-B45C-2468DBAA406C}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GamingServicesKit", "..\source\GamingServicesKit\GamingServicesKit.csproj", "{F4745BFB-8CB2-43F4-82D9-35E2F777FF62}" @@ -31,6 +35,22 @@ Global AppStore|iPhone = AppStore|iPhone EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|x86.ActiveCfg = Debug|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|x86.Build.0 = Debug|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|x86.ActiveCfg = Release|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|x86.Build.0 = Release|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|iPhone.ActiveCfg = Release|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|iPhone.Build.0 = Release|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|iPhone.Build.0 = Debug|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.AppStore|iPhone.Build.0 = Debug|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Debug|x86.ActiveCfg = Debug|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Debug|x86.Build.0 = Debug|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Release|x86.ActiveCfg = Release|Any CPU @@ -111,6 +131,22 @@ Global {FB530EE3-BAED-46B1-9703-D33D85E58A92}.Ad-Hoc|iPhone.Build.0 = Release|iPhone {FB530EE3-BAED-46B1-9703-D33D85E58A92}.AppStore|iPhone.ActiveCfg = Release|iPhone {FB530EE3-BAED-46B1-9703-D33D85E58A92}.AppStore|iPhone.Build.0 = Release|iPhone + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Debug|x86.Build.0 = Debug|iPhoneSimulator + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Release|x86.ActiveCfg = Release|iPhone + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Release|x86.Build.0 = Release|iPhone + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Release|iPhone.ActiveCfg = Release|iPhone + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Release|iPhone.Build.0 = Release|iPhone + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Debug|iPhone.ActiveCfg = Debug|iPhone + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Debug|iPhone.Build.0 = Debug|iPhone + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.AppStore|iPhone.ActiveCfg = AppStore|iPhone + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E}.AppStore|iPhone.Build.0 = AppStore|iPhone {F622F5FE-A71F-4A3E-B45C-2468DBAA406C}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator {F622F5FE-A71F-4A3E-B45C-2468DBAA406C}.Debug|x86.Build.0 = Debug|iPhoneSimulator {F622F5FE-A71F-4A3E-B45C-2468DBAA406C}.Release|x86.ActiveCfg = Release|iPhone @@ -145,11 +181,13 @@ Global {F4745BFB-8CB2-43F4-82D9-35E2F777FF62}.AppStore|iPhone.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution + {54FF3FE1-B984-4642-8131-16A4E8335A0D} = {22223EF5-BB05-497A-9729-4257528ABD91} {5B88D7C7-6E76-4D0D-8DBE-B3F0A5D6B8A0} = {22223EF5-BB05-497A-9729-4257528ABD91} {B8A416D8-45F1-4CD5-9469-5436304E3CBA} = {22223EF5-BB05-497A-9729-4257528ABD91} {8C6EFD7E-1512-4976-8E47-CF189BF6CB90} = {22223EF5-BB05-497A-9729-4257528ABD91} {170FAF51-4DF1-4271-B843-3257D285E864} = {22223EF5-BB05-497A-9729-4257528ABD91} {FB530EE3-BAED-46B1-9703-D33D85E58A92} = {97B73468-8507-4464-BA5C-6D3FE0DC7055} + {EDDC7A9A-9BB2-4C37-B85B-3D151079029E} = {97B73468-8507-4464-BA5C-6D3FE0DC7055} {F622F5FE-A71F-4A3E-B45C-2468DBAA406C} = {97B73468-8507-4464-BA5C-6D3FE0DC7055} {F4745BFB-8CB2-43F4-82D9-35E2F777FF62} = {22223EF5-BB05-497A-9729-4257528ABD91} EndGlobalSection diff --git a/Facebook.iOS/source/AudienceNetwork/ApiDefinition.cs b/Facebook.iOS/source/AudienceNetwork/ApiDefinition.cs new file mode 100644 index 00000000..e130b3ad --- /dev/null +++ b/Facebook.iOS/source/AudienceNetwork/ApiDefinition.cs @@ -0,0 +1,1875 @@ +// +// ApiDefinition.cs: Bindings to the Facebook iOS SDK. +// +// Authors: +// Miguel de Icaza (miguel@xamarin.com) +// Alex Soto (alex.soto@xamarin.com) +// Israel Soto (israel.soto@xamarin.com) +// + +using System; + +using ObjCRuntime; +using Foundation; +using UIKit; +using CoreLocation; +using Accounts; +using CoreGraphics; +using System.Reflection; +using System.ComponentModel; +using CoreMedia; +using CoreFoundation; + +namespace Facebook.AudienceNetwork +{ + // @interface FBAdChoicesView : UIView + [DisableDefaultCtor] + [BaseType (typeof (UIView), Name = "FBAdChoicesView")] + interface AdChoicesView { + // @property (readonly, nonatomic, weak) UILabel * label; + [Export ("label", ArgumentSemantic.Weak)] + UILabel Label { get; } + + // @property (getter = isBackgroundShown, assign, nonatomic) BOOL backgroundShown; + [Export ("backgroundShown")] + bool BackgroundShown { [Bind ("isBackgroundShown")] get; set; } + + // @property (nonatomic, assign, readonly, getter=isExpandable) BOOL expandable; + [Export ("expandable")] + bool Expandable { [Bind ("isExpandable")] get; set; } + + // @property (readwrite, nonatomic, weak) FBNativeAdBase * _Nullable nativeAd; + [NullAllowed] + [Export ("nativeAd", ArgumentSemantic.Weak)] + NativeAdBase NativeAd { get; set; } + + // @property (nonatomic, assign, readwrite) UIRectCorner corner; + [Export ("corner", ArgumentSemantic.Assign)] + UIRectCorner Corner { get; set; } + + // @property (assign, readwrite, nonatomic) UIEdgeInsets insets; + [Export ("insets", ArgumentSemantic.Assign)] + UIEdgeInsets Insets { get; set; } + + // @property (nonatomic, weak, readwrite, nullable) UIViewController *rootViewController; + [NullAllowed] + [Export ("rootViewController", ArgumentSemantic.Weak)] + UIViewController RootViewController { get; set; } + + // @property (readonly, assign, nonatomic) FBNativeAdViewTag nativeAdViewTag; + [Export ("nativeAdViewTag", ArgumentSemantic.Assign)] + NativeAdViewTag NativeAdViewTag { get; } + + // -(instancetype)initWithNativeAd:(FBNativeAd *)nativeAd; + [Export ("initWithNativeAd:")] + IntPtr Constructor (NativeAdBase nativeAd); + + // - (nonnull instancetype)initWithNativeAd:(nonnull FBNativeAd *)nativeAd expandable:(BOOL)expandable; + [Export ("initWithNativeAd:expandable:")] + IntPtr Constructor (NativeAdBase nativeAd, bool expandable); + + // -(instancetype _Nonnull)initWithNativeAd:(FBNativeAdBase * _Nonnull)nativeAd expandable:(BOOL)expandable attributes:(FBNativeAdViewAttributes * _Nullable)attributes; + [Export ("initWithNativeAd:expandable:attributes:")] + IntPtr Constructor (NativeAdBase nativeAd, bool expandable, [NullAllowed] NativeAdViewAttributes attributes); + + // -(void)updateFrameFromSuperview; + [Export ("updateFrameFromSuperview")] + void UpdateFrameFromSuperview (); + + // -(void)updateFrameFromSuperview:(UIRectCorner)corner; + [Export ("updateFrameFromSuperview:")] + void UpdateFrameFromSuperview (UIRectCorner corner); + + // - (void)updateFrameFromSuperview:(UIRectCorner)corner insets:(UIEdgeInsets)insets; + [Export ("updateFrameFromSuperview:insets:")] + void UpdateFrameFromSuperview (UIRectCorner corner, UIEdgeInsets insets); + } + + [Static] + partial interface AdExperienceType + { + // extern const FBAdExperienceType _Nonnull FBAdExperienceTypeRewarded; + [Field ("FBAdExperienceTypeRewarded", "__Internal")] + NSString Rewarded { get; } + + // extern const FBAdExperienceType _Nonnull FBAdExperienceTypeInterstitial; + [Field ("FBAdExperienceTypeInterstitial", "__Internal")] + NSString Interstitial { get; } + + // extern const FBAdExperienceType _Nonnull FBAdExperienceTypeRewardedInterstitial; + [Field ("FBAdExperienceTypeRewardedInterstitial", "__Internal")] + NSString RewardedInterstitial { get; } + } + + // @interface FBAdExperienceConfig : NSObject + [BaseType(typeof(NSObject), Name= "FBAdExperienceConfig")] + [DisableDefaultCtor] + interface AdExperienceConfig + { + // @property (readwrite, nonatomic, strong) FBAdExperienceType _Nonnull adExperienceType; + [Export("adExperienceType", ArgumentSemantic.Strong)] + string AdExperienceType { get; set; } + + // -(instancetype _Nonnull)initWithAdExperienceType:(FBAdExperienceType _Nonnull)adExperienceType __attribute__((objc_designated_initializer)); + [Export("initWithAdExperienceType:")] + [DesignatedInitializer] + IntPtr Constructor(NSString adExperienceType); + } + + [Static] + interface AdExtraHintKeywords { + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordAccessories; + [Obsolete ("Use the AdExtraHintKeyword.Accessories enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Accessories.GetConstant ()")] + NSString Accessories { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordArtHistory; + [Obsolete ("Use the AdExtraHintKeyword.ArtHistory enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.ArtHistory.GetConstant ()")] + NSString ArtHistory { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordAutomotive; + [Obsolete ("Use the AdExtraHintKeyword.Automotive enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Automotive.GetConstant ()")] + NSString Automotive { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBeauty; + [Obsolete ("Use the AdExtraHintKeyword.Beauty enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Beauty.GetConstant ()")] + NSString Beauty { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBiology; + [Obsolete ("Use the AdExtraHintKeyword.Biology enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Biology.GetConstant ()")] + NSString Biology { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBoardGames; + [Obsolete ("Use the AdExtraHintKeyword.BoardGames enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.BoardGames.GetConstant ()")] + NSString BoardGames { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBusinessSoftware; + [Obsolete ("Use the AdExtraHintKeyword.BusinessSoftware enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.BusinessSoftware.GetConstant ()")] + NSString BusinessSoftware { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBuyingSellingHomes; + [Obsolete ("Use the AdExtraHintKeyword.BuyingSellingHomes enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.BuyingSellingHomes.GetConstant ()")] + NSString BuyingSellingHomes { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordCats; + [Obsolete ("Use the AdExtraHintKeyword.Cats enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Cats.GetConstant ()")] + NSString Cats { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordCelebrities; + [Obsolete ("Use the AdExtraHintKeyword.Celebrities enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Celebrities.GetConstant ()")] + NSString Celebrities { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordClothing; + [Obsolete ("Use the AdExtraHintKeyword.Clothing enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Clothing.GetConstant ()")] + NSString Clothing { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordComicBooks; + [Obsolete ("Use the AdExtraHintKeyword.ComicBooks enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.ComicBooks.GetConstant ()")] + NSString ComicBooks { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordDesktopVideo; + [Obsolete ("Use the AdExtraHintKeyword.DesktopVideo enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.DesktopVideo.GetConstant ()")] + NSString DesktopVideo { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordDogs; + [Obsolete ("Use the AdExtraHintKeyword.Dogs enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Dogs.GetConstant ()")] + NSString Dogs { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordEducation; + [Obsolete ("Use the AdExtraHintKeyword.Education enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Education.GetConstant ()")] + NSString Education { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordEmail; + [Obsolete ("Use the AdExtraHintKeyword.Email enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Email.GetConstant ()")] + NSString Email { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordEntertainment; + [Obsolete ("Use the AdExtraHintKeyword.Entertainment enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Entertainment.GetConstant ()")] + NSString Entertainment { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFamilyParenting; + [Obsolete ("Use the AdExtraHintKeyword.FamilyParenting enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.FamilyParenting.GetConstant ()")] + NSString FamilyParenting { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFashion; + [Obsolete ("Use the AdExtraHintKeyword.Fashion enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Fashion.GetConstant ()")] + NSString Fashion { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFineArt; + [Obsolete ("Use the AdExtraHintKeyword.FineArt enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.FineArt.GetConstant ()")] + NSString FineArt { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFoodDrink; + [Obsolete ("Use the AdExtraHintKeyword.FoodDrink enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.FoodDrink.GetConstant ()")] + NSString FoodDrink { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFrenchCuisine; + [Obsolete ("Use the AdExtraHintKeyword.FrenchCuisine enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.FrenchCuisine.GetConstant ()")] + NSString FrenchCuisine { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordGovernment; + [Obsolete ("Use the AdExtraHintKeyword.Government enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Government.GetConstant ()")] + NSString Government { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHealthFitness; + [Obsolete ("Use the AdExtraHintKeyword.HealthFitness enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.HealthFitness.GetConstant ()")] + NSString HealthFitness { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHobbies; + [Obsolete ("Use the AdExtraHintKeyword.Hobbies enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Hobbies.GetConstant ()")] + NSString Hobbies { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHomeGarden; + [Obsolete ("Use the AdExtraHintKeyword.HomeGarden enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.HomeGarden.GetConstant ()")] + NSString HomeGarden { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHumor; + [Obsolete ("Use the AdExtraHintKeyword.Humor enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Humor.GetConstant ()")] + NSString Humor { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordInternetTechnology; + [Obsolete ("Use the AdExtraHintKeyword.InternetTechnology enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.InternetTechnology.GetConstant ()")] + NSString InternetTechnology { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLargeAnimals; + [Obsolete ("Use the AdExtraHintKeyword.LargeAnimals enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.LargeAnimals.GetConstant ()")] + NSString LargeAnimals { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLaw; + [Obsolete ("Use the AdExtraHintKeyword.Law enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Law.GetConstant ()")] + NSString Law { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLegalIssues; + [Obsolete ("Use the AdExtraHintKeyword.LegalIssues enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.LegalIssues.GetConstant ()")] + NSString LegalIssues { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLiterature; + [Obsolete ("Use the AdExtraHintKeyword.Literature enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Literature.GetConstant ()")] + NSString Literature { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordMarketing; + [Obsolete ("Use the AdExtraHintKeyword.Marketing enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Marketing.GetConstant ()")] + NSString Marketing { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordMovies; + [Obsolete ("Use the AdExtraHintKeyword.Movies enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Movies.GetConstant ()")] + NSString Movies { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordMusic; + [Obsolete ("Use the AdExtraHintKeyword.Music enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Music.GetConstant ()")] + NSString Music { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordNews; + [Obsolete ("Use the AdExtraHintKeyword.News enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.News.GetConstant ()")] + NSString News { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPersonalFinance; + [Obsolete ("Use the AdExtraHintKeyword.PersonalFinance enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.PersonalFinance.GetConstant ()")] + NSString PersonalFinance { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPets; + [Obsolete ("Use the AdExtraHintKeyword.Pets enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Pets.GetConstant ()")] + NSString Pets { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPhotography; + [Obsolete ("Use the AdExtraHintKeyword.Photography enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Photography.GetConstant ()")] + NSString Photography { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPolitics; + [Obsolete ("Use the AdExtraHintKeyword.Politics enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Politics.GetConstant ()")] + NSString Politics { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordRealEstate; + [Obsolete ("Use the AdExtraHintKeyword.RealEstate enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.RealEstate.GetConstant ()")] + NSString RealEstate { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordRoleplayingGames; + [Obsolete ("Use the AdExtraHintKeyword.RoleplayingGames enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.RoleplayingGames.GetConstant ()")] + NSString RoleplayingGames { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordScience; + [Obsolete ("Use the AdExtraHintKeyword.Science enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Science.GetConstant ()")] + NSString Science { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordShopping; + [Obsolete ("Use the AdExtraHintKeyword.Shopping enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Shopping.GetConstant ()")] + NSString Shopping { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordSociety; + [Obsolete ("Use the AdExtraHintKeyword.Society enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Society.GetConstant ()")] + NSString Society { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordSports; + [Obsolete ("Use the AdExtraHintKeyword.Sports enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Sports.GetConstant ()")] + NSString Sports { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordTechnology; + [Obsolete ("Use the AdExtraHintKeyword.Technology enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Technology.GetConstant ()")] + NSString Technology { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordTelevision; + [Obsolete ("Use the AdExtraHintKeyword.Television enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Television.GetConstant ()")] + NSString Television { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordTravel; + [Obsolete ("Use the AdExtraHintKeyword.Travel enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.Travel.GetConstant ()")] + NSString Travel { get; } + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordVideoComputerGames; + [Obsolete ("Use the AdExtraHintKeyword.VideoComputerGames enum instead. This will be removed in future versions.")] + [Static] + [Wrap ("AdExtraHintKeyword.VideoComputerGames.GetConstant ()")] + NSString VideoComputerGames { get; } + } + + // @interface FBAdExtraHint : NSObject + [Obsolete ("Keywords are no longer used in Audience Network.")] + [BaseType (typeof (NSObject), Name = "FBAdExtraHint")] + interface AdExtraHint { + // @property (copy, nonatomic) NSString * _Nullable contentURL; + [Obsolete ("Extra hints are no longer used in Audience Network.")] + [NullAllowed] + [Export ("contentURL")] + string ContentUrl { get; set; } + + // @property (copy, nonatomic) NSString * _Nullable extraData; + [Obsolete ("Extra hints are no longer used in Audience Network.")] + [NullAllowed] + [Export ("extraData")] + string ExtraData { get; set; } + + // @property (copy, nonatomic) NSString * _Nullable mediationData; + [Obsolete ("Extra hints are no longer used in Audience Network.")] + [NullAllowed] + [Export ("mediationData")] + string MediationData { get; set; } + + // -(instancetype _Nonnull)initWithKeywords:(NSArray * _Nonnull)keywords; + [Internal] + [Export ("initWithKeywords:")] + IntPtr Constructor (NSArray keywords); + + [Obsolete ("Keywords are no longer used in Audience Network.")] + [Wrap ("this (NSArray.FromNSObjects (k => k.GetConstant (), keywords))")] + IntPtr Constructor (AdExtraHintKeyword [] keywords); + + [Obsolete ("Keywords are no longer used in Audience Network.")] + [Wrap ("this (NSArray.FromNSObjects (keywords))")] + IntPtr Constructor (NSString [] keywords); + + // -(void)addKeyword:(FBAdExtraHintKeyword _Nonnull)keyword; + [Internal] + [Export ("addKeyword:")] + void _AddKeyword (NSString keyword); + + [Obsolete ("Keywords are no longer used in Audience Network.")] + [Wrap ("_AddKeyword (keyword.GetConstant ())")] + void AddKeyword (AdExtraHintKeyword keyword); + + [Obsolete ("Use the AddKeyword (AdExtraHintKeyword) overload method instead. This will be removed in future versions.")] + [Wrap ("_AddKeyword (keyword)")] + void AddKeyword (NSString keyword); + + // -(void)removeKeyword:(FBAdExtraHintKeyword _Nonnull)keyword; + [Internal] + [Export ("removeKeyword:")] + void _RemoveKeyword (NSString keyword); + + [Obsolete ("Keywords are no longer used in Audience Network.")] + [Wrap ("_RemoveKeyword (keyword.GetConstant ())")] + void RemoveKeyword (AdExtraHintKeyword keyword); + + [Obsolete ("Use the RemoveKeyword (AdExtraHintKeyword) overload method instead. This will be removed in future versions.")] + [Wrap ("_RemoveKeyword (keyword)")] + void RemoveKeyword (NSString keyword); + } + + // @interface FBAdIconView : UIView + [Obsolete ("This class will be removed in a future release. Use MediaView instead.")] + [BaseType (typeof (MediaView), Name = "FBAdIconView")] + interface AdIconView { + [Export ("initWithFrame:")] + IntPtr Constructor (CGRect frame); + + // @property (readonly, assign, nonatomic) FBNativeAdViewTag nativeAdViewTag; + [Export ("nativeAdViewTag", ArgumentSemantic.Assign)] + NativeAdViewTag NativeAdViewTag { get; } + } + + // @interface FBAdOptionsView : UIView + [BaseType (typeof (UIView), Name = "FBAdOptionsView")] + interface AdOptionsView { + // @property (readwrite, nonatomic, weak) FBNativeAdBase * _Nullable nativeAd; + [NullAllowed] + [Export ("nativeAd", ArgumentSemantic.Weak)] + NativeAdBase NativeAd { get; set; } + + // @property (nonatomic, strong) UIColor * _Nullable foregroundColor; + [NullAllowed] + [Export ("foregroundColor", ArgumentSemantic.Strong)] + UIColor ForegroundColor { get; set; } + + // @property (assign, nonatomic) BOOL useSingleIcon; + [Export ("useSingleIcon")] + bool UseSingleIcon { get; set; } + } + + delegate void AdImageCompletionHandler ([NullAllowed] UIImage imageLoaded); + + // @interface FBAdImage : NSObject + [BaseType (typeof (NSObject), Name = "FBAdImage")] + interface AdImage { + // @property (readonly, copy, nonatomic) NSURL * url; + [Export ("url", ArgumentSemantic.Copy)] + NSUrl Url { get; } + + // @property (readonly, assign, nonatomic) NSInteger width; + [Export ("width")] + nint Width { get; } + + // @property (readonly, assign, nonatomic) NSInteger height; + [Export ("height")] + nint Height { get; } + + // -(instancetype)initWithURL:(NSURL *)url width:(NSInteger)width height:(NSInteger)height __attribute__((objc_designated_initializer)); + [DesignatedInitializer] + [Export ("initWithURL:width:height:")] + IntPtr Constructor (NSUrl url, nint width, nint height); + + // -(void)loadImageAsyncWithBlock:(void (^ _Nullable)(UIImage * _Nullable))block; + [Export ("loadImageAsyncWithBlock:")] + void LoadImageAsync ([NullAllowed] AdImageCompletionHandler block); + } + + [DisableDefaultCtor] + [BaseType (typeof (NSObject), Name = "FBAdSettings")] + interface AdSettings { + [Field ("FBAudienceNetworkErrorDomain", "__Internal")] + NSString AdsErrorDomain { get; } + + [Field ("FBAudienceNetworkMediaViewErrorDomain", "__Internal")] + NSString MediaViewErrorDomain { get; } + + // @property (class, nonatomic, assign, getter=isBackgroundVideoPlaybackAllowed) BOOL backgroundVideoPlaybackAllowed; + [Static] + [Export ("backgroundVideoPlaybackAllowed")] + bool IsBackgroundVideoPlaybackAllowed { [Bind ("isBackgroundVideoPlaybackAllowed")] get; set; } + + // @property (class, nonatomic, assign) FBAdTestAdType testAdType; + [Static] + [Export ("testAdType", ArgumentSemantic.Assign)] + AdTestAdType TestAdType { get; set; } + + // @property (class, nonatomic, weak, nullable) id loggingDelegate; + [Static] + [NullAllowed] + [Export ("loggingDelegate", ArgumentSemantic.Weak)] + IAdLoggingDelegate LoggingDelegate { get; set; } + + // @property (class, nonatomic, copy, readonly) NSString *bidderToken; + [Static] + [Export ("bidderToken")] + string BidderToken { get; } + + // @property (readonly, copy, nonatomic, class) NSString * _Nonnull routingToken; + [Static] + [Export ("routingToken")] + string RoutingToken { get; } + + [Static] + [Export ("isTestMode")] + bool IsTestMode { get; } + + [Static] + [Export ("testDeviceHash")] + string TestDeviceHash { get; } + + [Static] + [Export ("addTestDevice:")] + void AddTestDevice (string deviceHash); + + [Static] + [Export ("addTestDevices:")] + void AddTestDevices (string [] devicesHash); + + [Static] + [Export ("clearTestDevices")] + void ClearTestDevices (); + + [Static] + [Export ("clearTestDevice:")] + void ClearTestDevice (string deviceHash); + + [Obsolete ("SetIsChildDirected method is no longer supported in Audience Network. Use MixedAudience static property instead.")] + [Static] + [Export ("setIsChildDirected:")] + void SetIsChildDirected (bool isChildDirected); + + // @property (getter = isMixedAudience, assign, nonatomic, class) BOOL mixedAudience; + [Static] + [Export ("mixedAudience")] + bool MixedAudience { [Bind ("isMixedAudience")] get; set; } + + // + (void)setMediationService:(NSString *)service; + [Static] + [Export ("setMediationService:")] + void SetMediationService (string service); + + // + (NSString *)urlPrefix; + // + (void)setUrlPrefix:(NSString *)urlPrefix; + [Advice ("This property should never be used in production.")] + [Static] + [NullAllowed] + [Export ("urlPrefix")] + string UrlPrefix { get; set; } + + // +(FBAdLogLevel)getLogLevel; + // +(void)setLogLevel:(FBAdLogLevel)level; + [Static] + [Export ("logLevel")] + AdLogLevel LogLevel { [Bind ("getLogLevel")] get; set; } + + // +(void)setDataProcessingOptions:(NSArray * _Nonnull)options country:(NSInteger)country state:(NSInteger)state; + [Static] + [Export ("setDataProcessingOptions:country:state:")] + void SetDataProcessingOptions (string[] options, nint country, nint state); + + // +(void)setDataProcessingOptions:(NSArray * _Nonnull)options; + [Static] + [Export ("setDataProcessingOptions:")] + void SetDataProcessingOptions (string[] options); + } + + interface IAdLoggingDelegate { } + + [Model (AutoGeneratedName = true)] + [Protocol] + [BaseType (typeof (NSObject), Name = "FBAdLoggingDelegate")] + interface AdLoggingDelegate { + // @required -(void)logAtLevel:(FBAdLogLevel)level withFileName:(NSString * _Nonnull)fileName withLineNumber:(int)lineNumber withThreadId:(long)threadId withBody:(NSString * _Nonnull)body; + [Abstract] + [Export ("logAtLevel:withFileName:withLineNumber:withThreadId:withBody:")] + void Log (AdLogLevel level, string fileName, int lineNumber, nint threadId, string body); + } + + [Static] + interface AdSizes { + [Internal] + [Field ("kFBAdSize320x50", "__Internal")] + IntPtr _kFBAdSize320x50 { get; } + + [Internal] + [Field ("kFBAdSizeHeight50Banner", "__Internal")] + IntPtr _kFBAdSizeHeight50Banner { get; } + + [Internal] + [Field ("kFBAdSizeHeight90Banner", "__Internal")] + IntPtr _kFBAdSizeHeight90Banner { get; } + + [Internal] + [Field ("kFBAdSizeInterstitial", "__Internal")] + IntPtr _kFBAdSizeInterstitial { get; } + + [Internal] + [Field ("kFBAdSizeHeight250Rectangle", "__Internal")] + IntPtr _kFBAdSizeHeight250Rectangle { get; } + } + + [DisableDefaultCtor] + [BaseType (typeof (UIView), Name = "FBAdView")] + interface AdView { + [DesignatedInitializer] + [Export ("initWithPlacementID:adSize:rootViewController:")] + IntPtr Constructor (string placementId, AdSize adSize, [NullAllowed] UIViewController rootViewController); + + // -(instancetype _Nullable)initWithPlacementID:(NSString * _Nonnull)placementID bidPayload:(NSString * _Nonnull)bidPayload rootViewController:(UIViewController * _Nullable)rootViewController error:(NSError * _Nullable * _Nullable)error; + [Export ("initWithPlacementID:bidPayload:rootViewController:error:")] + IntPtr Constructor (string placementId, string bidPayload, [NullAllowed] UIViewController rootViewController, [NullAllowed] out NSError error); + + [Export ("loadAd")] + void LoadAd (); + + // - (void)loadAdWithBidPayload:(NSString *)bidPayload; + [Export ("loadAdWithBidPayload:")] + void LoadAd (string bidPayload); + + // -(void)disableAutoRefresh; + [Obsolete ("Autorefresh is disabled by default.")] + [Export ("disableAutoRefresh")] + void DisableAutoRefresh (); + + [Export ("placementID")] + string PlacementId { get; } + + [NullAllowed] + [Export ("rootViewController", ArgumentSemantic.Weak)] + UIViewController RootViewController { get; } + + // @property (readonly, getter = isAdValid, nonatomic) BOOL adValid; + [Export ("isAdValid")] + bool IsAdValid { get; } + + [NullAllowed] + [Export ("delegate", ArgumentSemantic.Weak)] + IAdViewDelegate Delegate { get; set; } + + // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; + [NullAllowed] + [Export ("extraHint", ArgumentSemantic.Strong)] + AdExtraHint ExtraHint { get; set; } + } + + interface IAdViewDelegate { } + + [Model (AutoGeneratedName = true)] + [Protocol] + [BaseType (typeof (NSObject), Name = "FBAdViewDelegate")] + interface AdViewDelegate { + [Export ("adViewDidClick:")] + void AdViewDidClick (AdView adView); + + [Export ("adViewDidFinishHandlingClick:")] + void AdViewDidFinishHandlingClick (AdView adView); + + [Export ("adViewDidLoad:")] + void AdViewDidLoad (AdView adView); + + [Export ("adView:didFailWithError:")] + void AdViewDidFail (AdView adView, NSError error); + + // @optional -(void)adViewWillLogImpression:(FBAdView * _Nonnull)adView; + [Export ("adViewWillLogImpression:")] + void AdViewWillLogImpression (AdView adView); + + [Export ("viewControllerForPresentingModalView", ArgumentSemantic.Strong)] + UIViewController GetViewControllerForPresentingModalView (); + } + + // @interface FBAdInitSettings : NSObject + [DisableDefaultCtor] + [BaseType (typeof (NSObject), Name = "FBAdInitSettings")] + interface AdInitSettings { + // -(instancetype _Nonnull)initWithPlacementIDs:(NSArray * _Nonnull)placementIDs mediationService:(NSString * _Nonnull)mediationService; + [Export ("initWithPlacementIDs:mediationService:")] + IntPtr Constructor (string [] placementIds, string mediationService); + + // @property (readonly, copy, nonatomic) NSArray * _Nonnull placementIDs; + [Export ("placementIDs", ArgumentSemantic.Copy)] + string [] PlacementIds { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nonnull mediationService; + [Export ("mediationService")] + string MediationService { get; } + } + + // @interface FBAdInitResults : NSObject + [BaseType (typeof (NSObject), Name = "FBAdInitResults")] + interface AdInitResults { + // @property (readonly, getter = isSuccess, assign, nonatomic) BOOL success; + [Export ("isSuccess")] + bool IsSuccess { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nonnull message; + [Export ("message")] + string Message { get; } + } + + // @interface FBAudienceNetworkAds : NSObject + [DisableDefaultCtor] + [BaseType (typeof (NSObject), Name = "FBAudienceNetworkAds")] + interface AudienceNetworkAds { + // +(void)initializeWithSettings:(FBAdInitSettings * _Nullable)settings completionHandler:(void (^ _Nullable)(FBAdInitResults * _Nonnull))completionHandler; + [Static] + [Export ("initializeWithSettings:completionHandler:")] + void Initialize ([NullAllowed] AdInitSettings settings, [NullAllowed] Action completionHandler); + + // +(FBAdFormatTypeName)adFormatTypeNameForPlacementId:(NSString * _Nonnull)placementId; + [Static] + [Export ("adFormatTypeNameForPlacementId:")] + AdFormatTypeName GetAdFormatTypeName (string placementId); + } + + // @interface FBInstreamAdView : UIView + [DisableDefaultCtor] + [BaseType (typeof (UIView), Name = "FBInstreamAdView")] + interface InstreamAdView { + // @property (readonly, getter = isAdValid, nonatomic) BOOL adValid; + [Export ("adValid")] + bool IsAdValid { [Bind ("isAdValid")] get; } + + // @property (nonatomic, weak) id _Nullable delegate; + [NullAllowed] + [Export ("delegate", ArgumentSemantic.Weak)] + IInstreamAdViewDelegate Delegate { get; set; } + + // @property (readonly, copy, nonatomic) NSString * _Nonnull placementID; + [NullAllowed] + [Export ("placementID")] + string PlacementId { get; } + + // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; + [NullAllowed] + [Export ("extraHint", ArgumentSemantic.Strong)] + AdExtraHint ExtraHint { get; set; } + + // -(instancetype _Nullable)initWithPlacementID:(NSString * _Nonnull)placementID __attribute__((objc_designated_initializer)); + [Obsolete("Instream ads have been deprecated. Initialiser will return nil.")] + [DesignatedInitializer] + [Export ("initWithPlacementID:")] + IntPtr Constructor (string placementId); + + // -(void)loadAd; + [Obsolete("Instream ads have been deprecated. Initialiser will return nil.")] + [PostGet ("IsAdValid")] + [Export ("loadAd")] + void LoadAd (); + + // - (void) loadAdWithBidPayload:(NSString*) bidPayload; + [Obsolete("Instream ads have been deprecated. Initialiser will return nil.")] + [Export ("loadAdWithBidPayload:")] + void LoadAd (string bidPayload); + + // -(BOOL)showAdFromRootViewController:(UIViewController * _Nullable)rootViewController; + [Obsolete("Instream ads have been deprecated. Initialiser will return nil.")] + [Export ("showAdFromRootViewController:")] + bool ShowAd ([NullAllowed] UIViewController rootViewController); + } + + interface IInstreamAdViewDelegate { } + + // @protocol FBInstreamAdViewDelegate + [Model (AutoGeneratedName = true)] + [Protocol] + [BaseType (typeof (NSObject), Name = "FBInstreamAdViewDelegate")] + interface InstreamAdViewDelegate { + // @required -(void)adViewDidLoad:(FBInstreamAdView * _Nonnull)adView; + [Abstract] + [Export ("adViewDidLoad:")] + void AdViewDidLoad ([NullAllowed] InstreamAdView adView); + + // @required -(void)adViewDidEnd:(FBInstreamAdView * _Nonnull)adView; + [Abstract] + [Export ("adViewDidEnd:")] + void AdViewDidEnd ([NullAllowed] InstreamAdView adView); + + // @required -(void)adView:(FBInstreamAdView * _Nonnull)adView didFailWithError:(NSError * _Nonnull)error; + [Abstract] + [Export ("adView:didFailWithError:")] + void AdViewDidFail ([NullAllowed] InstreamAdView adView, [NullAllowed] NSError error); + + // @optional -(void)adViewDidClick:(FBInstreamAdView * _Nonnull)adView; + [Export ("adViewDidClick:")] + void AdViewDidClick ([NullAllowed] InstreamAdView adView); + + // @optional -(void)adViewWillLogImpression:(FBInstreamAdView * _Nonnull)adView; + [Export ("adViewWillLogImpression:")] + void AdViewWillLogImpression ([NullAllowed] InstreamAdView adView); + } + + [DisableDefaultCtor] + [BaseType (typeof (NSObject), Name = "FBInterstitialAd")] + interface InterstitialAd { + [Export ("placementID")] + string PlacementId { get; } + + [NullAllowed] + [Export ("delegate", ArgumentSemantic.Weak)] + IInterstitialAdDelegate Delegate { get; set; } + + // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; + [NullAllowed] + [Export ("extraHint", ArgumentSemantic.Strong)] + AdExtraHint ExtraHint { get; set; } + + [Export ("initWithPlacementID:")] + [DesignatedInitializer] + IntPtr Constructor (string placementId); + + [Export ("isAdValid")] + bool IsAdValid { get; } + + [PostGet ("IsAdValid")] + [Export ("loadAd")] + void LoadAd (); + + // - (void) loadAdWithBidPayload:(NSString*) bidPayload; + [PostGet ("IsAdValid")] + [Export ("loadAdWithBidPayload:")] + void LoadAd (string bidPayload); + + [Export ("showAdFromRootViewController:")] + bool ShowAd ([NullAllowed] UIViewController rootViewController); + } + + interface IInterstitialAdDelegate { } + + [Model (AutoGeneratedName = true)] + [Protocol] + [BaseType (typeof (NSObject), Name = "FBInterstitialAdDelegate")] + interface InterstitialAdDelegate { + [Export ("interstitialAdDidClick:")] + void InterstitialAdDidClick (InterstitialAd interstitialAd); + + [Export ("interstitialAdDidClose:")] + void InterstitialAdDidClose (InterstitialAd interstitialAd); + + [Export ("interstitialAdWillClose:")] + void InterstitialAdWillClose (InterstitialAd interstitialAd); + + [Export ("interstitialAdDidLoad:")] + void InterstitialAdDidLoad (InterstitialAd interstitialAd); + + [Export ("interstitialAd:didFailWithError:")] + void IntersitialDidFail (InterstitialAd interstitialAd, NSError error); + + // @optional -(void)interstitialAdWillLogImpression:(FBInterstitialAd * _Nonnull)interstitialAd; + [Export ("interstitialAdWillLogImpression:")] + void InterstitialAdWillLogImpression (InterstitialAd interstitialAd); + } + + // @interface FBMediaView : UIView + [BaseType (typeof (UIView), Name = "FBMediaView")] + interface MediaView { + [Export ("initWithFrame:")] + IntPtr Constructor (CGRect frame); + + // @property (nonatomic, weak) id delegate; + [NullAllowed] + [Export ("delegate", ArgumentSemantic.Weak)] + IMediaViewDelegate Delegate { get; set; } + + // @property (nonatomic, strong, nonnull) FBMediaViewVideoRenderer *videoRenderer; + [Export ("videoRenderer", ArgumentSemantic.Strong)] + MediaViewVideoRenderer VideoRenderer { get; set; } + + // @property (readonly, assign, nonatomic) float volume; + [Export ("volume")] + float Volume { get; } + + // @property (nonatomic, readonly, getter=isAutoplayEnabled) BOOL autoplayEnabled; + [Export ("isAutoplayEnabled")] + bool IsAutoplayEnabled { get; } + + // @property (readonly, assign, nonatomic) CGFloat aspectRatio; + [Export ("aspectRatio")] + nfloat AspectRatio { get; } + + // @property (readonly, assign, nonatomic) FBNativeAdViewTag nativeAdViewTag; + [New] + [Export ("nativeAdViewTag", ArgumentSemantic.Assign)] + NativeAdViewTag NativeAdViewTag { get; } + + // -(void)applyNaturalWidth; + [Export ("applyNaturalWidth")] + void ApplyNaturalWidth (); + + // -(void)applyNaturalHeight; + [Export ("applyNaturalHeight")] + void ApplyNaturalHeight (); + } + + interface IMediaViewDelegate { } + + // @protocol FBMediaViewDelegate + [Model (AutoGeneratedName = true)] + [Protocol] + [BaseType (typeof (NSObject), Name = "FBMediaViewDelegate")] + interface MediaViewDelegate { + // @optional -(void)mediaViewDidLoad:(FBMediaView *)mediaView; + [Export ("mediaViewDidLoad:")] + void MediaViewDidLoad (MediaView mediaView); + + // @optional -(void)mediaViewWillEnterFullscreen:(FBMediaView * _Nonnull)mediaView; + [Export ("mediaViewWillEnterFullscreen:")] + void MediaViewWillEnterFullscreen (MediaView mediaView); + + // @optional -(void)mediaViewDidExitFullscreen:(FBMediaView * _Nonnull)mediaView; + [Export ("mediaViewDidExitFullscreen:")] + void MediaViewDidExitFullscreen (MediaView mediaView); + + // @optional -(void)mediaView:(FBMediaView * _Nonnull)mediaView videoVolumeDidChange:(float)volume; + [Export ("mediaView:videoVolumeDidChange:")] + void MediaViewVideoVolumeDidChange (MediaView mediaView, float volume); + + // @optional -(void)mediaViewVideoDidPause:(FBMediaView * _Nonnull)mediaView; + [Export ("mediaViewVideoDidPause:")] + void MediaViewVideoDidPause (MediaView mediaView); + + // @optional -(void)mediaViewVideoDidPlay:(FBMediaView * _Nonnull)mediaView; + [Export ("mediaViewVideoDidPlay:")] + void MediaViewVideoDidPlay (MediaView mediaView); + + // @optional -(void)mediaViewVideoDidComplete:(MediaView * _Nonnull)mediaView; + [Export ("mediaViewVideoDidComplete:")] + void MediaViewVideoDidComplete (MediaView mediaView); + } + + // @interface FBMediaViewVideoRenderer : UIView + [DisableDefaultCtor] + [BaseType (typeof (UIView), Name = "FBMediaViewVideoRenderer")] + interface MediaViewVideoRenderer { + [Export ("initWithFrame:")] + IntPtr Constructor (CGRect frame); + + // @property (nonatomic, assign, readonly) CGFloat aspectRatio; + [Export ("aspectRatio", ArgumentSemantic.Assign)] + nfloat AspectRatio { get; } + + // @property (nonatomic, assign, readonly) CMTime currentTime; + [Export ("currentTime", ArgumentSemantic.Assign)] + CMTime CurrentTime { get; } + + // @property (nonatomic, assign, readonly) CMTime duration; + [Export ("duration", ArgumentSemantic.Assign)] + CMTime Duration { get; } + + // @property (nonatomic, assign, readonly, getter=isPlaying) BOOL playing; + [Export ("isPlaying", ArgumentSemantic.Assign)] + bool IsPlaying { get; } + + // @property (nonatomic, assign) float volume; + [Export ("volume", ArgumentSemantic.Assign)] + float Volume { get; set; } + + // - (void)playVideo; + [Export ("playVideo")] + void PlayVideo (); + + // - (void)pauseVideo; + [Export ("pauseVideo")] + void PauseVideo (); + + // - (void)engageVideoSeek; + [Export ("engageVideoSeek")] + void EngageVideoSeek (); + + // - (void)disengageVideoSeek; + [Export ("disengageVideoSeek")] + void DisengageVideoSeek (); + + // - (void)seekVideoToTime:(CMTime)time; + [Export ("seekVideoToTime:")] + void SeekVideoToTime (CMTime time); + + // - (nullable id)addPeriodicTimeObserverForInterval:(CMTime)interval queue:(dispatch_queue_t) queue usingBlock:(void (^)(CMTime time))block; + [return: NullAllowed] + [Export ("addPeriodicTimeObserverForInterval:queue:usingBlock:")] + NSObject AddPeriodicTimeObserver (CMTime interval, DispatchQueue queue, Action block); + + // - (void)removeTimeObserver:(id)observer; + [Export ("removeTimeObserver:")] + void RemoveTimeObserver (NSObject observer); + + // - (void)videoDidChangeVolume; + [Export ("videoDidChangeVolume")] + void VideoDidChangeVolume (); + + // - (void)videoDidLoad; + [Export ("videoDidLoad")] + void VideoDidLoad (); + + // - (void)videoDidPause; + [Export ("videoDidPause")] + void VideoDidPause (); + + // - (void)videoDidPlay; + [Export ("videoDidPlay")] + void VideoDidPlay (); + + // - (void)videoDidEngageSeek; + [Export ("videoDidEngageSeek")] + void VideoDidEngageSeek (); + + // - (void)videoDidSeek; + [Export ("videoDidSeek")] + void VideoDidSeek (); + + // - (void)videoDidDisengageSeek; + [Export ("videoDidDisengageSeek")] + void VideoDidDisengageSeek (); + + // - (void)videoDidEnd; + [Export ("videoDidEnd")] + void VideoDidEnd (); + + // - (void)videoDidFailWithError:(NSError *)error; + [Export ("videoDidFailWithError:")] + void VideoDidFail (NSError error); + } + + [DisableDefaultCtor] + [BaseType (typeof (NativeAdBase), Name = "FBNativeAd")] + interface NativeAd { + [NullAllowed] + [Export ("delegate", ArgumentSemantic.Weak)] + INativeAdDelegate Delegate { get; set; } + + [Export ("initWithPlacementID:")] + IntPtr Constructor (string placementId); + + // - (void)registerViewForInteraction:(UIView *)view mediaView:(FBMediaView*) mediaView iconView:(nullable FBAdIconView *)iconView viewController:(nullable UIViewController *)viewController; + [Export ("registerViewForInteraction:mediaView:iconView:viewController:")] + void RegisterView (UIView view, MediaView mediaView, [NullAllowed] MediaView iconView, [NullAllowed] UIViewController viewController); + + // - (void)registerViewForInteraction:(UIView *)view mediaView:(FBMediaView*) mediaView iconView:(nullable FBAdIconView *)iconView viewController:(nullable UIViewController *)viewController clickableViews:(nullable NSArray *)clickableViews; + [Export ("registerViewForInteraction:mediaView:iconView:viewController:clickableViews:")] + void RegisterView (UIView view, MediaView mediaView, [NullAllowed] MediaView iconView, [NullAllowed] UIViewController viewController, [NullAllowed] UIView [] clickableViews); + + // -(void)registerViewForInteraction:(UIView * _Nonnull)view mediaView:(FBMediaView * _Nonnull)mediaView iconImageView:(UIImageView * _Nullable)iconImageView viewController:(UIViewController * _Nullable)viewController; + [Export ("registerViewForInteraction:mediaView:iconImageView:viewController:")] + void RegisterView (UIView view, MediaView mediaView, [NullAllowed] UIImageView iconImageView, [NullAllowed] UIViewController viewController); + + // -(void)registerViewForInteraction:(UIView * _Nonnull)view mediaView:(FBMediaView * _Nonnull)mediaView iconImageView:(UIImageView * _Nullable)iconImageView viewController:(UIViewController * _Nullable)viewController clickableViews:(NSArray * _Nullable)clickableViews; + [Export ("registerViewForInteraction:mediaView:iconImageView:viewController:clickableViews:")] + void RegisterView (UIView view, MediaView mediaView, [NullAllowed] UIImageView iconImageView, [NullAllowed] UIViewController viewController, [NullAllowed] UIView [] clickableViews); + + + + // -(void)downloadMedia; + [Export ("downloadMedia")] + void DownloadMedia (); + } + + interface INativeAdDelegate { } + + [Model (AutoGeneratedName = true)] + [Protocol] + [BaseType (typeof (NSObject), Name = "FBNativeAdDelegate")] + interface NativeAdDelegate + { + [Export ("nativeAdDidLoad:")] + void NativeAdDidLoad (NativeAd nativeAd); + + // @optional -(void)nativeAdDidDownloadMedia:(FBNativeAd * _Nonnull)nativeAd; + [Export ("nativeAdDidDownloadMedia:")] + void NativeAdDidDownloadMedia (NativeAd nativeAd); + + [Export ("nativeAd:didFailWithError:")] + void NativeAdDidFail (NativeAd nativeAd, NSError error); + + [Export ("nativeAdDidClick:")] + void NativeAdDidClick (NativeAd nativeAd); + + [Export ("nativeAdDidFinishHandlingClick:")] + void NativeAdDidFinishHandlingClick (NativeAd nativeAd); + + [Export("nativeAdWillLogImpression:")] + void NativeAdWillLogImpression(NativeAd nativeAd); + } + + // @interface FBNativeAdBase : NSObject + [DisableDefaultCtor] + [BaseType (typeof (NSObject), Name = "FBNativeAdBase")] + interface NativeAdBase { + // @property (readonly, copy, nonatomic) NSString * _Nonnull placementID; + [Export ("placementID")] + string PlacementId { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable headline; + [NullAllowed] + [Export ("headline")] + string Headline { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable linkDescription; + [NullAllowed] + [Export ("linkDescription")] + string LinkDescription { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable advertiserName; + [NullAllowed] + [Export ("advertiserName")] + string AdvertiserName { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable socialContext; + [NullAllowed] + [Export ("socialContext")] + string SocialContext { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable callToAction; + [NullAllowed] + [Export ("callToAction")] + string CallToAction { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable rawBodyText; + [NullAllowed] + [Export ("rawBodyText")] + string RawBodyText { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable bodyText; + [NullAllowed] + [Export ("bodyText")] + string BodyText { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable sponsoredTranslation; + [NullAllowed] + [Export ("sponsoredTranslation")] + string SponsoredTranslation { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable adTranslation; + [NullAllowed] + [Export ("adTranslation")] + string AdTranslation { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable promotedTranslation; + [NullAllowed] + [Export ("promotedTranslation")] + string PromotedTranslation { get; } + + // @property (readonly, nonatomic, strong) FBAdImage * _Nullable adChoicesIcon; + [NullAllowed] + [Export ("adChoicesIcon", ArgumentSemantic.Strong)] + AdImage AdChoicesIcon { get; } + + // @property (readonly, nonatomic, strong) UIImage * _Nullable iconImage; + [NullAllowed, Export ("iconImage", ArgumentSemantic.Strong)] + UIImage IconImage { get; } + + // @property (readonly, assign, nonatomic) CGFloat aspectRatio; + [Export ("aspectRatio")] + nfloat AspectRatio { get; } + + // @property (readonly, copy, nonatomic) NSURL * _Nullable adChoicesLinkURL; + [NullAllowed] + [Export ("adChoicesLinkURL", ArgumentSemantic.Copy)] + NSUrl AdChoicesLinkUrl { get; } + + // @property (readonly, copy, nonatomic) NSString * _Nullable adChoicesText; + [NullAllowed] + [Export ("adChoicesText")] + string AdChoicesText { get; } + + // @property (readonly, assign, nonatomic) FBAdFormatType adFormatType; + [Export ("adFormatType", ArgumentSemantic.Assign)] + AdFormatType AdFormatType { get; } + + // @property (readonly, nonatomic) FBNativeAdsCachePolicy mediaCachePolicy; + [Export ("mediaCachePolicy")] + NativeAdsCachePolicy MediaCachePolicy { get; } + + // @property (readonly, getter = isAdValid, nonatomic) BOOL adValid; + [Export ("isAdValid")] + bool IsAdValid { get; } + + // @property (readonly, getter = isRegistered, nonatomic) BOOL registered; + [Export ("isRegistered")] + bool IsRegistered { get; } + + // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; + [NullAllowed] + [Export ("extraHint", ArgumentSemantic.Strong)] + AdExtraHint ExtraHint { get; set; } + + // -(void)unregisterView; + [Export ("unregisterView")] + void UnregisterView (); + + // -(void)loadAd; + [Export ("loadAd")] + void LoadAd (); + + // -(void)loadAdWithMediaCachePolicy:(FBNativeAdsCachePolicy)mediaCachePolicy; + [Export ("loadAdWithMediaCachePolicy:")] + void LoadAd (NativeAdsCachePolicy mediaCachePolicy); + + // -(void)loadAdWithBidPayload:(NSString * _Nonnull)bidPayload; + [Export ("loadAdWithBidPayload:")] + void LoadAd (string bidPayload); + + // -(void)loadAdWithBidPayload:(NSString * _Nonnull)bidPayload mediaCachePolicy:(FBNativeAdsCachePolicy)mediaCachePolicy; + [Export ("loadAdWithBidPayload:mediaCachePolicy:")] + void LoadAd (string bidPayload, NativeAdsCachePolicy mediaCachePolicy); + + // +(instancetype _Nullable)nativeAdWithPlacementId:(NSString * _Nonnull)placementId bidPayload:(NSString * _Nonnull)bidPayload error:(NSError * _Nullable * _Nullable)error; + [Static] + [return: NullAllowed] + [Export ("nativeAdWithPlacementId:bidPayload:error:")] + NativeAdBase Create (string placementId, string bidPayload, [NullAllowed] out NSError error); + } + + // @interface FBNativeAdBaseView : UIView + [BaseType (typeof (UIView), Name = "FBNativeAdBaseView")] + interface NativeAdBaseView { + // @property (nonatomic, weak) UIViewController * _Nullable rootViewController; + [NullAllowed] + [Export ("rootViewController", ArgumentSemantic.Weak)] + UIViewController RootViewController { get; set; } + } + + // @interface FBNativeAdCollectionViewAdProvider : NSObject + [DisableDefaultCtor] + [BaseType (typeof (NSObject), Name = "FBNativeAdCollectionViewAdProvider")] + interface NativeAdCollectionViewAdProvider { + // @property (nonatomic, weak) id _Nullable delegate; + [NullAllowed] + [Export ("delegate", ArgumentSemantic.Weak)] + INativeAdDelegate Delegate { get; set; } + + // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; + [NullAllowed] + [Export ("extraHint", ArgumentSemantic.Strong)] + AdExtraHint ExtraHint { get; set; } + + // -(instancetype _Nonnull)initWithManager:(FBNativeAdsManager * _Nonnull)manager __attribute__((objc_designated_initializer)); + [DesignatedInitializer] + [Export ("initWithManager:")] + IntPtr Constructor (NativeAdsManager manager); + + // -(FBNativeAd * _Nonnull)collectionView:(UICollectionView * _Nonnull)collectionView nativeAdForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath; + [Export ("collectionView:nativeAdForRowAtIndexPath:")] + NativeAd GetNativeAdForRow (UICollectionView collectionView, NSIndexPath indexPath); + + // -(BOOL)isAdCellAtIndexPath:(NSIndexPath * _Nonnull)indexPath forStride:(NSUInteger)stride; + [Export ("isAdCellAtIndexPath:forStride:")] + bool IsAdCellAtIndexPath (NSIndexPath indexPath, nuint stride); + + // -(NSIndexPath * _Nonnull)adjustNonAdCellIndexPath:(NSIndexPath * _Nonnull)indexPath forStride:(NSUInteger)stride; + [return: NullAllowed] + [Export ("adjustNonAdCellIndexPath:forStride:")] + NSIndexPath AdjustNonAdCellIndexPath (NSIndexPath indexPath, nuint stride); + + // -(NSUInteger)adjustCount:(NSUInteger)count forStride:(NSUInteger)stride; + [Export ("adjustCount:forStride:")] + nuint AdjustCount (nuint count, nuint stride); + } + + // @interface FBNativeAdCollectionViewCellProvider : FBNativeAdCollectionViewAdProvider + [DisableDefaultCtor] + [BaseType (typeof (NativeAdCollectionViewAdProvider), Name = "FBNativeAdCollectionViewCellProvider")] + interface NativeAdCollectionViewCellProvider { + // -(instancetype _Nonnull)initWithManager:(FBNativeAdsManager * _Nonnull)manager forType:(FBNativeAdViewType)type; + [Export ("initWithManager:forType:")] + IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type); + + // -(instancetype _Nonnull)initWithManager:(FBNativeAdsManager * _Nonnull)manager forType:(FBNativeAdViewType)type forAttributes:(FBNativeAdViewAttributes * _Nonnull)attributes __attribute__((objc_designated_initializer)); + [DesignatedInitializer] + [Export ("initWithManager:forType:forAttributes:")] + IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type, NativeAdViewAttributes attributes); + + // -(UICollectionViewCell * _Nonnull)collectionView:(UICollectionView * _Nonnull)collectionView cellForItemAtIndexPath:(NSIndexPath * _Nonnull)indexPath; + [Export ("collectionView:cellForItemAtIndexPath:")] + UICollectionViewCell GetCell (UICollectionView collectionView, NSIndexPath indexPath); + + // -(CGFloat)collectionView:(UICollectionView * _Nonnull)collectionView heightForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath; + [Export ("collectionView:heightForRowAtIndexPath:")] + nfloat GetHeightForRow (UICollectionView collectionView, NSIndexPath indexPath); + } + + delegate UIView NativeAdScrollViewViewProviderHandler (NativeAd nativeAd, nuint position); + + // @interface FBNativeAdScrollView : UIView + [DisableDefaultCtor] + [BaseType (typeof (UIView), Name = "FBNativeAdScrollView")] + interface NativeAdScrollView { + // @property (readonly, assign, nonatomic) NSUInteger maximumNativeAdCount; + [Export ("maximumNativeAdCount", ArgumentSemantic.Assign)] + nuint MaximumNativeAdCount { get; } + + // @property (getter = isAnimationEnabled, assign, nonatomic) BOOL animationEnabled; + [Export ("animationEnabled")] + bool AnimationEnabled { [Bind ("isAnimationEnabled")] get; set; } + + // @property (assign, nonatomic) CGFloat xInset; + [Export ("xInset", ArgumentSemantic.Assign)] + nfloat XInset { get; set; } + + // @property (getter = isAdPersistenceEnabled, assign, nonatomic) BOOL adPersistenceEnabled; + [Export ("adPersistenceEnabled")] + bool AdPersistenceEnabled { [Bind ("isAdPersistenceEnabled")] get; set; } + + // @property (nonatomic, weak) UIViewController * viewController; + [NullAllowed] + [Export ("rootViewController", ArgumentSemantic.Weak)] + UIViewController RootViewController { get; set; } + + // @property (nonatomic, weak) id delegate; + [NullAllowed] + [Export ("delegate", ArgumentSemantic.Weak)] + INativeAdDelegate Delegate { get; set; } + + // -(instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager withType:(FBNativeAdViewType)type; + [Export ("initWithNativeAdsManager:withType:")] + IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type); + + // -(instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager withType:(FBNativeAdViewType)type withAttributes:(FBNativeAdViewAttributes *)attributes; + [Export ("initWithNativeAdsManager:withType:withAttributes:")] + IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type, NativeAdViewAttributes attributes); + + // -(instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager withType:(FBNativeAdViewType)type withAttributes:(FBNativeAdViewAttributes *)attributes withMaximum:(NSUInteger)maximumNativeAdCount; + [Export ("initWithNativeAdsManager:withType:withAttributes:withMaximum:")] + IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type, NativeAdViewAttributes attributes, nuint maximumNativeAdCount); + + // -(instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager withViewProvider:(UIView *(^)(FBNativeAd *, NSUInteger))childViewProvider; + [Export ("initWithNativeAdsManager:withViewProvider:")] + IntPtr Constructor (NativeAdsManager manager, NativeAdScrollViewViewProviderHandler childViewProviderHandler); + + // -(instancetype)initWithNativeAdsManager:(FBNativeAdsManager *)manager withViewProvider:(UIView *(^)(FBNativeAd *, NSUInteger))childViewProvider withMaximum:(NSUInteger)maximumNativeAdCount; + [DesignatedInitializer] + [Export ("initWithNativeAdsManager:withViewProvider:withMaximum:")] + IntPtr Constructor (NativeAdsManager manager, NativeAdScrollViewViewProviderHandler childViewProviderHandler, nuint maximumNativeAdCount); + } + + interface INativeAdsManagerDelegate { } + + // @protocol FBNativeAdsManagerDelegate + [Model (AutoGeneratedName = true)] + [Protocol] + [BaseType (typeof (NSObject), Name = "FBNativeAdsManagerDelegate")] + interface NativeAdsManagerDelegate { + // @required -(void)nativeAdsLoaded; + [Abstract] + [Export ("nativeAdsLoaded")] + void NativeAdsLoaded (); + + // @required -(void)nativeAdsFailedToLoadWithError:(NSError *)error; + [Abstract] + [Export ("nativeAdsFailedToLoadWithError:")] + void NativeAdsFailedToLoad (NSError error); + } + + // @interface FBNativeAdsManager : NSObject + [DisableDefaultCtor] + [BaseType (typeof (NSObject), Name = "FBNativeAdsManager")] + interface NativeAdsManager + { + // @property (nonatomic, weak) id delegate; + [NullAllowed] + [Export ("delegate", ArgumentSemantic.Weak)] + INativeAdsManagerDelegate Delegate { get; set; } + + // @property (assign, nonatomic) FBNativeAdsCachePolicy mediaCachePolicy; + [Export ("mediaCachePolicy", ArgumentSemantic.Assign)] + NativeAdsCachePolicy MediaCachePolicy { get; set; } + + // @property (readonly, assign, nonatomic) NSUInteger uniqueNativeAdCount; + [Export ("uniqueNativeAdCount", ArgumentSemantic.Assign)] + nuint UniqueNativeAdCount { get; } + + // @property (readonly, getter = isValid, assign, nonatomic) BOOL valid; + [Export ("valid")] + bool Valid { [Bind ("isValid")] get; } + + // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; + [NullAllowed] + [Export ("extraHint", ArgumentSemantic.Strong)] + AdExtraHint ExtraHint { get; set; } + + // -(instancetype)initWithPlacementID:(NSString *)placementID forNumAdsRequested:(NSUInteger)numAdsRequested; + [DesignatedInitializer] + [Export ("initWithPlacementID:forNumAdsRequested:")] + IntPtr Constructor (string placementId, nuint numAdsRequested); + + // -(void)loadAds; + [Export ("loadAds")] + void LoadAds (); + + // -(void)disableAutoRefresh; + [Export ("disableAutoRefresh")] + void DisableAutoRefresh (); + + // -(FBNativeAd *)nextNativeAd; + [Export ("nextNativeAd", ArgumentSemantic.Strong)] + [NullAllowed] + NativeAd NextNativeAd { get; } + } + + // @interface FBNativeAdTableViewAdProvider : NSObject + [DisableDefaultCtor] + [BaseType (typeof (NSObject), Name = "FBNativeAdTableViewAdProvider")] + interface NativeAdTableViewAdProvider { + // @property (nonatomic, weak) id delegate; + [NullAllowed] + [Export ("delegate", ArgumentSemantic.Weak)] + INativeAdDelegate Delegate { get; set; } + + // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; + [NullAllowed] + [Export ("extraHint", ArgumentSemantic.Strong)] + AdExtraHint ExtraHint { get; set; } + + // -(instancetype)initWithManager:(FBNativeAdsManager *)manager; + [DesignatedInitializer] + [Export ("initWithManager:")] + IntPtr Constructor (NativeAdsManager manager); + + // -(FBNativeAd *)tableView:(UITableView *)tableView nativeAdForRowAtIndexPath:(NSIndexPath *)indexPath; + [Export ("tableView:nativeAdForRowAtIndexPath:")] + NativeAd GetNativeAd (UITableView tableView, NSIndexPath indexPath); + + // -(BOOL)isAdCellAtIndexPath:(NSIndexPath *)indexPath forStride:(NSUInteger)stride; + [Export ("isAdCellAtIndexPath:forStride:")] + bool IsAdCell (NSIndexPath indexPath, nuint stride); + + // -(NSIndexPath *)adjustNonAdCellIndexPath:(NSIndexPath *)indexPath forStride:(NSUInteger)stride; + [return: NullAllowed] + [Export ("adjustNonAdCellIndexPath:forStride:")] + NSIndexPath AdjustNonAdCell (NSIndexPath indexPath, nuint stride); + + // -(NSUInteger)adjustCount:(NSUInteger)count forStride:(NSUInteger)stride; + [Export ("adjustCount:forStride:")] + nuint AdjustCount (nuint count, nuint stride); + } + + // @interface FBNativeAdTableViewCellProvider : FBNativeAdTableViewAdProvider + [DisableDefaultCtor] + [BaseType (typeof (NativeAdTableViewAdProvider), Name = "FBNativeAdTableViewCellProvider")] + interface NativeAdTableViewCellProvider : IUITableViewDataSource + { + + // -(instancetype)initWithManager:(FBNativeAdsManager *)manager forType:(FBNativeAdViewType)type; + [Export ("initWithManager:forType:")] + IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type); + + // -(instancetype)initWithManager:(FBNativeAdsManager *)manager forType:(FBNativeAdViewType)type forAttributes:(FBNativeAdViewAttributes *)attributes; + [DesignatedInitializer] + [Export ("initWithManager:forType:forAttributes:")] + IntPtr Constructor (NativeAdsManager manager, NativeAdViewType type, NativeAdViewAttributes attributes); + + // -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; + [Export ("tableView:cellForRowAtIndexPath:")] + new UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath); + + // -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath; + [Export ("tableView:heightForRowAtIndexPath:")] + nfloat GetHeight (UITableView tableView, NSIndexPath indexPath); + + // -(CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath; + [Export ("tableView:estimatedHeightForRowAtIndexPath:")] + nfloat GetEstimateHeight (UITableView tableView, NSIndexPath indexPath); + } + + // @interface FBNativeAdView : UIView + [DisableDefaultCtor] + [BaseType (typeof (NativeAdBaseView), Name = "FBNativeAdView")] + interface NativeAdView + { + // @property (readonly, assign, nonatomic) FBNativeAdViewType type; + [Export ("type", ArgumentSemantic.Assign)] + NativeAdViewType Type { get; } + + // +(instancetype _Nonnull)nativeAdViewWithNativeAd:(FBNativeAd * _Nonnull)nativeAd; + [Static] + [Export ("nativeAdViewWithNativeAd:")] + NativeAdView Create (NativeAd nativeAd); + + // +(instancetype _Nonnull)nativeAdViewWithNativeAd:(FBNativeAd * _Nonnull)nativeAd withAttributes:(FBNativeAdViewAttributes * _Nonnull)attributes; + [Static] + [Export ("nativeAdViewWithNativeAd:withAttributes:")] + NativeAdView Create (NativeAd nativeAd, NativeAdViewAttributes attributes); + + // +(instancetype)nativeAdViewWithNativeAd:(FBNativeAd *)nativeAd withType:(FBNativeAdViewType)type; + [Static] + [Export ("nativeAdViewWithNativeAd:withType:")] + NativeAdView Create (NativeAd nativeAd, NativeAdViewType type); + + [Obsolete ("Use the Create method instead. This will be removed in future versions.")] + [Static] + [Wrap ("Create (nativeAd, type)")] + NativeAdView From (NativeAd nativeAd, NativeAdViewType type); + + // +(instancetype)nativeAdViewWithNativeAd:(FBNativeAd *)nativeAd withType:(FBNativeAdViewType)type withAttributes:(FBNativeAdViewAttributes *)attributes; + [Static] + [Export ("nativeAdViewWithNativeAd:withType:withAttributes:")] + NativeAdView Create (NativeAd nativeAd, NativeAdViewType type, NativeAdViewAttributes attributes); + + [Obsolete ("Use the Create method instead. This will be removed in future versions.")] + [Static] + [Wrap ("Create (nativeAd, type, attributes)")] + NativeAdView From (NativeAd nativeAd, NativeAdViewType type, NativeAdViewAttributes attributes); + } + + // @interface FBNativeAdViewAttributes : NSObject + [BaseType (typeof (NSObject), Name = "FBNativeAdViewAttributes")] + interface NativeAdViewAttributes : INSCopying + { + // - (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *) dict; + [Export ("initWithDictionary:")] + [DesignatedInitializer] + IntPtr Constructor (NSDictionary dictionary); + + // @property (copy, nonatomic) UIColor * backgroundColor; + [NullAllowed] + [Export ("backgroundColor", ArgumentSemantic.Copy)] + UIColor BackgroundColor { get; set; } + + // @property (copy, nonatomic) UIColor * titleColor; + [NullAllowed] + [Export ("titleColor", ArgumentSemantic.Copy)] + UIColor TitleColor { get; set; } + + // @property (copy, nonatomic) UIColor * _Nullable advertiserNameColor; + [NullAllowed] + [Export ("advertiserNameColor", ArgumentSemantic.Copy)] + UIColor AdvertiserNameColor { get; set; } + + // @property (copy, nonatomic) UIColor * _Nullable adChoicesForegroundColor; + [NullAllowed] + [Export ("adChoicesForegroundColor", ArgumentSemantic.Copy)] + UIColor AdChoicesForegroundColor { get; set; } + + // @property (copy, nonatomic) UIFont * titleFont; + [NullAllowed] + [Export ("titleFont", ArgumentSemantic.Copy)] + UIFont TitleFont { get; set; } + + // @property (copy, nonatomic) UIColor * descriptionColor; + [NullAllowed] + [Export ("descriptionColor", ArgumentSemantic.Copy)] + UIColor DescriptionColor { get; set; } + + // @property (copy, nonatomic) UIFont * descriptionFont; + [NullAllowed] + [Export ("descriptionFont", ArgumentSemantic.Copy)] + UIFont DescriptionFont { get; set; } + + // @property (copy, nonatomic) UIColor * buttonColor; + [NullAllowed] + [Export ("buttonColor", ArgumentSemantic.Copy)] + UIColor ButtonColor { get; set; } + + // @property (copy, nonatomic) UIColor * buttonTitleColor; + [NullAllowed] + [Export ("buttonTitleColor", ArgumentSemantic.Copy)] + UIColor ButtonTitleColor { get; set; } + + // @property (copy, nonatomic) UIFont * buttonTitleFont; + [NullAllowed] + [Export ("buttonTitleFont", ArgumentSemantic.Copy)] + UIFont ButtonTitleFont { get; set; } + + // @property (copy, nonatomic) UIColor * buttonBorderColor; + [Export ("buttonBorderColor", ArgumentSemantic.Copy)] + UIColor ButtonBorderColor { get; set; } + + // @property (getter = isAutoplayEnabled, assign, nonatomic) BOOL autoplayEnabled __attribute__((deprecated("This attribute is no longer used."))); + [Obsolete ("This attribute is no longer used.")] + [Export ("autoplayEnabled")] + bool AutoplayEnabled { [Bind ("isAutoplayEnabled")] get; set; } + + //////////////////////////////////////////////////////////////////////// + // From @interface FBNativeAdView (FBNativeAdViewAttributes) Category // + //////////////////////////////////////////////////////////////////////// + + // +(instancetype)defaultAttributesForType:(FBNativeAdViewType)type; + [Static] + [Export ("defaultAttributesForType:")] + NativeAdViewAttributes DefaultAttributes (NativeAdViewType type); + } + + // @interface FBNativeBannerAd : FBNativeAdBase + [DisableDefaultCtor] + [BaseType (typeof (NativeAdBase), Name = "FBNativeBannerAd")] + interface NativeBannerAd { + // @property (nonatomic, weak) id _Nullable delegate; + [NullAllowed] + [Export ("delegate", ArgumentSemantic.Weak)] + INativeBannerAdDelegate Delegate { get; set; } + + // -(instancetype _Nonnull)initWithPlacementID:(NSString * _Nonnull)placementID; + [Export ("initWithPlacementID:")] + IntPtr Constructor (string placementId); + + // -(void)registerViewForInteraction:(UIView * _Nonnull)view iconView:(FBAdIconView * _Nonnull)iconView viewController:(UIViewController * _Nullable)viewController; + [Export ("registerViewForInteraction:iconView:viewController:")] + void RegisterView (UIView view, MediaView iconView, [NullAllowed] UIViewController viewController); + + // -(void)registerViewForInteraction:(UIView * _Nonnull)view iconView:(FBAdIconView * _Nonnull)iconView viewController:(UIViewController * _Nullable)viewController clickableViews:(NSArray * _Nullable)clickableViews; + [Export ("registerViewForInteraction:iconView:viewController:clickableViews:")] + void RegisterView (UIView view, MediaView iconView, [NullAllowed] UIViewController viewController, [NullAllowed] UIView [] clickableViews); + + // -(void)registerViewForInteraction:(UIView * _Nonnull)view iconImageView:(UIImageView * _Nonnull)iconImageView viewController:(UIViewController * _Nullable)viewController; + [Export("registerViewForInteraction:iconImageView:viewController:")] + void RegisterView (UIView view, UIImageView iconImageView, [NullAllowed] UIViewController viewController); + + // -(void)registerViewForInteraction:(UIView * _Nonnull)view iconImageView:(UIImageView * _Nonnull)iconImageView viewController:(UIViewController * _Nullable)viewController clickableViews:(NSArray * _Nullable)clickableViews; + [Export("registerViewForInteraction:iconImageView:viewController:clickableViews:")] + void RegisterView(UIView view, UIImageView iconImageView, [NullAllowed] UIViewController viewController, [NullAllowed] UIView[] clickableViews); + + // -(void)downloadMedia; + [Export ("downloadMedia")] + void DownloadMedia (); + } + + interface INativeBannerAdDelegate { } + + // @protocol FBNativeBannerAdDelegate + [Model (AutoGeneratedName = true)] + [Protocol] + [BaseType (typeof (NSObject), Name = "FBNativeBannerAdDelegate")] + interface NativeBannerAdDelegate { + // @optional -(void)nativeBannerAdDidLoad:(FBNativeBannerAd * _Nonnull)nativeBannerAd; + [Export ("nativeBannerAdDidLoad:")] + void NativeBannerAdDidLoad (NativeBannerAd nativeBannerAd); + + // @optional -(void)nativeBannerAdDidDownloadMedia:(FBNativeBannerAd * _Nonnull)nativeBannerAd; + [Export ("nativeBannerAdDidDownloadMedia:")] + void NativeBannerAdDidDownloadMedia (NativeBannerAd nativeBannerAd); + + // @optional -(void)nativeBannerAdWillLogImpression:(FBNativeBannerAd * _Nonnull)nativeBannerAd; + [Export ("nativeBannerAdWillLogImpression:")] + void NativeBannerAdWillLogImpression (NativeBannerAd nativeBannerAd); + + // @optional -(void)nativeBannerAd:(FBNativeBannerAd * _Nonnull)nativeBannerAd didFailWithError:(NSError * _Nonnull)error; + [Export ("nativeBannerAd:didFailWithError:")] + void NativeBannerAdDidFail (NativeBannerAd nativeBannerAd, NSError error); + + // @optional -(void)nativeBannerAdDidClick:(FBNativeBannerAd * _Nonnull)nativeBannerAd; + [Export ("nativeBannerAdDidClick:")] + void NativeBannerAdDidClick (NativeBannerAd nativeBannerAd); + + // @optional -(void)nativeBannerAdDidFinishHandlingClick:(FBNativeBannerAd * _Nonnull)nativeBannerAd; + [Export ("nativeBannerAdDidFinishHandlingClick:")] + void NativeBannerAdDidFinishHandlingClick (NativeBannerAd nativeBannerAd); + } + + // @interface FBNativeBannerAdView : FBNativeAdBaseView + [DisableDefaultCtor] + [BaseType (typeof (NativeAdBaseView), Name = "FBNativeBannerAdView")] + interface NativeBannerAdView { + // @property (readonly, assign, nonatomic) FBNativeBannerAdViewType type; + [Export ("type", ArgumentSemantic.Assign)] + NativeBannerAdViewType Type { get; } + + // +(instancetype _Nonnull)nativeBannerAdViewWithNativeBannerAd:(FBNativeBannerAd * _Nonnull)nativeBannerAd withType:(FBNativeBannerAdViewType)type; + [Static] + [Export ("nativeBannerAdViewWithNativeBannerAd:withType:")] + NativeBannerAdView Create (NativeBannerAd nativeBannerAd, NativeBannerAdViewType type); + + [Obsolete ("Use the Create method instead. This will be removed in future versions.")] + [Static] + [Wrap ("Create (nativeBannerAd, type)")] + NativeBannerAdView From (NativeBannerAd nativeBannerAd, NativeBannerAdViewType type); + + // +(instancetype _Nonnull)nativeBannerAdViewWithNativeBannerAd:(FBNativeBannerAd * _Nonnull)nativeBannerAd withType:(FBNativeBannerAdViewType)type withAttributes:(FBNativeAdViewAttributes * _Nonnull)attributes; + [Static] + [Export ("nativeBannerAdViewWithNativeBannerAd:withType:withAttributes:")] + NativeBannerAdView Create (NativeBannerAd nativeBannerAd, NativeBannerAdViewType type, NativeAdViewAttributes attributes); + + [Obsolete ("Use the Create method instead. This will be removed in future versions.")] + [Static] + [Wrap ("Create (nativeBannerAd, type, attributes)")] + NativeBannerAdView From (NativeBannerAd nativeBannerAd, NativeBannerAdViewType type, NativeAdViewAttributes attributes); + + ////////////////////////////////////////////////////////////////////////////// + // From @interface FBNativeBannerAdView (FBNativeAdViewAttributes) Category // + ////////////////////////////////////////////////////////////////////////////// + + // +(instancetype _Nonnull)defaultAttributesForBannerType:(FBNativeBannerAdViewType)type; + [Static] + [Export ("defaultAttributesForBannerType:")] + NativeAdViewAttributes Create (NativeBannerAdViewType type); + } + + // @interface FBRewardedVideoAd : NSObject + [DisableDefaultCtor] + [BaseType (typeof (NSObject), Name = "FBRewardedVideoAd")] + interface RewardedVideoAd + { + // @property (readonly, copy, nonatomic) NSString * _Nonnull placementID; + [Export ("placementID")] + string PlacementId { get; } + + // @property (readonly, assign, nonatomic) CMTime duration; + [Export ("duration", ArgumentSemantic.Assign)] + CMTime Duration { get; } + + // @property (nonatomic, weak) id _Nullable delegate; + [NullAllowed] + [Export ("delegate", ArgumentSemantic.Weak)] + IRewardedVideoAdDelegate Delegate { get; set; } + + // @property (readonly, getter = isAdValid, nonatomic) BOOL adValid; + [Export ("adValid")] + bool AdValid { [Bind ("isAdValid")] get; } + + // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; + [NullAllowed] + [Export ("extraHint", ArgumentSemantic.Strong)] + AdExtraHint ExtraHint { get; set; } + + // @property (copy, nonatomic) FBAdExperienceConfig * _Nullable adExperienceConfig; + [NullAllowed, Export ("adExperienceConfig", ArgumentSemantic.Copy)] + AdExperienceConfig AdExperienceConfig { get; set; } + + // -(instancetype _Nonnull)initWithPlacementID:(NSString * _Nonnull)placementID; + [Export ("initWithPlacementID:")] + IntPtr Constructor (string placementId); + + // -(instancetype _Nonnull)initWithPlacementID:(NSString * _Nonnull)placementID withUserID:(NSString * _Nullable)userID withCurrency:(NSString * _Nullable)currency; + [Export ("initWithPlacementID:withUserID:withCurrency:")] + IntPtr Constructor (string placementId, [NullAllowed] string userId, [NullAllowed] string currency); + + // -(void)loadAd; + [Export ("loadAd")] + void LoadAd (); + + // - (void) loadAdWithBidPayload:(NSString*) bidPayload; + [Export ("loadAdWithBidPayload:")] + void LoadAd (string bidPayload); + + // - (BOOL)setRewardDataWithUserID:(NSString *)userID withCurrency:(NSString*) currency; + [Export ("setRewardDataWithUserID:withCurrency:")] + bool SetRewardData (string userId, string currency); + + // -(BOOL)showAdFromRootViewController:(UIViewController * _Nonnull)rootViewController; + [Export ("showAdFromRootViewController:")] + bool ShowAd (UIViewController rootViewController); + + // -(BOOL)showAdFromRootViewController:(UIViewController * _Nonnull)rootViewController animated:(BOOL)flag; + [Export ("showAdFromRootViewController:animated:")] + bool ShowAd (UIViewController rootViewController, bool flag); + } + + interface IRewardedVideoAdDelegate { } + + // @protocol FBRewardedVideoAdDelegate + [Model (AutoGeneratedName = true)] + [Protocol] + [BaseType (typeof (NSObject), Name = "FBRewardedVideoAdDelegate")] + interface RewardedVideoAdDelegate + { + // @optional -(void)rewardedVideoAdDidClick:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; + [Export ("rewardedVideoAdDidClick:")] + void RewardedVideoAdDidClick (RewardedVideoAd rewardedVideoAd); + + // @optional -(void)rewardedVideoAdDidLoad:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; + [Export ("rewardedVideoAdDidLoad:")] + void RewardedVideoAdDidLoad (RewardedVideoAd rewardedVideoAd); + + // @optional -(void)rewardedVideoAdDidClose:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; + [Export ("rewardedVideoAdDidClose:")] + void RewardedVideoAdDidClose (RewardedVideoAd rewardedVideoAd); + + // @optional -(void)rewardedVideoAdWillClose:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; + [Export ("rewardedVideoAdWillClose:")] + void RewardedVideoAdWillClose (RewardedVideoAd rewardedVideoAd); + + // @optional -(void)rewardedVideoAd:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd didFailWithError:(NSError * _Nonnull)error; + [Export ("rewardedVideoAd:didFailWithError:")] + void RewardedVideoAdDidFail (RewardedVideoAd rewardedVideoAd, NSError error); + + // @optional -(void)rewardedVideoAdVideoComplete:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; + [Export ("rewardedVideoAdVideoComplete:")] + void RewardedVideoAdVideoComplete (RewardedVideoAd rewardedVideoAd); + + // @optional -(void)rewardedVideoAdWillLogImpression:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; + [Export ("rewardedVideoAdWillLogImpression:")] + void RewardedVideoAdWillLogImpression (RewardedVideoAd rewardedVideoAd); + + // @optional -(void)rewardedVideoAdServerSuccess:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; + [Export ("rewardedVideoAdServerRewardDidSucceed:")] + void RewardedVideoAdServerRewardDidSuccess (RewardedVideoAd rewardedVideoAd); + + // @optional -(void)rewardedVideoAdServerFailed:(FBRewardedVideoAd * _Nonnull)rewardedVideoAd; + [Export ("rewardedVideoAdServerRewardDidFail:")] + void RewardedVideoAdServerRewardDidFail (RewardedVideoAd rewardedVideoAd); + } + + // @interface FBNativeAdViewTag (UIView) + [Category] + [BaseType (typeof (UIView))] + interface UIView_NativeAdViewTag { + // @property (assign, nonatomic) FBNativeAdViewTag nativeAdViewTag; + [Export ("nativeAdViewTag")] + NativeAdViewTag GetNativeAdViewTag (); + + [Export ("setNativeAdViewTag:")] + void SetNativeAdViewTag (NativeAdViewTag nativeAdViewTag); + } +} diff --git a/Facebook.iOS/source/AudienceNetwork/AudienceNetwork.csproj b/Facebook.iOS/source/AudienceNetwork/AudienceNetwork.csproj new file mode 100644 index 00000000..600e291a --- /dev/null +++ b/Facebook.iOS/source/AudienceNetwork/AudienceNetwork.csproj @@ -0,0 +1,73 @@ + + + + Xamarin.iOS10 + true + Facebook.AudienceNetwork + Facebook.AudienceNetwork + 1.0.0.0 + 5.10.1 + Resources + true + true + + + + Xamarin.Facebook.AudienceNetwork.iOS + Facebook Audience Network SDK for Xamarin iOS + C# bindings for Facebook Audience Network's official SDK + C# bindings for Facebook Audience Network's official SDK + Microsoft + Microsoft + © Microsoft Corporation. All rights reserved. + https://go.microsoft.com/fwlink/?linkid=865579 + https://go.microsoft.com/fwlink/?linkid=865583 + true + 5.10.1 + + + + + + + + + + + + + + + + + FBAudienceNetwork.framework + + + + + + + Framework + True + AudioToolbox AVFoundation CoreGraphics CoreImage CoreMedia OpenGLES Security StoreKit UIKit Foundation CoreVideo QuartzCore + AdSupport CoreMotion SafariServices WebKit + -ObjC -lc++ -lxml2 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Facebook.iOS/source/AudienceNetwork/Enums.cs b/Facebook.iOS/source/AudienceNetwork/Enums.cs new file mode 100644 index 00000000..10d20a1c --- /dev/null +++ b/Facebook.iOS/source/AudienceNetwork/Enums.cs @@ -0,0 +1,303 @@ +// +// StructsAndEnums.cs: Bindings to the Facebook iOS SDK. +// +// Authors: +// Miguel de Icaza (miguel@xamarin.com) +// Alex Soto (alex.soto@xamarin.com) +// Israel Soto (israel.soto@xamarin.com) +// + +using ObjCRuntime; +using Foundation; +using System; + +namespace Facebook.AudienceNetwork +{ + public enum AdExtraHintKeyword { + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordAccessories; + [Field ("FBAdExtraHintKeywordAccessories", "__Internal")] + Accessories, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordArtHistory; + [Field ("FBAdExtraHintKeywordArtHistory", "__Internal")] + ArtHistory, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordAutomotive; + [Field ("FBAdExtraHintKeywordAutomotive", "__Internal")] + Automotive, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBeauty; + [Field ("FBAdExtraHintKeywordBeauty", "__Internal")] + Beauty, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBiology; + [Field ("FBAdExtraHintKeywordBiology", "__Internal")] + Biology, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBoardGames; + [Field ("FBAdExtraHintKeywordBoardGames", "__Internal")] + BoardGames, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBusinessSoftware; + [Field ("FBAdExtraHintKeywordBusinessSoftware", "__Internal")] + BusinessSoftware, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordBuyingSellingHomes; + [Field ("FBAdExtraHintKeywordBuyingSellingHomes", "__Internal")] + BuyingSellingHomes, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordCats; + [Field ("FBAdExtraHintKeywordCats", "__Internal")] + Cats, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordCelebrities; + [Field ("FBAdExtraHintKeywordCelebrities", "__Internal")] + Celebrities, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordClothing; + [Field ("FBAdExtraHintKeywordClothing", "__Internal")] + Clothing, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordComicBooks; + [Field ("FBAdExtraHintKeywordComicBooks", "__Internal")] + ComicBooks, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordDesktopVideo; + [Field ("FBAdExtraHintKeywordDesktopVideo", "__Internal")] + DesktopVideo, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordDogs; + [Field ("FBAdExtraHintKeywordDogs", "__Internal")] + Dogs, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordEducation; + [Field ("FBAdExtraHintKeywordEducation", "__Internal")] + Education, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordEmail; + [Field ("FBAdExtraHintKeywordEmail", "__Internal")] + Email, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordEntertainment; + [Field ("FBAdExtraHintKeywordEntertainment", "__Internal")] + Entertainment, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFamilyParenting; + [Field ("FBAdExtraHintKeywordFamilyParenting", "__Internal")] + FamilyParenting, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFashion; + [Field ("FBAdExtraHintKeywordFashion", "__Internal")] + Fashion, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFineArt; + [Field ("FBAdExtraHintKeywordFineArt", "__Internal")] + FineArt, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFoodDrink; + [Field ("FBAdExtraHintKeywordFoodDrink", "__Internal")] + FoodDrink, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordFrenchCuisine; + [Field ("FBAdExtraHintKeywordFrenchCuisine", "__Internal")] + FrenchCuisine, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordGovernment; + [Field ("FBAdExtraHintKeywordGovernment", "__Internal")] + Government, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHealthFitness; + [Field ("FBAdExtraHintKeywordHealthFitness", "__Internal")] + HealthFitness, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHobbies; + [Field ("FBAdExtraHintKeywordHobbies", "__Internal")] + Hobbies, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHomeGarden; + [Field ("FBAdExtraHintKeywordHomeGarden", "__Internal")] + HomeGarden, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordHumor; + [Field ("FBAdExtraHintKeywordHumor", "__Internal")] + Humor, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordInternetTechnology; + [Field ("FBAdExtraHintKeywordInternetTechnology", "__Internal")] + InternetTechnology, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLargeAnimals; + [Field ("FBAdExtraHintKeywordLargeAnimals", "__Internal")] + LargeAnimals, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLaw; + [Field ("FBAdExtraHintKeywordLaw", "__Internal")] + Law, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLegalIssues; + [Field ("FBAdExtraHintKeywordLegalIssues", "__Internal")] + LegalIssues, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordLiterature; + [Field ("FBAdExtraHintKeywordLiterature", "__Internal")] + Literature, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordMarketing; + [Field ("FBAdExtraHintKeywordMarketing", "__Internal")] + Marketing, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordMovies; + [Field ("FBAdExtraHintKeywordMovies", "__Internal")] + Movies, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordMusic; + [Field ("FBAdExtraHintKeywordMusic", "__Internal")] + Music, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordNews; + [Field ("FBAdExtraHintKeywordNews", "__Internal")] + News, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPersonalFinance; + [Field ("FBAdExtraHintKeywordPersonalFinance", "__Internal")] + PersonalFinance, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPets; + [Field ("FBAdExtraHintKeywordPets", "__Internal")] + Pets, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPhotography; + [Field ("FBAdExtraHintKeywordPhotography", "__Internal")] + Photography, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordPolitics; + [Field ("FBAdExtraHintKeywordPolitics", "__Internal")] + Politics, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordRealEstate; + [Field ("FBAdExtraHintKeywordRealEstate", "__Internal")] + RealEstate, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordRoleplayingGames; + [Field ("FBAdExtraHintKeywordRoleplayingGames", "__Internal")] + RoleplayingGames, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordScience; + [Field ("FBAdExtraHintKeywordScience", "__Internal")] + Science, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordShopping; + [Field ("FBAdExtraHintKeywordShopping", "__Internal")] + Shopping, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordSociety; + [Field ("FBAdExtraHintKeywordSociety", "__Internal")] + Society, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordSports; + [Field ("FBAdExtraHintKeywordSports", "__Internal")] + Sports, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordTechnology; + [Field ("FBAdExtraHintKeywordTechnology", "__Internal")] + Technology, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordTelevision; + [Field ("FBAdExtraHintKeywordTelevision", "__Internal")] + Television, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordTravel; + [Field ("FBAdExtraHintKeywordTravel", "__Internal")] + Travel, + + // extern const FBAdExtraHintKeyword _Nonnull FBAdExtraHintKeywordVideoComputerGames; + [Field ("FBAdExtraHintKeywordVideoComputerGames", "__Internal")] + VideoComputerGames + } + + [Native] + public enum AdLogLevel : long + { + None, + Notification, + Error, + Warning, + Log, + Debug, + Verbose + } + + [Native] + public enum AdTestAdType : long + { + Default, + Img16x9AppInstall, + Img16x9Link, + VidHD16x9_46sAppInstall, + VidHD16x9_46sLink, + VidHD16x9_15sAppInstall, + VidHD16x9_15sLink, + VidHD9x16_39sAppInstall, + VidHD9x16_39sLink, + CarouselImgSquareAppInstall, + CarouselImgSquareLink, + CarouselVidSquareLink, + Playable + + } + + [Native] + public enum AdFormatTypeName : long { + Unknown = 0, + Banner, + Interstitial, + Native, + NativeBanner, + RewardedVideo + } + + [Native] + public enum AdFormatType : long { + Unknown = 0, + Image, + Video, + Carousel + } + + [Native] + public enum NativeAdsCachePolicy : long + { + None, + All + } + + [Native] + public enum NativeAdViewType : long + { + GenericHeight300 = 3, + GenericHeight400 = 4, + Dynamic = 6 + } + + [Native] + public enum NativeBannerAdViewType : long + { + GenericHeight100 = 1, + GenericHeight120 = 2, + GenericHeight50 = 5 + } + + [Native] + public enum NativeAdViewTag : ulong + { + Icon = 5, + Title, + CoverImage, + Subtitle, + Body, + CallToAction, + SocialContext, + ChoicesIcon, + Media + } +} diff --git a/Facebook.iOS/source/AudienceNetwork/License.md b/Facebook.iOS/source/AudienceNetwork/License.md new file mode 100644 index 00000000..5197f9c7 --- /dev/null +++ b/Facebook.iOS/source/AudienceNetwork/License.md @@ -0,0 +1,15 @@ +### Xamarin Component for Facebook Audience Network iOS SDK + +**The MIT License (MIT)** + +Copyright (c) .NET Foundation Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +20160923 + + diff --git a/Facebook.iOS/source/AudienceNetwork/Structs.cs b/Facebook.iOS/source/AudienceNetwork/Structs.cs new file mode 100644 index 00000000..321eb5d7 --- /dev/null +++ b/Facebook.iOS/source/AudienceNetwork/Structs.cs @@ -0,0 +1,28 @@ +using System; +using System.Runtime.InteropServices; + +using CoreGraphics; + +namespace Facebook.AudienceNetwork { + [StructLayout (LayoutKind.Sequential)] + public struct AdSize { + public CGSize Size; + + public AdSize (CGSize size) + { + Size = size; + } + } + + [StructLayout (LayoutKind.Sequential)] + public struct AdStarRating { + public nfloat Value; + public nint Scale; + + public AdStarRating (nfloat value, nint scale) + { + Value = value; + Scale = scale; + } + } +} diff --git a/Facebook.iOS/source/AudienceNetwork/extensions.cs b/Facebook.iOS/source/AudienceNetwork/extensions.cs new file mode 100644 index 00000000..7dfe96d5 --- /dev/null +++ b/Facebook.iOS/source/AudienceNetwork/extensions.cs @@ -0,0 +1,120 @@ +// +// extensions.cs: Convenience methods. +// +// Authors: +// Alex Soto (alex.soto@xamarin.com) +// Israel Soto (israel.soto@xamarin.com) +// + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +using Foundation; +using ObjCRuntime; +using UIKit; + +namespace Facebook.AudienceNetwork +{ + [Preserve (AllMembers = true)] + public static partial class AdSizes + { + static AdSize? size320x50; + + [Obsolete] + public static AdSize Size320x50 { + get { + if (size320x50 != null) + return size320x50.Value; + + IntPtr RTLD_MAIN_ONLY = Dlfcn.dlopen (null, 0); + IntPtr ptr = Dlfcn.dlsym (RTLD_MAIN_ONLY, "kFBAdSize320x50"); + size320x50 = (AdSize)Marshal.PtrToStructure (ptr, typeof (AdSize)); + Dlfcn.dlclose (RTLD_MAIN_ONLY); + + return size320x50.Value; + } + } + + static AdSize? bannerHeight50; + + public static AdSize BannerHeight50 { + get { + if (bannerHeight50 != null) + return bannerHeight50.Value; + + IntPtr RTLD_MAIN_ONLY = Dlfcn.dlopen (null, 0); + IntPtr ptr = Dlfcn.dlsym (RTLD_MAIN_ONLY, "kFBAdSizeHeight50Banner"); + bannerHeight50 = (AdSize)Marshal.PtrToStructure (ptr, typeof (AdSize)); + Dlfcn.dlclose (RTLD_MAIN_ONLY); + + return bannerHeight50.Value; + } + } + + static AdSize? bannerHeight90; + + public static AdSize BannerHeight90 { + get { + if (bannerHeight90 != null) + return bannerHeight90.Value; + + IntPtr RTLD_MAIN_ONLY = Dlfcn.dlopen (null, 0); + IntPtr ptr = Dlfcn.dlsym (RTLD_MAIN_ONLY, "kFBAdSizeHeight90Banner"); + bannerHeight90 = (AdSize)Marshal.PtrToStructure (ptr, typeof (AdSize)); + Dlfcn.dlclose (RTLD_MAIN_ONLY); + + return bannerHeight90.Value; + } + } + + static AdSize? interstitial; + + public static AdSize Interstitial { + get { + if (interstitial != null) + return interstitial.Value; + + IntPtr RTLD_MAIN_ONLY = Dlfcn.dlopen (null, 0); + IntPtr ptr = Dlfcn.dlsym (RTLD_MAIN_ONLY, "kFBAdSizeInterstitial"); + interstitial = (AdSize)Marshal.PtrToStructure (ptr, typeof (AdSize)); + Dlfcn.dlclose (RTLD_MAIN_ONLY); + + return interstitial.Value; + } + } + + static AdSize? interstital; + + [Obsolete ("Use Interstitial instead.")] + public static AdSize Interstital { + get { + if (interstital != null) + return interstital.Value; + + IntPtr RTLD_MAIN_ONLY = Dlfcn.dlopen (null, 0); + IntPtr ptr = Dlfcn.dlsym (RTLD_MAIN_ONLY, "kFBAdSizeInterstitial"); + interstital = (AdSize)Marshal.PtrToStructure (ptr, typeof (AdSize)); + Dlfcn.dlclose (RTLD_MAIN_ONLY); + + return interstital.Value; + } + } + + static AdSize? rectangleHeight250; + + public static AdSize RectangleHeight250 { + get { + if (rectangleHeight250 != null) + return rectangleHeight250.Value; + + IntPtr RTLD_MAIN_ONLY = Dlfcn.dlopen (null, 0); + IntPtr ptr = Dlfcn.dlsym (RTLD_MAIN_ONLY, "kFBAdSizeHeight250Rectangle"); + rectangleHeight250 = (AdSize)Marshal.PtrToStructure (ptr, typeof (AdSize)); + Dlfcn.dlclose (RTLD_MAIN_ONLY); + + return rectangleHeight250.Value; + } + } + } +} \ No newline at end of file diff --git a/Facebook.iOS/source/Sources.sln b/Facebook.iOS/source/Sources.sln index 219841d0..cab3e861 100644 --- a/Facebook.iOS/source/Sources.sln +++ b/Facebook.iOS/source/Sources.sln @@ -1,6 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AudienceNetwork", "AudienceNetwork\AudienceNetwork.csproj", "{54FF3FE1-B984-4642-8131-16A4E8335A0D}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreKit", "CoreKit\CoreKit.csproj", "{5B88D7C7-6E76-4D0D-8DBE-B3F0A5D6B8A0}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FacebookSdks", "FacebookSdks\FacebookSdks.csproj", "{B8A416D8-45F1-4CD5-9469-5436304E3CBA}" @@ -17,6 +19,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {54FF3FE1-B984-4642-8131-16A4E8335A0D}.Release|Any CPU.Build.0 = Release|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Debug|Any CPU.Build.0 = Debug|Any CPU {8C6EFD7E-1512-4976-8E47-CF189BF6CB90}.Release|Any CPU.ActiveCfg = Release|Any CPU From da1b2e8bec6d6d224f9ea9d9ed836ff4a3028525 Mon Sep 17 00:00:00 2001 From: Alex Soto Date: Thu, 4 Mar 2021 11:41:28 -0500 Subject: [PATCH 4/4] [Facebook.iOS] Update FBAudienceNetwork to v6.3.0 --- Facebook.iOS/components.cake | 4 +- .../samples/FacebookiOSSample/Info.plist | 2 +- Facebook.iOS/samples/HelloFacebook/Info.plist | 2 +- .../source/AudienceNetwork/ApiDefinition.cs | 109 +++++------------- .../AudienceNetwork/AudienceNetwork.csproj | 4 +- 5 files changed, 35 insertions(+), 86 deletions(-) diff --git a/Facebook.iOS/components.cake b/Facebook.iOS/components.cake index 2e589d3e..869b2756 100644 --- a/Facebook.iOS/components.cake +++ b/Facebook.iOS/components.cake @@ -6,7 +6,7 @@ var FACEBOOK_SDKS_VERSION = FACEBOOK_SDK_VERSION; var LOGIN_KIT_VERSION = FACEBOOK_SDK_VERSION; var SHARE_KIT_VERSION = FACEBOOK_SDK_VERSION; var GAMINGSERVICES_KIT_VERSION = FACEBOOK_SDK_VERSION; -var AUDIENCE_NETWORK_VERSION = "5.10.1"; +var AUDIENCE_NETWORK_VERSION = "6.3.0"; var CORE_KIT_NUGET_VERSION = NUGET_VERSION; var FACEBOOK_SDKS_NUGET_VERSION = NUGET_VERSION; @@ -20,7 +20,7 @@ Artifact FACEBOOK_SDKS_ARTIFACT = new Artifact ("FacebookSdks", FACEBO Artifact LOGIN_KIT_ARTIFACT = new Artifact ("LoginKit", LOGIN_KIT_NUGET_VERSION, "9.0"); Artifact SHARE_KIT_ARTIFACT = new Artifact ("ShareKit", SHARE_KIT_NUGET_VERSION, "9.0"); Artifact GAMINGSERVICES_KIT_ARTIFACT = new Artifact ("GamingServicesKit", GAMINGSERVICES_KIT_NUGET_VERSION, "9.0"); -Artifact AUDIENCE_NETWORK_ARTIFACT = new Artifact ("AudienceNetwork", AUDIENCE_NETWORK_VERSION, "9.0"); +Artifact AUDIENCE_NETWORK_ARTIFACT = new Artifact ("AudienceNetwork", AUDIENCE_NETWORK_VERSION, "9.0"); var ARTIFACTS = new Dictionary { { "AudienceNetwork", AUDIENCE_NETWORK_ARTIFACT }, diff --git a/Facebook.iOS/samples/FacebookiOSSample/Info.plist b/Facebook.iOS/samples/FacebookiOSSample/Info.plist index a10ea55f..5c9bcbd8 100644 --- a/Facebook.iOS/samples/FacebookiOSSample/Info.plist +++ b/Facebook.iOS/samples/FacebookiOSSample/Info.plist @@ -13,7 +13,7 @@ LSRequiresIPhoneOS MinimumOSVersion - 8.0 + 9.0 UIDeviceFamily 1 diff --git a/Facebook.iOS/samples/HelloFacebook/Info.plist b/Facebook.iOS/samples/HelloFacebook/Info.plist index 6166a4b3..c1e2850a 100644 --- a/Facebook.iOS/samples/HelloFacebook/Info.plist +++ b/Facebook.iOS/samples/HelloFacebook/Info.plist @@ -13,7 +13,7 @@ LSRequiresIPhoneOS MinimumOSVersion - 8.0 + 9.0 UIDeviceFamily 1 diff --git a/Facebook.iOS/source/AudienceNetwork/ApiDefinition.cs b/Facebook.iOS/source/AudienceNetwork/ApiDefinition.cs index e130b3ad..318dda3e 100644 --- a/Facebook.iOS/source/AudienceNetwork/ApiDefinition.cs +++ b/Facebook.iOS/source/AudienceNetwork/ApiDefinition.cs @@ -573,6 +573,10 @@ interface AdSettings { [Export ("routingToken")] string RoutingToken { get; } + [Static] + [Export ("setAdvertiserTrackingEnabled:")] + void SetAdvertiserTrackingEnabled (bool advertiserTrackingEnabled); + [Static] [Export ("isTestMode")] bool IsTestMode { get; } @@ -780,87 +784,9 @@ interface AudienceNetworkAds { [Export ("initializeWithSettings:completionHandler:")] void Initialize ([NullAllowed] AdInitSettings settings, [NullAllowed] Action completionHandler); - // +(FBAdFormatTypeName)adFormatTypeNameForPlacementId:(NSString * _Nonnull)placementId; [Static] - [Export ("adFormatTypeNameForPlacementId:")] - AdFormatTypeName GetAdFormatTypeName (string placementId); - } - - // @interface FBInstreamAdView : UIView - [DisableDefaultCtor] - [BaseType (typeof (UIView), Name = "FBInstreamAdView")] - interface InstreamAdView { - // @property (readonly, getter = isAdValid, nonatomic) BOOL adValid; - [Export ("adValid")] - bool IsAdValid { [Bind ("isAdValid")] get; } - - // @property (nonatomic, weak) id _Nullable delegate; - [NullAllowed] - [Export ("delegate", ArgumentSemantic.Weak)] - IInstreamAdViewDelegate Delegate { get; set; } - - // @property (readonly, copy, nonatomic) NSString * _Nonnull placementID; - [NullAllowed] - [Export ("placementID")] - string PlacementId { get; } - - // @property (nonatomic, strong) FBAdExtraHint * _Nullable extraHint; - [NullAllowed] - [Export ("extraHint", ArgumentSemantic.Strong)] - AdExtraHint ExtraHint { get; set; } - - // -(instancetype _Nullable)initWithPlacementID:(NSString * _Nonnull)placementID __attribute__((objc_designated_initializer)); - [Obsolete("Instream ads have been deprecated. Initialiser will return nil.")] - [DesignatedInitializer] - [Export ("initWithPlacementID:")] - IntPtr Constructor (string placementId); - - // -(void)loadAd; - [Obsolete("Instream ads have been deprecated. Initialiser will return nil.")] - [PostGet ("IsAdValid")] - [Export ("loadAd")] - void LoadAd (); - - // - (void) loadAdWithBidPayload:(NSString*) bidPayload; - [Obsolete("Instream ads have been deprecated. Initialiser will return nil.")] - [Export ("loadAdWithBidPayload:")] - void LoadAd (string bidPayload); - - // -(BOOL)showAdFromRootViewController:(UIViewController * _Nullable)rootViewController; - [Obsolete("Instream ads have been deprecated. Initialiser will return nil.")] - [Export ("showAdFromRootViewController:")] - bool ShowAd ([NullAllowed] UIViewController rootViewController); - } - - interface IInstreamAdViewDelegate { } - - // @protocol FBInstreamAdViewDelegate - [Model (AutoGeneratedName = true)] - [Protocol] - [BaseType (typeof (NSObject), Name = "FBInstreamAdViewDelegate")] - interface InstreamAdViewDelegate { - // @required -(void)adViewDidLoad:(FBInstreamAdView * _Nonnull)adView; - [Abstract] - [Export ("adViewDidLoad:")] - void AdViewDidLoad ([NullAllowed] InstreamAdView adView); - - // @required -(void)adViewDidEnd:(FBInstreamAdView * _Nonnull)adView; - [Abstract] - [Export ("adViewDidEnd:")] - void AdViewDidEnd ([NullAllowed] InstreamAdView adView); - - // @required -(void)adView:(FBInstreamAdView * _Nonnull)adView didFailWithError:(NSError * _Nonnull)error; - [Abstract] - [Export ("adView:didFailWithError:")] - void AdViewDidFail ([NullAllowed] InstreamAdView adView, [NullAllowed] NSError error); - - // @optional -(void)adViewDidClick:(FBInstreamAdView * _Nonnull)adView; - [Export ("adViewDidClick:")] - void AdViewDidClick ([NullAllowed] InstreamAdView adView); - - // @optional -(void)adViewWillLogImpression:(FBInstreamAdView * _Nonnull)adView; - [Export ("adViewWillLogImpression:")] - void AdViewWillLogImpression ([NullAllowed] InstreamAdView adView); + [Export ("handleDeeplink:")] + void HandleDeeplink (NSUrl deeplink); } [DisableDefaultCtor] @@ -1872,4 +1798,27 @@ interface UIView_NativeAdViewTag { [Export ("setNativeAdViewTag:")] void SetNativeAdViewTag (NativeAdViewTag nativeAdViewTag); } + + interface IAdSdkNotificationListener { } + + [Protocol (Name = "FBAdSDKNotificationListener")] + interface AdSdkNotificationListener { + + [Abstract] + [Export ("onFBAdEvent:eventData:")] + void OnFBAdEvent (string @event, NSDictionary eventData); + } + + [BaseType (typeof (NSObject), Name = "FBAdSDKNotificationManager")] + interface AdSdkNotificationManager { + + [Static] + [Export ("addFBAdSDKNotificationListener:")] + void Add (IAdSdkNotificationListener notificationListener); + + [Static] + [Export ("removeFBAdSDKNotificationListener:")] + void Remove (IAdSdkNotificationListener notificationListener); + } + } diff --git a/Facebook.iOS/source/AudienceNetwork/AudienceNetwork.csproj b/Facebook.iOS/source/AudienceNetwork/AudienceNetwork.csproj index 600e291a..90633e12 100644 --- a/Facebook.iOS/source/AudienceNetwork/AudienceNetwork.csproj +++ b/Facebook.iOS/source/AudienceNetwork/AudienceNetwork.csproj @@ -6,7 +6,7 @@ Facebook.AudienceNetwork Facebook.AudienceNetwork 1.0.0.0 - 5.10.1 + 6.3.0 Resources true true @@ -23,7 +23,7 @@ https://go.microsoft.com/fwlink/?linkid=865579 https://go.microsoft.com/fwlink/?linkid=865583 true - 5.10.1 + 6.3.0