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 #252 from Microsoft/develop
Browse files Browse the repository at this point in the history
v0.14.0 release
  • Loading branch information
adiviness authored Aug 9, 2017
2 parents d396100 + fc12316 commit a1fdf6e
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 134 deletions.
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
# **Windows SDK for Facebook**
# Windows SDK for Facebook

The Windows SDK for Facebook is geared towards app developers creating modern windows applications on both desktop and phone. Easily integrate Facebook Auth, Like and other Facebook Graph functionality using this SDK. Nuget package for Windows 10 available at: https://www.nuget.org/packages/winsdkfb
The Windows SDK for Facebook is geared towards app developers creating modern windows applications on both desktop and phone.
Easily integrate Facebook Auth, Like and other Facebook Graph functionality using this SDK. Nuget package for Windows 10
available at: https://www.nuget.org/packages/winsdkfb

## Features

## **Features**

###Auth
### Auth

- Login
- Logout
- Login Button
- Profile Picture control

###Dialogs
### Dialogs
- Feed dialog
- Request dialog
- Send dialog

###Graph
- Custom Stories
### Graph

- Custom Stories
- Post to user’s feed
- Upload Photo
- Like a Page/Object

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

## Supported Platforms

## **Supported Platforms**

Windows 8.1+
Windows Phone 8.1+
Windows 10
- [x] Windows 8.1+
- [x] Windows Phone 8.1+
- [x] Windows 10

## **Documentation**
## Documentation

- http://microsoft.github.io/winsdkfb

## **License**
## License
See the LICENSE file for licensing information.

## **Contributing**
## Contributing

All pull requests should be made to the `develop` branch.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const wchar_t* requested_permissions[] =
L"public_profile",
L"user_friends",
L"user_likes",
L"user_groups",
L"user_location"
};

Expand Down
113 changes: 1 addition & 112 deletions winsdkfb/build/build-sdk.cmd
Original file line number Diff line number Diff line change
@@ -1,113 +1,2 @@
rem ---------------------------------------------------------------------------
rem Script to build the Microsoft SDK for Facebook Integration. This script
rem will build the Windows 8.1 and Windows Phone 8.1 versions of the SDK, then
rem the Windows 10 Universal version, then package everything up with NuGet.
rem
rem On completion, the SDK packages should be located in the directory
rem winsdkfb\bin under the root of the repository. A synopsis of the build will
rem exist in the file sdk-build.log in the same directory as the build script.
rem
rem This script assumes it is located in the Git repository and location in
rem which it originated. If it is moved, it will cease to function!
rem ---------------------------------------------------------------------------

set starting_dir=%cd%
set script_dir=%~dp0
set logfile=%script_dir%\sdk-build.log
cd /d %script_dir%\..

@echo Starting build... >%logfile%

rem ---------------------------------------------------------------------------
rem build for Windows 8.1 and Phone 8.1
rem ---------------------------------------------------------------------------
call :build_one_flavor winsdkfb.sln Win32 Debug
if errorlevel 1 goto errorExit

call :build_one_flavor winsdkfb.sln Win32 Release
if errorlevel 1 goto errorExit

call :build_one_flavor winsdkfb.sln x64 Debug
if errorlevel 1 goto errorExit

call :build_one_flavor winsdkfb.sln x64 Release
if errorlevel 1 goto errorExit

call :build_one_flavor winsdkfb.sln ARM Debug
if errorlevel 1 goto errorExit

call :build_one_flavor winsdkfb.sln ARM Release
if errorlevel 1 goto errorExit

rem ---------------------------------------------------------------------------
rem build for Windows 10 Universal
rem ---------------------------------------------------------------------------

call :build_one_flavor winsdkfb_uwp/winsdkfb_uwp.sln Win32 Debug
if errorlevel 1 goto errorExit

call :build_one_flavor winsdkfb_uwp/winsdkfb_uwp.sln Win32 Release
if errorlevel 1 goto errorExit

call :build_one_flavor winsdkfb_uwp/winsdkfb_uwp.sln x64 Debug
if errorlevel 1 goto errorExit

call :build_one_flavor winsdkfb_uwp/winsdkfb_uwp.sln x64 Release
if errorlevel 1 goto errorExit

call :build_one_flavor winsdkfb_uwp/winsdkfb_uwp.sln ARM Debug
if errorlevel 1 goto errorExit

