Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #185 from Microsoft/develop
Browse files Browse the repository at this point in the history
0.10.0 merge
  • Loading branch information
Gilles Khouzam authored Jun 20, 2016
2 parents 90793da + 844cace commit a847a5b
Show file tree
Hide file tree
Showing 136 changed files with 3,752 additions and 17,397 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
*.opensdf
*.sdf
*.suo
*.VC.db
*.vs
AppPackages
bin
Debug
Doxygen
fbwinsdk.githash.txt
*.githash.txt
Generated
Generated Files
ipch
packages
Packages.dgml
Release
sdk-build.log

project.lock.json
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
The Windows SDK for Facebook is licensed under the following terms:

The MIT License (MIT)

Copyright (c) 2015 Microsoft
Expand All @@ -19,3 +21,25 @@ 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.

--------------------------------------------------------------------------------
The Facebook SDK App Events code is licensed under the following terms:

Copyright(c) 2016, Facebook, Inc. All rights reserved.

You are hereby granted a non-exclusive, worldwide, royalty-free license to
use, copy, modify, and distribute this software in source code or binary form
for use in connection with the web services and APIs provided by Facebook.

As with any software that integrates with the Facebook platform, your use of
this software is subject to the Facebook Developer Principles and Policies
[http://developers.facebook.com/policy/]. This copyright 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.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ The Windows SDK for Facebook is geared towards app developers creating modern wi
- Upload Photo
- Like a Page/Object

###AppInstalls
- Mobile App Installs (can be disabled by defining \_\_NOFBAPPEVENTS__)


## **Supported Platforms**

Windows 8.1+
Windows Phone 8.1+
Windows 10 Technical Preview
Windows 10

## **Documentation**

Expand Down
28 changes: 28 additions & 0 deletions samples/LoginCpp-UWP/LoginCpp/App.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ void App::OnLaunched(LaunchActivatedEventArgs^ e)

// Place the frame in the current Window
Window::Current->Content = rootFrame;

SystemNavigationManager::GetForCurrentView()->BackRequested += ref new Windows::Foundation::EventHandler<Windows::UI::Core::BackRequestedEventArgs ^>(this, &LoginCpp::App::OnBackRequested);
rootFrame->Navigated += ref new Windows::UI::Xaml::Navigation::NavigatedEventHandler(this, &LoginCpp::App::OnNavigated);
}

if (rootFrame->Content == nullptr)
Expand Down Expand Up @@ -241,3 +244,28 @@ void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e)

// TODO: Save application state and stop any background activity
}


void LoginCpp::App::OnBackRequested(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs ^args)
{
Frame^ rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
if (rootFrame->CanGoBack)
{
args->Handled = true;
rootFrame->GoBack();
}
}

void LoginCpp::App::OnNavigated(Platform::Object^ sender, Windows::UI::Xaml::Navigation::NavigationEventArgs^ args)
{

Frame^ rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
if (rootFrame->CanGoBack)
{
SystemNavigationManager::GetForCurrentView()->AppViewBackButtonVisibility = AppViewBackButtonVisibility::Visible;
}
else
{
SystemNavigationManager::GetForCurrentView()->AppViewBackButtonVisibility = AppViewBackButtonVisibility::Collapsed;
}
}
4 changes: 3 additions & 1 deletion samples/LoginCpp-UWP/LoginCpp/App.xaml.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,7 @@ namespace LoginCpp
#endif

void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
};
void OnBackRequested(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs ^args);
void OnNavigated(Platform::Object^ sender, Windows::UI::Xaml::Navigation::NavigationEventArgs^ args);
};
}
11 changes: 5 additions & 6 deletions samples/LoginCpp-UWP/LoginCpp/Dialogs.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@
<TextBlock Text="Show Dialogs" Margin="0,-6.5,0,26.5" Style="{ThemeResource HeaderTextBlockStyle}" CharacterSpacing="{ThemeResource PivotHeaderItemCharacterSpacing}"/>
</StackPanel>

<!--TODO: Content should be placed within the following grid-->
<Grid Grid.Row="1" x:Name="ContentRoot" Margin="19,9.5,19,0">
<Button Content="Feed" HorizontalAlignment="Left" Height="73" VerticalAlignment="Top" Width="362" Margin="0,-10,0,0" Click="Feed_Click"/>
<Button Content="App Requests" HorizontalAlignment="Left" Height="73" VerticalAlignment="Top" Width="362" Margin="0,49,0,0" Click="AppRequests_Click"/>

