Skip to content

Commit fb74f8b

Browse files
committed
Facebook SDK For Unity 7.8.0
1 parent 288f07f commit fb74f8b

File tree

373 files changed

+2485
-2566
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

373 files changed

+2485
-2566
lines changed

.gitignore

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ unit_test_results.txt
5555
TestResult.xml
5656

5757
# Ignore Plugin Folders which are build by build
58-
/Facebook.Unity/Assets/Plugins/
58+
/UnitySDK/Assets/Plugins/
5959

6060
# Ignore Current Facebook Settings
6161
FacebookSettings.asset*
6262

63-
# Ignore androdi wrapper lib created by build scripts
63+
# Ignore android wrapper lib created by build scripts
6464
/facebook-android-wrapper/libs/
6565

6666
# MD Plugins
@@ -134,7 +134,7 @@ TestResult.xml
134134
# Ignore Current Facebook Settings
135135
FacebookSettings.asset*
136136

137-
# Ignore androdi wrapper lib created by build scripts
137+
# Ignore android wrapper lib created by build scripts
138138
/facebook-android-wrapper/libs/
139139

140140
# MD Plugins
@@ -147,4 +147,7 @@ StyleCop.Cache.meta
147147
*.DS_Store
148148

149149
# Temp file to show call stack
150-
*.stackdump
150+
*.stackdump
151+
152+
# Ignore editor generated user prefs
153+
*.userprefs
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
/**
2+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
3+
*
4+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
5+
* copy, modify, and distribute this software in source code or binary form for use
6+
* in connection with the web services and APIs provided by Facebook.
7+
*
8+
* As with any software that integrates with the Facebook platform, your use of
9+
* this software is subject to the Facebook Developer Principles and Policies
10+
* [http://developers.facebook.com/policy/]. This copyright notice shall be
11+
* included in all copies or substantial portions of the software.
12+
*
13+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19+
*/
20+
21+
namespace Facebook.Unity.Arcade
22+
{
23+
using System;
24+
using System.Collections.Generic;
25+
using FacebookGames;
26+
using FacebookPlatformServiceClient;
27+
28+
internal class ArcadeWrapper : IArcadeWrapper
29+
{
30+
private const string PipeErrorMessage = @"Pipe name not passed to application on start.
31+
Make sure you are running inside the facebook games client.";
32+
33+
private FacebookNamedPipeClient clientPipe;
34+
private ArcadeFacebookGameObject facebookGameObject;
35+
36+
public ArcadeWrapper()
37+
{
38+
string pipeName;
39+
Utilities.CommandLineArguments.TryGetValue("/pn", out pipeName);
40+
if (pipeName == null)
41+
{
42+
throw new InvalidOperationException(ArcadeWrapper.PipeErrorMessage);
43+
}
44+
45+
this.clientPipe = new FacebookNamedPipeClient(pipeName);
46+
this.facebookGameObject = ComponentFactory.GetComponent<ArcadeFacebookGameObject>();
47+
}
48+
49+
public IDictionary<string, object> PipeResponse
50+
{
51+
get
52+
{
53+
PipePacketResponse response = this.clientPipe.PipeResponse;
54+
if (response == null)
55+
{
56+
return null;
57+
}
58+
59+
return response.ToDictionary();
60+
}
61+
62+
set
63+
{
64+
if (value == null)
65+
{
66+
this.clientPipe.PipeResponse = null;
67+
return;
68+
}
69+
70+
throw new NotSupportedException("Can only set pipe response to null");
71+
}
72+
}
73+
74+
public void DoLoginRequest(
75+
string appID,
76+
string permissions,
77+
string callbackId,
78+
ArcadeFacebook.OnComplete completeDelegate)
79+
{
80+
var request = new LoginRequest(
81+
appID,
82+
permissions);
83+
this.HandleRequest<LoginRequest, LoginResponse>(
84+
request,
85+
callbackId,
86+
completeDelegate);
87+
}
88+
89+
public void DoPayRequest(
90+
string appId,
91+
string method,
92+
string action,
93+
string product,
94+
string productId,
95+
string quantity,
96+
string quantityMin,
97+
string quantityMax,
98+
string requestId,
99+
string pricepointId,
100+
string testCurrency,
101+
string callbackId,
102+
ArcadeFacebook.OnComplete completeDelegate)
103+
{
104+
var request = new PayRequest(
105+
appId,
106+
method,
107+
action,
108+
product,
109+
productId,
110+
quantity,
111+
quantityMin,
112+
quantityMax,
113+
requestId,
114+
pricepointId,
115+
testCurrency);
116+
this.HandleRequest<PayRequest, PayResponse>(
117+
request,
118+
callbackId,
119+
completeDelegate);
120+
}
121+
122+
public void DoFeedShareRequest(
123+
string appId,
124+
string toId,
125+
string link,
126+
string linkName,
127+
string linkCaption,
128+
string linkDescription,
129+
string pictureLink,
130+
string mediaSource,
131+
string callbackId,
132+
ArcadeFacebook.OnComplete completeDelegate)
133+
{
134+
var request = new FeedShareRequest(
135+
appId,
136+
toId,
137+
link,
138+
linkName,
139+
linkCaption,
140+
linkDescription,
141+
pictureLink,
142+
mediaSource);
143+
this.HandleRequest<FeedShareRequest, FeedShareResponse>(
144+
request,
145+
callbackId,
146+
completeDelegate);
147+
}
148+
149+
public void DoAppRequestRequest(
150+
string appId,
151+
string message,
152+
string actionType,
153+
string objectId,
154+
string to,
155+
string filters,
156+
string excludeIDs,
157+
string maxRecipients,
158+
string data,
159+
string title,
160+
string callbackId,
161+
ArcadeFacebook.OnComplete completeDelegate)
162+
{
163+
var request = new AppRequestRequest(
164+
appId,
165+
message,
166+
actionType,
167+
objectId,
168+
to,
169+
filters,
170+
excludeIDs,
171+
maxRecipients,
172+
data,
173+
title);
174+
this.HandleRequest<AppRequestRequest, AppRequestResponse>(
175+
request,
176+
callbackId,
177+
completeDelegate);
178+
}
179+
180+
public void SendRequest<T>(T request)
181+
where T : PipePacketResponse
182+
{
183+
this.clientPipe.SendRequest<T>(request);
184+
return;
185+
}
186+
187+
private void HandleRequest<T, R>(
188+
T request,
189+
string callbackId,
190+
ArcadeFacebook.OnComplete completeDelegate)
191+
where T : PipePacketRequest
192+
where R : PipePacketResponse
193+
{
194+
this.clientPipe.SendRequest<R>(request);
195+
this.facebookGameObject.WaitForResponse(
196+
completeDelegate,
197+
callbackId);
198+
}
199+
}
200+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProjectGuid>{D8F7CF97-7FE9-48B7-A30C-CB14BAA73010}</ProjectGuid>
7+
<OutputType>Library</OutputType>
8+
<RootNamespace>Facebook.Unity.Arcade</RootNamespace>
9+
<AssemblyName>Facebook.Unity.Arcade</AssemblyName>
10+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
11+
<ReleaseVersion>
12+
</ReleaseVersion>
13+
</PropertyGroup>
14+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
15+
<DebugSymbols>true</DebugSymbols>
16+
<DebugType>full</DebugType>
17+
<Optimize>false</Optimize>
18+
<OutputPath>bin\Debug</OutputPath>
19+
<DefineConstants>DEBUG;</DefineConstants>
20+
<ErrorReport>prompt</ErrorReport>
21+
<WarningLevel>4</WarningLevel>
22+
</PropertyGroup>
23+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
24+
<DebugType>none</DebugType>
25+
<Optimize>true</Optimize>
26+
<OutputPath>bin\Release</OutputPath>
27+
<ErrorReport>prompt</ErrorReport>
28+
<WarningLevel>4</WarningLevel>
29+
<ConsolePause>false</ConsolePause>
30+
</PropertyGroup>
31+
<ItemGroup>
32+
<Reference Include="System" />
33+
<Reference Include="UnityEngine">
34+
<HintPath>\Applications\Unity\Unity.app\Contents\Frameworks\Managed\UnityEngine.dll</HintPath>
35+
</Reference>
36+
<Reference Include="FacebookNamedPipeClient">
37+
<HintPath>Plugins\FacebookNamedPipeClient.dll</HintPath>
38+
</Reference>
39+
</ItemGroup>
40+
<ItemGroup>
41+
<Compile Include="ArcadeWrapper.cs" />
42+
<Compile Include="Properties\AssemblyInfo.cs" />
43+
</ItemGroup>
44+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
45+
<ItemGroup>
46+
<Folder Include="Properties\" />
47+
<Folder Include="Plugins\" />
48+
</ItemGroup>
49+
<ItemGroup>
50+
<None Include="Plugins\FacebookNamedPipeClient.dll" />
51+
</ItemGroup>
52+
<ItemGroup>
53+
<ProjectReference Include="..\Facebook.Unity\Facebook.Unity.csproj">
54+
<Project>{3DFF6C0C-BB04-405D-A23F-95999630E7F8}</Project>
55+
<Name>Facebook.Unity</Name>
56+
</ProjectReference>
57+
</ItemGroup>
58+
</Project>
Binary file not shown.

Facebook.Unity/Assets/FacebookSDK/SDK/Scripts/Properties/AssemblyInfo.cs renamed to Facebook.Unity.Arcade/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
*/
2020

2121
using System.Runtime.CompilerServices;
22+
using System.Reflection;
2223

23-
[assembly: InternalsVisibleTo("Facebook.Unity.Tests")]
24+
[assembly: AssemblyVersion("7.8.0")]
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProjectGuid>{4F631992-8D32-4AB5-8073-4BDC8A79380B}</ProjectGuid>
7+
<OutputType>Library</OutputType>
8+
<RootNamespace>Facebook.Unity.Editor</RootNamespace>
9+
<AssemblyName>Facebook.Unity.Editor</AssemblyName>
10+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
11+
<ReleaseVersion>
12+
</ReleaseVersion>
13+
</PropertyGroup>
14+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
15+
<DebugSymbols>true</DebugSymbols>
16+
<DebugType>full</DebugType>
17+
<Optimize>false</Optimize>
18+
<OutputPath>bin\Debug</OutputPath>
19+
<DefineConstants>DEBUG;</DefineConstants>
20+
<ErrorReport>prompt</ErrorReport>
21+
<WarningLevel>4</WarningLevel>
22+
<ConsolePause>false</ConsolePause>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>full</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release</OutputPath>
28+
<ErrorReport>prompt</ErrorReport>
29+
<WarningLevel>4</WarningLevel>
30+
<ConsolePause>false</ConsolePause>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="System" />
34+
<Reference Include="UnityEditor">
35+
<HintPath>\Applications\Unity\Unity.app\Contents\Frameworks\Managed\UnityEditor.dll</HintPath>
36+
</Reference>
37+
<Reference Include="UnityEngine">
38+
<HintPath>\Applications\Unity\Unity.app\Contents\Frameworks\Managed\UnityEngine.dll</HintPath>
39+
</Reference>
40+
<Reference Include="System.Xml" />
41+
<Reference Include="System.Xml.Linq" />
42+
</ItemGroup>
43+
<ItemGroup>
44+
<Compile Include="FacebookBuild.cs" />
45+
<Compile Include="FacebookConsoleEndpoint.cs" />
46+
<Compile Include="FacebookPostprocess.cs" />
47+
<Compile Include="FacebookSettingsEditor.cs" />
48+
<Compile Include="Utility.cs" />
49+
<Compile Include="android\FacebookAndroidUtil.cs" />
50+
<Compile Include="android\ManifestMod.cs" />
51+
<Compile Include="iOS\FixupFiles.cs" />
52+
<Compile Include="iOS\PListDict.cs" />
53+
<Compile Include="iOS\PListParser.cs" />
54+
<Compile Include="Properties\AssemblyInfo.cs" />
55+
</ItemGroup>
56+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
57+
<ItemGroup>
58+
<None Include="FacebookBuild.cs.meta" />
59+
<None Include="FacebookConsoleEndpoint.cs.meta" />
60+
<None Include="FacebookPostprocess.cs.meta" />
61+
<None Include="FacebookSettingsEditor.cs.meta" />
62+
<None Include="Utility.cs.meta" />
63+
<None Include="android\DefaultAndroidManifest.xml.meta" />
64+
<None Include="android\FacebookAndroidUtil.cs.meta" />
65+
<None Include="android\ManifestMod.cs.meta" />
66+
<None Include="iOS\FixupFiles.cs.meta" />
67+
<None Include="iOS\PListDict.cs.meta" />
68+
<None Include="iOS\PListParser.cs.meta" />
69+
</ItemGroup>
70+
<ItemGroup>
71+
<ProjectReference Include="..\Facebook.Unity\Facebook.Unity.csproj">
72+
<Project>{3DFF6C0C-BB04-405D-A23F-95999630E7F8}</Project>
73+
<Name>Facebook.Unity</Name>
74+
</ProjectReference>
75+
</ItemGroup>
76+
<ItemGroup>
77+
<EmbeddedResource Include="android\DefaultAndroidManifest.xml" />
78+
</ItemGroup>
79+
<ItemGroup>
80+
<Folder Include="Properties\" />
81+
</ItemGroup>
82+
</Project>

Facebook.Unity/Assets/FacebookSDK/SDK/Editor/FacebookBuild.cs renamed to Facebook.Unity.Editor/FacebookBuild.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public static string ExportPackage()
9797
AssetDatabase.DeleteAsset("Assets/Temp");
9898

9999
// regenerate the manifest
100-
UnityEditor.FacebookEditor.ManifestMod.GenerateManifest();
100+
ManifestMod.GenerateManifest();
101101
}
102102

103103
Debug.Log("Finished exporting!");

0 commit comments

Comments
 (0)