call :build_one_flavor winsdkfb_uwp/winsdkfb_uwp.sln ARM Release
if errorlevel 1 goto errorExit

rem ---------------------------------------------------------------------------
rem build NuGet packages
rem ---------------------------------------------------------------------------
:build_nuget
cd %script_dir%\nuget

rem Get version number, so we can test for packages after build attempt
for /f "delims=" %%i in ('type VERSION') do set version=%%i

@echo Checking for nuget.exe... >>%logfile%
if not exist nuget.exe call download-nuget.cmd
if not exist nuget.exe (
@echo Error: failed to download nuget.exe, can't package the SDK
goto :eof
)

@echo Packaging SDK... >>%logfile%

call build-nupkg.cmd
if not exist ..\..\bin\winsdkfb.%version%.nupkg (
@echo Error: failed to build SDK NuGet package
goto :eof
)

cd /d %starting_dir%
@echo Build successful >>%logfile%
@echo "All done!"
goto :eof

rem ---------------------------------------------------------------------------
rem Subroutine to build for one solution, platform, and configuration
rem ---------------------------------------------------------------------------
:build_one_flavor
@echo Starting build for solution %1, platform %2, configuration %3 >>%logfile%
msbuild %1 /p:Platform=%2;Configuration=%3
if errorlevel 1 (
@echo Error building solution %1, platform %2, configuration %3 >>%logfile%
exit /b
)
@echo Completed build for solution %1, platform %2, configurattion %3 >>%logfile%
exit /b

rem ---------------------------------------------------------------------------
rem In case of build failure, err out here
rem ---------------------------------------------------------------------------
:errorExit
@echo "Error: one or more targets failed to build."
cd /d %starting_dir%
goto :eof

powershell %~dp0\build-sdk.ps1
147 changes: 147 additions & 0 deletions winsdkfb/build/build-sdk.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@

# If you move this script, change this environment variable to point to the root
# of the winsdkfb directory. Stuff will break if you don't!
Set-Item -force -path "env:WinsdkfbRoot" -value "$PSScriptRoot\..\.."

#.SYNOPSIS
# Grabs all environment variable set after vcvarsall.bat is called and pulls
# them into the Powershell environment.
function Set-MsbuildDevEnvironment()
{
$path = "$env:VS140COMNTOOLS\..\.."
pushd $path
cmd /c "vcvarsall.bat&set" | foreach {
if ($_ -match "=")
{
$s = $_.Split("=");
Set-Item -force -path "env:\$($s[0])" -value "$($s[1])"
}
}
popd
Write-Host "Dev environment variables set" -ForegroundColor Green
}

#.SYNOPSIS
# Downloads the latest version of nuget.exe.
#
#.PARAMETER $DownloadTargetDir
# The directory to place nuget.exe in.
function Get-Nuget()
{
[CmdletBinding()]
Param (
[parameter(Mandatory=$true)]
[string]$DownloadTargetDir
)

$NugetDownloadUrl = 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe'
$Downloader = New-Object System.Net.WebClient
$Downloader.DownloadFile($NugetDownloadUrl, "$DownloadTargetDir\nuget.exe")
}

#.SYNOPSIS
# Ensures that the build tools required can be found on the system.
function Test-BuildToolsPresent()
{
Set-MsbuildDevEnvironment
if ((Get-Command "msbuild.exe" -ErrorAction SilentlyContinue) -eq $null)
{
Throw "msbuild.exe is not present in path"
}
if ((Get-Command "nuget.exe" -ErrorAction SilentlyContinue) -eq $null)
{
$NugetTargetDir = "$env:WinsdkfbRoot\winsdkfb\build\nuget"
if (-not (Test-Path "$NugetTargetDir\nuget.exe"))
{
Write-Host "downloading latest nuget.exe..."
Get-Nuget -DownloadTargetDir $NugetTargetDir
}
$env:Path += ";$NugetTargetDir;"
}
if ((Get-Command "TextTransform.exe" -ErrorAction SilentlyContinue) -eq $null)
{
$TextTemplateDir = "${env:CommonProgramFiles(x86)}\Microsoft Shared\TextTemplating\14.0"
if (Test-Path "$TextTemplateDir\TextTransform.exe")
{
$env:Path += ";$TextTemplateDir;"
}
else
{
Throw "TextTransform.exe cannot be found."
}
}
}