</Grid>
<StackPanel Grid.Row="1" x:Name="ContentRoot" Margin="19,9.5,19,0">
<Button Content="Feed Dialog" Width="{Binding ActualWidth, ElementName=ContentRoot}" HorizontalAlignment="Left" Height="73" VerticalAlignment="Top" MaxWidth="362" Margin="0,10,0,0" Click="FeedDialogButton_Click"/>
<Button Content="App Requests Dialog" Width="{Binding ActualWidth, ElementName=ContentRoot}" HorizontalAlignment="Left" Height="73" VerticalAlignment="Top" MaxWidth="362" Margin="0,10,0,0" Click="AppRequestsButton_Click"/>
<Button Content="Send Dialog" Width="{Binding ActualWidth, ElementName=ContentRoot}" x:Name="SendDialogButton" HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top" Height="73" MaxWidth="362" Click="SendDialogButton_Click"/>
</StackPanel>
</Grid>
</Page>
26 changes: 24 additions & 2 deletions samples/LoginCpp-UWP/LoginCpp/Dialogs.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void Dialogs::SaveState(Object^ sender, Common::SaveStateEventArgs^ e) {
}


void Dialogs::Feed_Click(
void Dialogs::FeedDialogButton_Click(
Object^ sender,
RoutedEventArgs^ e
)
Expand All @@ -158,7 +158,7 @@ void Dialogs::Feed_Click(
}


void Dialogs::AppRequests_Click(
void Dialogs::AppRequestsButton_Click(
Object^ sender,
RoutedEventArgs^ e
)
Expand All @@ -183,3 +183,25 @@ void Dialogs::AppRequests_Click(
});
}
}


void LoginCpp::Dialogs::SendDialogButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
FBSession^ s = FBSession::ActiveSession;
if (!s->LoggedIn)
{
OutputDebugString(L"The user is no longer logged in.\n");
}
else
{
PropertySet^ params = ref new PropertySet();

params->Insert(L"link", L"http://example.com");

create_task(s->ShowSendDialogAsync(params))
.then([=](FBResult^ DialogResponse)
{
OutputDebugString(L"Showed 'Send' dialog.\n");
});
}
}
5 changes: 3 additions & 2 deletions samples/LoginCpp-UWP/LoginCpp/Dialogs.xaml.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ namespace LoginCpp

static Windows::UI::Xaml::DependencyProperty^ _defaultViewModelProperty;
static Windows::UI::Xaml::DependencyProperty^ _navigationHelperProperty;
void Feed_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void AppRequests_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void FeedDialogButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void AppRequestsButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void SendDialogButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
};

}
17 changes: 6 additions & 11 deletions samples/LoginCpp-UWP/LoginCpp/LoginCpp.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{351701a8-12d1-45b3-8e6a-164d796b0297}</ProjectGuid>
Expand Down Expand Up @@ -94,7 +94,7 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<PackageCertificateKeyFile>winsdkfb_testing_key.pfx</PackageCertificateKeyFile>
<PackageCertificateKeyFile>..\..\..\winsdkfb\winsdkfb_testing_key.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>F4E6BFEE8265BFC1A3B4A18D7F46397C6891526C</PackageCertificateThumbprint>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
Expand Down Expand Up @@ -141,9 +141,6 @@
<DependentUpon>Dialogs.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="FBPageBindable.h" />
<ClInclude Include="OptionsPage.xaml.h">
<DependentUpon>OptionsPage.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="pch.h" />
<ClInclude Include="App.xaml.h">
<DependentUpon>App.xaml</DependentUpon>
Expand All @@ -166,15 +163,13 @@
<Page Include="MainPage.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="OptionsPage.xaml" />
<Page Include="UserInfo.xaml" />
<Page Include="UserLikes.xaml" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="winsdkfb_testing_key.pfx" />
</ItemGroup>
<ItemGroup>
<Image Include="Assets\Logo.scale-100.png" />
Expand All @@ -197,9 +192,6 @@
<ClCompile Include="MainPage.xaml.cpp">
<DependentUpon>MainPage.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="OptionsPage.xaml.cpp">
<DependentUpon>OptionsPage.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
Expand All @@ -223,6 +215,9 @@
<Project>{973a943b-ff77-4267-8f30-f5fe2b7f5583}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\winsdkfb\winsdkfb_testing_key.pfx" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>
9 changes: 4 additions & 5 deletions samples/LoginCpp-UWP/LoginCpp/LoginCpp.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,16 @@
<ItemGroup>
<AppxManifest Include="Package.appxmanifest" />
</ItemGroup>
<ItemGroup>
<None Include="winsdkfb_testing_key.pfx" />
</ItemGroup>
<ItemGroup>
<Page Include="MainPage.xaml" />
<Page Include="UserInfo.xaml" />
<Page Include="UserLikes.xaml" />
<Page Include="OptionsPage.xaml" />
<Page Include="Dialogs.xaml" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Resources.resw" />
</ItemGroup>
</Project>
<ItemGroup>
<None Include="..\..\..\winsdkfb\winsdkfb_testing_key.pfx" />
</ItemGroup>
</Project>
39 changes: 31 additions & 8 deletions samples/LoginCpp-UWP/LoginCpp/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,35 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Button x:Name="LoginButton" Content="Login To FB" HorizontalAlignment="Left" Margin="39,48,0,0" VerticalAlignment="Top" Click="login_OnClicked"/>
<!--<fbsdk:ProfilePictureControl />-->
<TextBlock FontSize="14" HorizontalAlignment="Left" Margin="39,111,0,0" TextWrapping="Wrap" Text="Access Token:" VerticalAlignment="Top" Width="261" Height="18"/>
<TextBlock x:Name="ResponseText" FontSize="14" HorizontalAlignment="Left" Margin="39,135,0,0" Text="TextBox" TextWrapping="Wrap" VerticalAlignment="Top" Height="94" Width="261"/>
<TextBlock FontSize="14" HorizontalAlignment="Left" Margin="39,263,0,0" TextWrapping="Wrap" Text="Expires" VerticalAlignment="Top" Height="24" Width="261"/>
<TextBlock x:Name="ExpirationDate" FontSize="14" HorizontalAlignment="Left" Margin="39,289,0,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Width="261" Height="24"/>
</Grid>
<ScrollViewer>
<Grid x:Name="LayoutRoot" Loaded="LayoutRoot_Loaded">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

