diff --git a/.gitignore b/.gitignore index 223b188..867dd28 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,7 @@ **/Components # Support v4 dll -**/Xamarin.Android.Support.v4.dll \ No newline at end of file +**/Xamarin.Android.Support.v4.dll + +# Visual Studio +**/.vs \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e8a71dc..e577138 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 1.5.2 + +##### Fixed +- Fixed an issue that caused C# bindings to not be generated for certain classes in the Braze UI library. + +##### Changed +- Updated the Android binding to use Braze SDK version 2.5.0. +- Updated the Android sample app to use Firebase Cloud Messaging (FCM). + ## 1.5.1 ##### Changed diff --git a/appboy-component/lib/android/AppboyPlatform.AndroidBinding.dll b/appboy-component/lib/android/AppboyPlatform.AndroidBinding.dll index 6ca473e..eb6e065 100644 Binary files a/appboy-component/lib/android/AppboyPlatform.AndroidBinding.dll and b/appboy-component/lib/android/AppboyPlatform.AndroidBinding.dll differ diff --git a/appboy-component/lib/android/AppboyPlatform.AndroidBinding.pdb b/appboy-component/lib/android/AppboyPlatform.AndroidBinding.pdb index b51b824..bbb8b96 100644 Binary files a/appboy-component/lib/android/AppboyPlatform.AndroidBinding.pdb and b/appboy-component/lib/android/AppboyPlatform.AndroidBinding.pdb differ diff --git a/appboy-component/nuget/AppboyPlatform.AndroidBinding.nuspec b/appboy-component/nuget/AppboyPlatform.AndroidBinding.nuspec index e4af7d0..3b25677 100644 --- a/appboy-component/nuget/AppboyPlatform.AndroidBinding.nuspec +++ b/appboy-component/nuget/AppboyPlatform.AndroidBinding.nuspec @@ -2,7 +2,7 @@ AppboyPlatform.AndroidBinding - 1.5.1 + 1.5.2 Braze, Inc. Braze, Inc. https://github.com/Appboy/appboy-xamarin-bindings/blob/master/LICENSE @@ -14,7 +14,7 @@ Copyright 2018 Braze Appboy - + diff --git a/appboy-component/samples/android/TestApp.XamarinAndroid/MainActivity.cs b/appboy-component/samples/android/TestApp.XamarinAndroid/MainActivity.cs index 904d083..83fba96 100644 --- a/appboy-component/samples/android/TestApp.XamarinAndroid/MainActivity.cs +++ b/appboy-component/samples/android/TestApp.XamarinAndroid/MainActivity.cs @@ -1,9 +1,13 @@ using System; +using Android.Gms.Common; using Android.Support.V4.App; - using Android.OS; +using Firebase.Messaging; +using Firebase.Iid; +using Android.Util; + namespace com.appboy.xamarinsample { [Android.App.Activity (Label = "TestApp.XamarinAndroid", MainLauncher = true, Icon = "@drawable/icon")] diff --git a/appboy-component/samples/android/TestApp.XamarinAndroid/MainApplication.cs b/appboy-component/samples/android/TestApp.XamarinAndroid/MainApplication.cs index 4041806..5eede1d 100644 --- a/appboy-component/samples/android/TestApp.XamarinAndroid/MainApplication.cs +++ b/appboy-component/samples/android/TestApp.XamarinAndroid/MainApplication.cs @@ -1,10 +1,14 @@ using System; +using System.Threading.Tasks; + using Android.App; using Android.Runtime; using Com.Appboy; using Com.Appboy.Support; +using Firebase.Iid; + namespace com.appboy.xamarinsample { [Application] @@ -14,10 +18,22 @@ public MainApplication (IntPtr handle, JniHandleOwnership transfer) : base (hand { } - public override void OnCreate () + public override void OnCreate() { AppboyLogger.LogLevel = 2; - RegisterActivityLifecycleCallbacks (new AppboyLifecycleCallbackListener ()); + RegisterActivityLifecycleCallbacks(new AppboyLifecycleCallbackListener()); + + new Task(RegisterFirebasePush).Start(); + } + + void RegisterFirebasePush() { + try { + var token = FirebaseInstanceId.Instance.GetToken("901477453852", "FCM"); + Appboy.GetInstance(this).RegisterAppboyPushMessages (token); + Console.WriteLine("Registered Firebase push token with Braze: " + token); + } catch (Exception e) { + Console.WriteLine("Caught exception registering for Firebase push: " + e); + } } } } \ No newline at end of file diff --git a/appboy-component/samples/android/TestApp.XamarinAndroid/Properties/AndroidManifest.xml b/appboy-component/samples/android/TestApp.XamarinAndroid/Properties/AndroidManifest.xml index faad573..cd7cebd 100644 --- a/appboy-component/samples/android/TestApp.XamarinAndroid/Properties/AndroidManifest.xml +++ b/appboy-component/samples/android/TestApp.XamarinAndroid/Properties/AndroidManifest.xml @@ -3,11 +3,6 @@ - - - - - diff --git a/appboy-component/samples/android/TestApp.XamarinAndroid/Resources/values/Appboy.xml b/appboy-component/samples/android/TestApp.XamarinAndroid/Resources/values/Appboy.xml index 0787127..b1c5c49 100644 --- a/appboy-component/samples/android/TestApp.XamarinAndroid/Resources/values/Appboy.xml +++ b/appboy-component/samples/android/TestApp.XamarinAndroid/Resources/values/Appboy.xml @@ -18,14 +18,7 @@ 10 - - - true - true - - - 901477453852 + true diff --git a/appboy-component/samples/android/TestApp.XamarinAndroid/TestApp.XamarinAndroid.csproj b/appboy-component/samples/android/TestApp.XamarinAndroid/TestApp.XamarinAndroid.csproj index 1b0130b..c190406 100644 --- a/appboy-component/samples/android/TestApp.XamarinAndroid/TestApp.XamarinAndroid.csproj +++ b/appboy-component/samples/android/TestApp.XamarinAndroid/TestApp.XamarinAndroid.csproj @@ -1,5 +1,6 @@ + Debug AnyCPU @@ -15,7 +16,7 @@ True TestApp.XamarinAndroid Properties\AndroidManifest.xml - v8.0 + v8.1 true @@ -43,35 +44,50 @@ + + ..\packages\Xamarin.GooglePlayServices.Basement.60.1142.1\lib\MonoAndroid80\Xamarin.GooglePlayServices.Basement.dll + + + ..\packages\Xamarin.GooglePlayServices.Tasks.60.1142.1\lib\MonoAndroid80\Xamarin.GooglePlayServices.Tasks.dll + + + ..\packages\Xamarin.Firebase.Common.60.1142.1\lib\MonoAndroid80\Xamarin.Firebase.Common.dll + + + ..\packages\Xamarin.Firebase.Iid.60.1142.1\lib\MonoAndroid80\Xamarin.Firebase.Iid.dll + + + ..\packages\Xamarin.Firebase.Messaging.60.1142.1\lib\MonoAndroid80\Xamarin.Firebase.Messaging.dll + - ..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Annotations.dll + ..\packages\Xamarin.Android.Support.Annotations.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Annotations.dll - ..\packages\Xamarin.Android.Arch.Core.Common.1.0.0\lib\MonoAndroid80\Xamarin.Android.Arch.Core.Common.dll + ..\packages\Xamarin.Android.Arch.Core.Common.1.0.0.1\lib\MonoAndroid80\Xamarin.Android.Arch.Core.Common.dll - ..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.1\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.dll + ..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.3.1\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.dll - ..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.0\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.dll + ..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.3.1\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.dll - ..\packages\Xamarin.Android.Support.Compat.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Compat.dll + ..\packages\Xamarin.Android.Support.Compat.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Compat.dll - ..\packages\Xamarin.Android.Support.Core.UI.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Core.UI.dll + ..\packages\Xamarin.Android.Support.Core.UI.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Core.UI.dll - ..\packages\Xamarin.Android.Support.Core.Utils.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Core.Utils.dll + ..\packages\Xamarin.Android.Support.Core.Utils.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Core.Utils.dll - ..\packages\Xamarin.Android.Support.Fragment.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Fragment.dll + ..\packages\Xamarin.Android.Support.Fragment.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Fragment.dll - ..\packages\Xamarin.Android.Support.Media.Compat.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Media.Compat.dll + ..\packages\Xamarin.Android.Support.Media.Compat.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Media.Compat.dll - ..\packages\Xamarin.Android.Support.v4.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.v4.dll + ..\packages\Xamarin.Android.Support.v4.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.v4.dll @@ -102,15 +118,24 @@ AppboyPlatform.XamarinAndroidBinding + + + - - - - - - - - - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/appboy-component/samples/android/TestApp.XamarinAndroid/google-services.json b/appboy-component/samples/android/TestApp.XamarinAndroid/google-services.json new file mode 100644 index 0000000..96f0ff3 --- /dev/null +++ b/appboy-component/samples/android/TestApp.XamarinAndroid/google-services.json @@ -0,0 +1,42 @@ +{ + "project_info": { + "project_number": "249138691334", + "firebase_url": "https://xamarin-sample-6bc0e.firebaseio.com", + "project_id": "xamarin-sample-6bc0e", + "storage_bucket": "xamarin-sample-6bc0e.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:249138691334:android:eae375f3198ba359", + "android_client_info": { + "package_name": "com.appboy.xamarinsample" + } + }, + "oauth_client": [ + { + "client_id": "249138691334-ppq1edljurcnthkahdbrf7nh202o1e3d.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAIlkXO_NEJ7BqbMDq-j91OSTJTa2Kg96Q" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 1, + "other_platform_oauth_client": [] + }, + "ads_service": { + "status": 2 + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/appboy-component/samples/android/TestApp.XamarinAndroid/packages.config b/appboy-component/samples/android/TestApp.XamarinAndroid/packages.config index c437b23..6665a9b 100644 --- a/appboy-component/samples/android/TestApp.XamarinAndroid/packages.config +++ b/appboy-component/samples/android/TestApp.XamarinAndroid/packages.config @@ -1,13 +1,19 @@  - - - - - - - - - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/appboy-component/src/android/AppboyPlatform.XamarinAndroidBinding.csproj b/appboy-component/src/android/AppboyPlatform.XamarinAndroidBinding.csproj index 1eee6e2..b3a446c 100644 --- a/appboy-component/src/android/AppboyPlatform.XamarinAndroidBinding.csproj +++ b/appboy-component/src/android/AppboyPlatform.XamarinAndroidBinding.csproj @@ -1,5 +1,4 @@ - - + Debug AnyCPU @@ -41,34 +40,34 @@ - packages\Xamarin.Android.Support.Annotations.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Annotations.dll + packages\Xamarin.Android.Support.Annotations.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Annotations.dll - packages\Xamarin.Android.Arch.Core.Common.1.0.0\lib\MonoAndroid80\Xamarin.Android.Arch.Core.Common.dll + packages\Xamarin.Android.Arch.Core.Common.1.0.0.1\lib\MonoAndroid80\Xamarin.Android.Arch.Core.Common.dll - packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.1\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.dll + packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.3.1\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.dll - packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.0\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.dll + packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.3.1\lib\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.dll - packages\Xamarin.Android.Support.Compat.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Compat.dll + packages\Xamarin.Android.Support.Compat.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Compat.dll - packages\Xamarin.Android.Support.Core.UI.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Core.UI.dll + packages\Xamarin.Android.Support.Core.UI.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Core.UI.dll - packages\Xamarin.Android.Support.Core.Utils.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Core.Utils.dll + packages\Xamarin.Android.Support.Core.Utils.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Core.Utils.dll - packages\Xamarin.Android.Support.Fragment.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Fragment.dll + packages\Xamarin.Android.Support.Fragment.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Fragment.dll - packages\Xamarin.Android.Support.Media.Compat.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.Media.Compat.dll + packages\Xamarin.Android.Support.Media.Compat.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.Media.Compat.dll - packages\Xamarin.Android.Support.v4.26.1.0.1\lib\MonoAndroid80\Xamarin.Android.Support.v4.dll + packages\Xamarin.Android.Support.v4.27.0.2.1\lib\MonoAndroid81\Xamarin.Android.Support.v4.dll @@ -85,10 +84,10 @@ - + - + @@ -103,14 +102,14 @@ - - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/appboy-component/src/android/Jars/android-sdk-ui-release.aar b/appboy-component/src/android/Jars/android-sdk-ui-release.aar index a24c05e..9d71d0a 100644 Binary files a/appboy-component/src/android/Jars/android-sdk-ui-release.aar and b/appboy-component/src/android/Jars/android-sdk-ui-release.aar differ diff --git a/appboy-component/src/android/Jars/classes.jar b/appboy-component/src/android/Jars/classes.jar index 2b223f5..5b8e54a 100644 Binary files a/appboy-component/src/android/Jars/classes.jar and b/appboy-component/src/android/Jars/classes.jar differ diff --git a/appboy-component/src/android/packages.config b/appboy-component/src/android/packages.config index c437b23..0d90d97 100644 --- a/appboy-component/src/android/packages.config +++ b/appboy-component/src/android/packages.config @@ -1,13 +1,13 @@  - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/appboy-component/src/ios-unified/Appboy_iOS_SDK.framework/Headers/AppboyFeedback.h b/appboy-component/src/ios-unified/Appboy_iOS_SDK.framework/Headers/AppboyFeedback.h new file mode 100644 index 0000000..cb3d23b --- /dev/null +++ b/appboy-component/src/ios-unified/Appboy_iOS_SDK.framework/Headers/AppboyFeedback.h @@ -0,0 +1,5 @@ +#import "ABKFeedbackViewController.h" +#import "ABKModalFeedbackViewController.h" +#import "ABKNavigationFeedbackViewController.h" + +#import "ABKUIUtils.h" diff --git a/appboy-component/src/ios-unified/Appboy_iOS_SDK.framework/Headers/AppboyInAppMessage.h b/appboy-component/src/ios-unified/Appboy_iOS_SDK.framework/Headers/AppboyInAppMessage.h new file mode 100644 index 0000000..d2b6ee3 --- /dev/null +++ b/appboy-component/src/ios-unified/Appboy_iOS_SDK.framework/Headers/AppboyInAppMessage.h @@ -0,0 +1,16 @@ +#import "ABKInAppMessageUIButton.h" +#import "ABKInAppMessageUIController.h" +#import "ABKInAppMessageUIDelegate.h" +#import "ABKInAppMessageView.h" +#import "ABKInAppMessageWindow.h" +#import "ABKInAppMessageFullViewController.h" +#import "ABKInAppMessageHTMLFullViewController.h" +#import "ABKInAppMessageHTMLViewController.h" +#import "ABKInAppMessageImmersiveViewController.h" +#import "ABKInAppMessageModalViewController.h" +#import "ABKInAppMessageSlideupViewController.h" +#import "ABKInAppMessageViewController.h" +#import "ABKInAppMessageWindowController.h" + +#import "ABKUIURLUtils.h" +#import "ABKUIUtils.h" diff --git a/appboy-component/src/ios-unified/SDWebImage.framework/Headers/NSButton+WebCache.h b/appboy-component/src/ios-unified/SDWebImage.framework/Headers/NSButton+WebCache.h new file mode 100644 index 0000000..57f7115 --- /dev/null +++ b/appboy-component/src/ios-unified/SDWebImage.framework/Headers/NSButton+WebCache.h @@ -0,0 +1,259 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" + +#if SD_MAC + +#import "SDWebImageManager.h" + +@interface NSButton (WebCache) + +#pragma mark - Image + +/** + * Get the current image URL. + */ +- (nullable NSURL *)sd_currentImageURL; + +/** + * Set the button `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; + +/** + * Set the button `image` with an `url` and a placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @see sd_setImageWithURL:placeholderImage:options: + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; + +/** + * Set the button `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; + +/** + * Set the button `image` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + completed:(nullable SDExternalCompletionBlock)completedBlock; + +/** + * Set the button `image` with an `url`, placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; + +/** + * Set the button `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + completed:(nullable SDExternalCompletionBlock)completedBlock; + +/** + * Set the button `image` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the image. + * @param placeholder The image to be set initially, until the image request finishes. + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. + * @param progressBlock A block called while image is downloading + * @note the progress block is executed on a background queue + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the image parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the image was retrieved from the local cache or from the network. + * The fourth parameter is the original image url. + */ +- (void)sd_setImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDExternalCompletionBlock)completedBlock; + +#pragma mark - Alternate Image + +/** + * Get the current alternateImage URL. + */ +- (nullable NSURL *)sd_currentAlternateImageURL; + +/** + * Set the button `alternateImage` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the alternateImage. + */ +- (void)sd_setAlternateImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; + +/** + * Set the button `alternateImage` with an `url` and a placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the alternateImage. + * @param placeholder The alternateImage to be set initially, until the alternateImage request finishes. + * @see sd_setAlternateImageWithURL:placeholderImage:options: + */ +- (void)sd_setAlternateImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; + +/** + * Set the button `alternateImage` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the alternateImage. + * @param placeholder The alternateImage to be set initially, until the alternateImage request finishes. + * @param options The options to use when downloading the alternateImage. @see SDWebImageOptions for the possible values. + */ +- (void)sd_setAlternateImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; + +/** + * Set the button `alternateImage` with an `url`. + * + * The download is asynchronous and cached. + * + * @param url The url for the alternateImage. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the alternateImage parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the alternateImage was retrieved from the local cache or from the network. + * The fourth parameter is the original alternateImage url. + */ +- (void)sd_setAlternateImageWithURL:(nullable NSURL *)url + completed:(nullable SDExternalCompletionBlock)completedBlock; + +/** + * Set the button `alternateImage` with an `url`, placeholder. + * + * The download is asynchronous and cached. + * + * @param url The url for the alternateImage. + * @param placeholder The alternateImage to be set initially, until the alternateImage request finishes. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the alternateImage parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the alternateImage was retrieved from the local cache or from the network. + * The fourth parameter is the original alternateImage url. + */ +- (void)sd_setAlternateImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; + +/** + * Set the button `alternateImage` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the alternateImage. + * @param placeholder The alternateImage to be set initially, until the alternateImage request finishes. + * @param options The options to use when downloading the alternateImage. @see SDWebImageOptions for the possible values. + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the alternateImage parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the alternateImage was retrieved from the local cache or from the network. + * The fourth parameter is the original alternateImage url. + */ +- (void)sd_setAlternateImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + completed:(nullable SDExternalCompletionBlock)completedBlock; + +/** + * Set the button `alternateImage` with an `url`, placeholder and custom options. + * + * The download is asynchronous and cached. + * + * @param url The url for the alternateImage. + * @param placeholder The alternateImage to be set initially, until the alternateImage request finishes. + * @param options The options to use when downloading the alternateImage. @see SDWebImageOptions for the possible values. + * @param progressBlock A block called while alternateImage is downloading + * @note the progress block is executed on a background queue + * @param completedBlock A block called when operation has been completed. This block has no return value + * and takes the requested UIImage as first parameter. In case of error the alternateImage parameter + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean + * indicating if the alternateImage was retrieved from the local cache or from the network. + * The fourth parameter is the original alternateImage url. + */ +- (void)sd_setAlternateImageWithURL:(nullable NSURL *)url + placeholderImage:(nullable UIImage *)placeholder + options:(SDWebImageOptions)options + progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock + completed:(nullable SDExternalCompletionBlock)completedBlock; + +#pragma mark - Cancel + +/** + * Cancel the current image download + */ +- (void)sd_cancelCurrentImageLoad; + +/** + * Cancel the current alternateImage download + */ +- (void)sd_cancelCurrentAlternateImageLoad; + +@end + +#endif diff --git a/appboy-component/src/ios-unified/SDWebImage.framework/Headers/SDAnimatedImageRep.h b/appboy-component/src/ios-unified/SDWebImage.framework/Headers/SDAnimatedImageRep.h new file mode 100644 index 0000000..c794c4b --- /dev/null +++ b/appboy-component/src/ios-unified/SDWebImage.framework/Headers/SDAnimatedImageRep.h @@ -0,0 +1,20 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" + +#if SD_MAC + +// A subclass of `NSBitmapImageRep` to fix that GIF loop count issue because `NSBitmapImageRep` will reset `NSImageCurrentFrameDuration` by using `kCGImagePropertyGIFDelayTime` but not `kCGImagePropertyGIFUnclampedDelayTime`. +// Built in GIF coder use this instead of `NSBitmapImageRep` for better GIF rendering. If you do not want this, only enable `SDWebImageImageIOCoder`, which just call `NSImage` API and actually use `NSBitmapImageRep` for GIF image. + +@interface SDAnimatedImageRep : NSBitmapImageRep + +@end + +#endif diff --git a/appboy-component/src/ios-unified/SDWebImage.framework/Headers/SDWebImageTransition.h b/appboy-component/src/ios-unified/SDWebImage.framework/Headers/SDWebImageTransition.h new file mode 100644 index 0000000..0192594 --- /dev/null +++ b/appboy-component/src/ios-unified/SDWebImage.framework/Headers/SDWebImageTransition.h @@ -0,0 +1,98 @@ +/* + * This file is part of the SDWebImage package. + * (c) Olivier Poitrey + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#import "SDWebImageCompat.h" + +#if SD_UIKIT || SD_MAC +#import "SDImageCache.h" + +// This class is used to provide a transition animation after the view category load image finished. Use this on `sd_imageTransition` in UIView+WebCache.h +// for UIKit(iOS & tvOS), we use `+[UIView transitionWithView:duration:options:animations:completion]` for transition animation. +// for AppKit(macOS), we use `+[NSAnimationContext runAnimationGroup:completionHandler:]` for transition animation. You can call `+[NSAnimationContext currentContext]` to grab the context during animations block. +// These transition are provided for basic usage. If you need complicated animation, consider to directly use Core Animation or use `SDWebImageAvoidAutoSetImage` and implement your own after image load finished. + +#if SD_UIKIT +typedef UIViewAnimationOptions SDWebImageAnimationOptions; +#else +typedef NS_OPTIONS(NSUInteger, SDWebImageAnimationOptions) { + SDWebImageAnimationOptionAllowsImplicitAnimation = 1 << 0, // specify `allowsImplicitAnimation` for the `NSAnimationContext` +}; +#endif + +typedef void (^SDWebImageTransitionPreparesBlock)(__kindof UIView * _Nonnull view, UIImage * _Nullable image, NSData * _Nullable imageData, SDImageCacheType cacheType, NSURL * _Nullable imageURL); +typedef void (^SDWebImageTransitionAnimationsBlock)(__kindof UIView * _Nonnull view, UIImage * _Nullable image); +typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished); + +@interface SDWebImageTransition : NSObject + +/** + By default, we set the image to the view at the beginning of the animtions. You can disable this and provide custom set image process + */ +@property (nonatomic, assign) BOOL avoidAutoSetImage; +/** + The duration of the transition animation, measured in seconds. Defaults to 0.5. + */ +@property (nonatomic, assign) NSTimeInterval duration; +/** + The timing function used for all animations within this transition animation (macOS). + */ +@property (nonatomic, strong, nullable) CAMediaTimingFunction *timingFunction NS_AVAILABLE_MAC(10_7); +/** + A mask of options indicating how you want to perform the animations. + */ +@property (nonatomic, assign) SDWebImageAnimationOptions animationOptions; +/** + A block object to be executed before the animation sequence starts. + */ +@property (nonatomic, copy, nullable) SDWebImageTransitionPreparesBlock prepares; +/** + A block object that contains the changes you want to make to the specified view. + */ +@property (nonatomic, copy, nullable) SDWebImageTransitionAnimationsBlock animations; +/** + A block object to be executed when the animation sequence ends. + */ +@property (nonatomic, copy, nullable) SDWebImageTransitionCompletionBlock completion; + +@end + +// Convenience way to create transition. Remember to specify the duration if needed. +// for UIKit, these transition just use the correspond `animationOptions` +// for AppKit, these transition use Core Animation in `animations`. So your view must be layer-backed. Set `wantsLayer = YES` before you apply it. + +@interface SDWebImageTransition (Conveniences) + +// class property is available in Xcode 8. We will drop the Xcode 7.3 support in 5.x +#if __has_feature(objc_class_property) +/// Fade transition. +@property (nonatomic, class, nonnull, readonly) SDWebImageTransition *fadeTransition; +/// Flip from left transition. +@property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromLeftTransition; +/// Flip from right transition. +@property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromRightTransition; +/// Flip from top transition. +@property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromTopTransition; +/// Flip from bottom transition. +@property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromBottomTransition; +/// Curl up transition. +@property (nonatomic, class, nonnull, readonly) SDWebImageTransition *curlUpTransition; +/// Curl down transition. +@property (nonatomic, class, nonnull, readonly) SDWebImageTransition *curlDownTransition; +#else ++ (nonnull instancetype)fadeTransition; ++ (nonnull instancetype)flipFromLeftTransition; ++ (nonnull instancetype)flipFromRightTransition; ++ (nonnull instancetype)flipFromTopTransition; ++ (nonnull instancetype)flipFromBottomTransition; ++ (nonnull instancetype)curlUpTransition; ++ (nonnull instancetype)curlDownTransition; +#endif + +@end + +#endif