From d778c60b54109b762ce0ed23e2666ba30d1bcd8b Mon Sep 17 00:00:00 2001 From: Redth Date: Thu, 16 Oct 2014 16:21:02 -0700 Subject: [PATCH] Xamarin.iOS Unified API Support --- component/component.yaml | 10 +- ...sAzure.Mobile.Managed - IncludeXamarin.sln | 26 +++ .../MobileServiceUIAuthentication.cs | 10 +- .../MobileServiceClientExtensions.cs | 4 + ...WindowsAzure.Mobile.Ext.iOS-Classic.csproj | 187 ++++++++++++++++++ ...crosoft.WindowsAzure.Mobile.Ext.iOS.csproj | 31 ++- .../Platform/ApplicationStorage.cs | 4 + .../Platform/PlatformInformation.cs | 4 + ...rosoft.WindowsAzure.Mobile.iOS.Test.csproj | 4 +- 9 files changed, 257 insertions(+), 23 deletions(-) mode change 100644 => 100755 sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Extensions/MobileServiceClientExtensions.cs create mode 100644 sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Microsoft.WindowsAzure.Mobile.Ext.iOS-Classic.csproj mode change 100644 => 100755 sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Platform/ApplicationStorage.cs mode change 100644 => 100755 sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Platform/PlatformInformation.cs diff --git a/component/component.yaml b/component/component.yaml index 4aba2c7fd..b76cd1136 100644 --- a/component/component.yaml +++ b/component/component.yaml @@ -12,6 +12,12 @@ icons: - azure-mobile-services_128x128.png libraries: ios: + - ..\..\bin\Signed\Release\Managed\iOS-Classic\Microsoft.WindowsAzure.Mobile.dll + - ..\..\bin\Signed\Release\Managed\iOS-Classic\Microsoft.WindowsAzure.Mobile.Ext.dll + - ..\..\bin\Signed\Release\Managed\iOS-Classic\Newtonsoft.Json.dll + - ..\..\bin\Signed\Release\Managed\iOS-Classic\System.Net.Http.Extensions.dll + - ..\..\bin\Signed\Release\Managed\iOS-Classic\System.Net.Http.Primitives.dll + ios-unified: - ..\..\bin\Signed\Release\Managed\iOS\Microsoft.WindowsAzure.Mobile.dll - ..\..\bin\Signed\Release\Managed\iOS\Microsoft.WindowsAzure.Mobile.Ext.dll - ..\..\bin\Signed\Release\Managed\iOS\Newtonsoft.Json.dll @@ -29,7 +35,9 @@ libraries: samples: - name: Android Sample path: samples\androidsample\androidsample.sln - - name: iOS Sample + - name: iOS Classic API Sample + path: samples\iOSsample-Classic\iOSsample-Classic.sln + - name: iOS Unified API Sample path: samples\iOSsample\iOSsample.sln screenshots: - screenshots/WAMS-New.PNG diff --git a/sdk/Managed/Microsoft.WindowsAzure.Mobile.Managed - IncludeXamarin.sln b/sdk/Managed/Microsoft.WindowsAzure.Mobile.Managed - IncludeXamarin.sln index 6f6bfce58..206050a40 100644 --- a/sdk/Managed/Microsoft.WindowsAzure.Mobile.Managed - IncludeXamarin.sln +++ b/sdk/Managed/Microsoft.WindowsAzure.Mobile.Managed - IncludeXamarin.sln @@ -49,6 +49,7 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.WindowsAzure.Mobile.WP81.Test", "test\Microsoft.WindowsAzure.MobileServices.WindowsPhone81.Test\Microsoft.WindowsAzure.Mobile.WP81.Test.csproj", "{92CD4A69-950A-45FE-B8EA-774BA69E7482}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.WindowsAzure.Mobile.Test.Unit", "test\Microsoft.WindowsAzure.MobileServices.Test.Unit\Microsoft.WindowsAzure.Mobile.Test.Unit.csproj", "{574B5567-FF51-4B0F-A9ED-CC9F711E9156}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.WindowsAzure.Mobile.Ext.iOS-Classic", "src\Microsoft.WindowsAzure.MobileServices.iOS\Microsoft.WindowsAzure.Mobile.Ext.iOS-Classic.csproj", "{9D2109B6-F005-4419-B9DB-8FA2A4514D28}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -562,6 +563,30 @@ Global {574B5567-FF51-4B0F-A9ED-CC9F711E9156}.Signed|Mixed Platforms.Build.0 = Release|Any CPU {574B5567-FF51-4B0F-A9ED-CC9F711E9156}.Signed|x64.ActiveCfg = Release|Any CPU {574B5567-FF51-4B0F-A9ED-CC9F711E9156}.Signed|x86.ActiveCfg = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Debug|ARM.ActiveCfg = Debug|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Debug|ARM.Build.0 = Debug|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Debug|x64.ActiveCfg = Debug|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Debug|x86.ActiveCfg = Debug|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Release|Any CPU.Build.0 = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Release|ARM.ActiveCfg = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Release|ARM.Build.0 = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Release|x64.ActiveCfg = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Release|x86.ActiveCfg = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Signed|Any CPU.ActiveCfg = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Signed|Any CPU.Build.0 = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Signed|ARM.ActiveCfg = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Signed|ARM.Build.0 = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Signed|Mixed Platforms.ActiveCfg = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Signed|Mixed Platforms.Build.0 = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Signed|x64.ActiveCfg = Release|Any CPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28}.Signed|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -585,5 +610,6 @@ Global {02EEF75A-D824-4203-B243-C1B97B0D35A9} = {BA83494B-A52F-4CC8-B2BE-E339376AD2D5} {92CD4A69-950A-45FE-B8EA-774BA69E7482} = {45E57CDC-7178-4915-8D0B-CF80F5E44AF6} {574B5567-FF51-4B0F-A9ED-CC9F711E9156} = {45E57CDC-7178-4915-8D0B-CF80F5E44AF6} + {9D2109B6-F005-4419-B9DB-8FA2A4514D28} = {BA83494B-A52F-4CC8-B2BE-E339376AD2D5} EndGlobalSection EndGlobal diff --git a/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Authentication/MobileServiceUIAuthentication.cs b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Authentication/MobileServiceUIAuthentication.cs index 14193e37f..c0a460972 100644 --- a/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Authentication/MobileServiceUIAuthentication.cs +++ b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Authentication/MobileServiceUIAuthentication.cs @@ -2,9 +2,15 @@ using System.Collections.Generic; using System.Drawing; using System.Threading.Tasks; +using Xamarin.Auth._MobileServices; +#if __UNIFIED__ +using Foundation; +using UIKit; +using NSAction = System.Action; +#else using MonoTouch.Foundation; using MonoTouch.UIKit; -using Xamarin.Auth._MobileServices; +#endif namespace Microsoft.WindowsAzure.MobileServices { @@ -90,4 +96,4 @@ protected override Task LoginAsyncOverride() return tcs.Task; } } -} \ No newline at end of file +} diff --git a/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Extensions/MobileServiceClientExtensions.cs b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Extensions/MobileServiceClientExtensions.cs old mode 100644 new mode 100755 index 50dd9a81e..9c1dbd3ca --- a/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Extensions/MobileServiceClientExtensions.cs +++ b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Extensions/MobileServiceClientExtensions.cs @@ -1,7 +1,11 @@ using System.Collections.Generic; using System.Drawing; using System.Threading.Tasks; +#if __UNIFIED__ +using UIKit; +#else using MonoTouch.UIKit; +#endif namespace Microsoft.WindowsAzure.MobileServices { diff --git a/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Microsoft.WindowsAzure.Mobile.Ext.iOS-Classic.csproj b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Microsoft.WindowsAzure.Mobile.Ext.iOS-Classic.csproj new file mode 100644 index 000000000..931ec61f4 --- /dev/null +++ b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Microsoft.WindowsAzure.Mobile.Ext.iOS-Classic.csproj @@ -0,0 +1,187 @@ + + + + + + Debug + AnyCPU + {9D2109B6-F005-4419-B9DB-8FA2A4514D28} + {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Microsoft.WindowsAzure.MobileServices + Resources + Microsoft.WindowsAzure.Mobile.Ext + ..\..\ + true + + + true + full + false + bin\classic\Debug + obj\classic\Debug + DEBUG;__IOS__;__MOBILE__;PLATFORM_IOS;XAMARIN_AUTH_INTERNAL + prompt + 4 + false + true + iPhone Developer + + + pdbonly + true + bin\classic\Release + obj\classic\Release + prompt + 4 + false + iPhone Developer + bin\iPhone\Release\Microsoft.WindowsAzure.Mobile.Ext.xml + __IOS__;__MOBILE__;PLATFORM_IOS;XAMARIN_AUTH_INTERNAL + true + + + + ExpressionUtility\PartialEvaluator.cs + + + ExpressionUtility\VisitorHelper.cs + + + Platform\ExpressionUtility.cs + + + Auth\iOS\ACAccountWrapper.cs + + + Auth\iOS\FormAuthenticatorController.cs + + + Auth\iOS\KeyChainAccountStore.cs + + + Auth\iOS\ProgressLabel.cs + + + Auth\iOS\UIViewControllerEx.cs + + + Auth\iOS\WebAuthenticatorController.cs + + + ExpressionUtility\ExpressionVisitor.cs + + + Auth\Account.cs + + + Auth\AccountStore.cs + + + Auth\Authenticator.cs + + + Auth\AuthException.cs + + + Auth\ExceptionEx.cs + + + Auth\FormAuthenticator.cs + + + Auth\OAuth1.cs + + + Auth\OAuth1Authenticator.cs + + + Auth\OAuth1Request.cs + + + Auth\OAuth2Authenticator.cs + + + Auth\OAuth2Request.cs + + + Auth\Request.cs + + + Auth\Response.cs + + + Auth\Json\JavaScriptReader.cs + + + Auth\Json\JsonArray.cs + + + Auth\Json\JsonObject.cs + + + Auth\Json\JsonPrimitive.cs + + + Auth\Json\JsonType.cs + + + Auth\Json\JsonValue.cs + + + Auth\WebAuthenticator.cs + + + Auth\WebEx.cs + + + Auth\WebRedirectAuthenticator.cs + + + Auth\WebUtilities.cs + + + + + + + + + + + + + + + + + + + + ..\..\packages\Newtonsoft.Json.6.0.4\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll + + + ..\..\packages\Microsoft.Net.Http.2.2.28\lib\monotouch\System.Net.Http.Extensions.dll + + + ..\..\packages\Microsoft.Net.Http.2.2.28\lib\monotouch\System.Net.Http.Primitives.dll + + + + + {75557793-E36E-4190-8714-5BD2665859FB} + Microsoft.WindowsAzure.Mobile + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Microsoft.WindowsAzure.Mobile.Ext.iOS.csproj b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Microsoft.WindowsAzure.Mobile.Ext.iOS.csproj index 0544a1e89..39e584e7a 100644 --- a/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Microsoft.WindowsAzure.Mobile.Ext.iOS.csproj +++ b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Microsoft.WindowsAzure.Mobile.Ext.iOS.csproj @@ -5,10 +5,8 @@ Debug AnyCPU - 8.0.30703 - 2.0 {A871B137-83A8-4E9B-913D-30EE0288E161} - {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Library Microsoft.WindowsAzure.MobileServices Resources @@ -21,7 +19,7 @@ full false bin\iPhone\Debug - DEBUG;__IOS__;__MOBILE__;PLATFORM_IOS;XAMARIN_AUTH_INTERNAL + DEBUG;__IOS__;__MOBILE__;PLATFORM_IOS;XAMARIN_AUTH_INTERNAL;__UNIFIED__ prompt 4 false @@ -37,7 +35,7 @@ false iPhone Developer bin\iPhone\Release\Microsoft.WindowsAzure.Mobile.Ext.xml - __IOS__;__MOBILE__;PLATFORM_IOS;XAMARIN_AUTH_INTERNAL + __IOS__;__MOBILE__;PLATFORM_IOS;XAMARIN_AUTH_INTERNAL;__UNIFIED__ true @@ -152,27 +150,24 @@ - - False - ..\..\packages\Newtonsoft.Json.6.0.4\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll - - - False + + + + + ..\..\packages\Newtonsoft.Json.6.0.4\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll + + ..\..\packages\Microsoft.Net.Http.2.2.28\lib\monotouch\System.Net.Http.Extensions.dll - - False + ..\..\packages\Microsoft.Net.Http.2.2.28\lib\monotouch\System.Net.Http.Primitives.dll - - - - {75557793-e36e-4190-8714-5bd2665859fb} + {75557793-E36E-4190-8714-5BD2665859FB} Microsoft.WindowsAzure.Mobile @@ -181,7 +176,7 @@ - + diff --git a/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Platform/ApplicationStorage.cs b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Platform/ApplicationStorage.cs old mode 100644 new mode 100755 index d63902d58..afa5e7a49 --- a/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Platform/ApplicationStorage.cs +++ b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Platform/ApplicationStorage.cs @@ -1,6 +1,10 @@ using System; +#if __UNIFIED__ +using Foundation; +#else using MonoTouch.Foundation; +#endif namespace Microsoft.WindowsAzure.MobileServices { diff --git a/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Platform/PlatformInformation.cs b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Platform/PlatformInformation.cs old mode 100644 new mode 100755 index 7c5c80d2e..1aafb2c9b --- a/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Platform/PlatformInformation.cs +++ b/sdk/Managed/src/Microsoft.WindowsAzure.MobileServices.iOS/Platform/PlatformInformation.cs @@ -2,7 +2,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; +#if __UNIFIED__ +using UIKit; +#else using MonoTouch.UIKit; +#endif namespace Microsoft.WindowsAzure.MobileServices { diff --git a/sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.iOS.Test/Microsoft.WindowsAzure.Mobile.iOS.Test.csproj b/sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.iOS.Test/Microsoft.WindowsAzure.Mobile.iOS.Test.csproj index e63e04f27..9278737e2 100644 --- a/sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.iOS.Test/Microsoft.WindowsAzure.Mobile.iOS.Test.csproj +++ b/sdk/Managed/test/Microsoft.WindowsAzure.MobileServices.iOS.Test/Microsoft.WindowsAzure.Mobile.iOS.Test.csproj @@ -135,9 +135,9 @@ - + {a871b137-83a8-4e9b-913d-30ee0288e161} - Microsoft.WindowsAzure.Mobile.Ext.iOS + Microsoft.WindowsAzure.Mobile.Ext.iOS-Classic {75557793-e36e-4190-8714-5bd2665859fb}