<StackPanel Grid.Row="0" Margin="19,0,0,0">
<TextBlock Text="Facebook Sample App" Style="{ThemeResource TitleTextBlockStyle}" Margin="0,12,0,0"/>
<TextBlock Text="Login Information" Margin="0,-6.5,0,26.5" Style="{ThemeResource HeaderTextBlockStyle}" CharacterSpacing="{ThemeResource PivotHeaderItemCharacterSpacing}"/>
</StackPanel>

<StackPanel Grid.Row="1" Margin="19,0,19,0" x:Name="ContentRoot" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<ComboBox x:Name="LoginMethodComboBox" SelectedIndex="0" HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top" MaxWidth="362" Width="{Binding ActualWidth, ElementName=ContentRoot}" VerticalContentAlignment="Center">
<ComboBoxItem Content="WebView" />
<ComboBoxItem Content="WebAuth" />
<ComboBoxItem Content="WebAccountProvider" />
<ComboBoxItem Content="DefaultOrdering" />
<ComboBoxItem Content="Silent" />
</ComboBox>
<Button x:Name="LoginButton" Content="Login To FB" HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top" Click="login_OnClicked" Width="{Binding ActualWidth, ElementName=ContentRoot}" MaxWidth="362" Height="68"/>
<Button x:Name="UserInfoButton" Content="User Info" IsEnabled="False" HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top" Click="UserInfoButton_Click" Width="{Binding ActualWidth, ElementName=ContentRoot}" MaxWidth="362" Height="68"/>
<Button x:Name="DialogsPageButton" Content="Dialogs" IsEnabled="False" HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top" Click="DialogsPageButton_Click" Width="{Binding ActualWidth, ElementName=ContentRoot}" MaxWidth="362" Height="68"/>
<!--<fbsdk:ProfilePictureControl />-->
<TextBlock FontSize="14" HorizontalAlignment="Left" Margin="0,10,0,0" TextWrapping="Wrap" Text="Access Token:" VerticalAlignment="Top" Width="261" Height="18"/>
<TextBlock x:Name="AccessTokenText" FontSize="14" HorizontalAlignment="Left" Margin="0,10,0,0" Text="" TextWrapping="Wrap" VerticalAlignment="Top" MaxHeight="120" MaxWidth="362" IsRightTapEnabled="True" IsTextSelectionEnabled="True"/>
<TextBlock FontSize="14" HorizontalAlignment="Left" Margin="0,10,0,0" TextWrapping="Wrap" Text="Expires:" VerticalAlignment="Top" Height="24" Width="261"/>
<TextBlock x:Name="ExpirationDateText" FontSize="14" HorizontalAlignment="Left" Margin="0,10,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" MaxWidth="261" Height="24" IsRightTapEnabled="True" IsTextSelectionEnabled="True"/>
</StackPanel>
</Grid>
</ScrollViewer>
</Page>
Loading

0 comments on commit a847a5b

Please sign in to comment.