#.SYNOPSIS
# Builds a winsdkfb solution.
#
#.PARAMETER $SolutionName
# The path to the solution to build.
#
#.PARAMETER $Platform
# The platform to target. May be Win32, x64, ARM.
#
#.PARAMETER $Configuration
# The configuration to target. May be Debug, Release.
function Invoke-OpenConsoleBuild()
{
[CmdletBinding()]
Param (
[parameter(Mandatory=$true)]
[string]$SolutionName,

[parameter(Mandatory=$true)]
[string]$Platform,

[parameter(Mandatory=$true)]
[string]$Configuration
)

Write-Host "building $SolutionName,$Platform,$Configuration"
nuget.exe restore $SolutionName
if (-not $?)
{
Throw "nuget restore failed"
}
msbuild.exe $SolutionName /p:Platform=$Platform /p:Configuration=$Configuration
if (-not $?)
{
Throw "building $SolutionName,$Platform,$Configuration failed"
}
}

#.SYNOPSIS
# Creates a winsdkfb nuget package.
function Invoke-NugetPackage()
{
# set version number
$Version = (Get-Content $env:winsdkfbRoot\winsdkfb\build\nuget\VERSION).ToString()
$env:version = $Version
# build-nupkg.cmd requires that the current working directory is the
# directory that it sits in because it uses relative paths.
pushd $env:winsdkfbRoot\winsdkfb\build\nuget
& $env:WinsdkfbRoot\winsdkfb\build\nuget\build-nupkg.cmd
if (-not (Test-Path "$env:WinsdkfbRoot\winsdkfb\bin\winsdkfb.${Version}.nupkg"))
{
popd
Throw "Failed to build SDK NuGet package"
}
popd
}

# main
Test-BuildToolsPresent
$SolutionFiles = @("$env:WinsdkfbRoot\winsdkfb\winsdkfb.sln", "$env:winsdkfbRoot\winsdkfb\winsdkfb_uwp\winsdkfb_uwp.sln")
$Platforms = @("Win32", "x64", "ARM")
$Configurations = @("Debug", "Release")
foreach ($Solution in $SolutionFiles)
{
foreach ($Platform in $Platforms)
{
foreach ($Configuration in $Configurations)
{
Invoke-OpenConsoleBuild -SolutionName $Solution -Platform $Platform -Configuration $Configuration
}
}
}
Invoke-NugetPackage
2 changes: 1 addition & 1 deletion winsdkfb/build/nuget/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.0
0.14.0
2 changes: 1 addition & 1 deletion winsdkfb/build/nuget/download-nuget.cmd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
powershell -command "(New-Object System.Net.WebClient).DownloadFile('http://nuget.org/nuget.exe', '%~pd0nuget.exe')"
powershell -command "(New-Object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '%~pd0nuget.exe')"
Binary file modified winsdkfb/build/nuget/nuget.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion winsdkfb/winsdkfb/winsdkfb.Shared/FBConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

// Define the base version of the SDK.
// Keep in sync with winsdkfb\build\nuget\VERSION
#define WINSDKFB_VERSION L"0.13.0"
#define WINSDKFB_VERSION L"0.14.0"
6 changes: 5 additions & 1 deletion winsdkfb/winsdkfb/winsdkfb.Shared/FacebookSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ task<FBResult^> FBSession::GetUserInfo(
{
PropertySet^ parameters = ref new PropertySet();
parameters->Insert(L"fields",
L"gender,link,first_name,last_name,locale,timezone,email,updated_time,verified,name,id");
L"gender,link,first_name,last_name,locale,timezone,email,updated_time,verified,name,id,picture");
FBSingleValue^ value = ref new FBSingleValue(
"/me",
parameters,
Expand All @@ -231,7 +231,11 @@ IAsyncOperation<IStorageItem^>^ FBSession::MyTryGetItemAsync(
{
return create_task([=]() -> task<IStorageItem^>
{
#if defined(_WIN32_WINNT_WIN10)
return create_task(folder->TryGetItemAsync(itemName));
#else
return create_task(folder->GetItemAsync(itemName));
#endif
})
.then([=](task<IStorageItem^> folderTask) -> IStorageItem^
{
Expand Down

0 comments on commit a1fdf6e

Please sign in to comment.