Skip to content

Commit 7dacd75

Browse files
committed
Facebook SDK For Unity 7.10.0
1 parent be79942 commit 7dacd75

File tree

128 files changed

+25428
-2131
lines changed

Some content is hidden

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

128 files changed

+25428
-2131
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ TestResult.xml
5757
# Ignore Plugin Folders which are build by build
5858
/UnitySDK/Assets/Plugins/
5959

60+
# Ignore Unity Jar Resolver which is pulled in by build script
61+
/UnitySDK/Assets/PlayServicesResolver.meta
62+
/UnitySDK/Assets/PlayServicesResolver/
63+
6064
# Ignore Current Facebook Settings
6165
FacebookSettings.asset*
6266

@@ -79,3 +83,14 @@ StyleCop.Cache.meta
7983

8084
# Nuget packages
8185
/packages/
86+
87+
# AN SDK builds
88+
ads/Assets/AudienceNetwork/Plugins/Android/libs/ads-release.aar
89+
ads/Assets/AudienceNetwork/Plugins/iOS/libs/FBAudienceNetwork.framework/FBAudienceNetwork
90+
ads/Assets/AudienceNetwork/Plugins/iOS/libs/FBAudienceNetwork.framework/Headers/*.h
91+
ads/Assets/AudienceNetwork/Plugins/iOS/libs/FBAudienceNetwork.framework/Info.plist
92+
ads/Assets/AudienceNetwork/Plugins/iOS/libs/FBAudienceNetwork.framework/Modules/module.modulemap
93+
ads/Assets/AudienceNetwork/Editor/iOS.meta
94+
ads/Assets/AudienceNetwork/Plugins/Android/libs/ads-release.aar.meta
95+
ads/Assets/AudienceNetwork/Plugins/iOS/libs/FBAudienceNetwork.framework/*.h.meta
96+
ads/Assets/AudienceNetwork/Plugins/iOS/libs/FBAudienceNetwork.framework/Headers/*.h.meta

Facebook.Unity.Android.StrippingHack/Facebook.Unity.Android.StrippingHack.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
<RootNamespace>Facebook.Unity.Android.StrippingHack</RootNamespace>
99
<AssemblyName>Facebook.Unity.Android</AssemblyName>
1010
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
11-
<ReleaseVersion></ReleaseVersion>
11+
<ReleaseVersion>
12+
</ReleaseVersion>
1213
</PropertyGroup>
1314
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1415
<DebugSymbols>true</DebugSymbols>

Facebook.Unity.Android.StrippingHack/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
using System.Reflection;
2222
using System.Runtime.CompilerServices;
2323

24-
[assembly: AssemblyVersion("7.9.0")]
24+
[assembly: AssemblyVersion("7.10.0")]

Facebook.Unity.Android/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
using System.Reflection;
2222
using System.Runtime.CompilerServices;
2323

24-
[assembly: AssemblyVersion("7.9.0")]
24+
[assembly: AssemblyVersion("7.10.0")]
Binary file not shown.

Facebook.Unity.Editor/Facebook.Unity.Editor.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
</Reference>
4242
<Reference Include="System.Xml" />
4343
<Reference Include="System.Xml.Linq" />
44+
<Reference Include="Google.VersionHandler">
45+
<HintPath>..\UnitySDK\Assets\PlayServicesResolver\Editor\Google.VersionHandler.dll</HintPath>
46+
</Reference>
4447
</ItemGroup>
4548
<ItemGroup>
4649
<Compile Include="FacebookBuild.cs" />
@@ -54,6 +57,7 @@
5457
<Compile Include="iOS\PListDict.cs" />
5558
<Compile Include="iOS\PListParser.cs" />
5659
<Compile Include="Properties\AssemblyInfo.cs" />
60+
<Compile Include="android\AndroidSupportLibraryResolver.cs" />
5761
</ItemGroup>
5862
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
5963
<ItemGroup>

Facebook.Unity.Editor/FacebookBuild.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ internal class FacebookBuild
3131
private const string SDKPath = "Assets/FacebookSDK/SDK/";
3232
private const string ExamplesPath = "Assets/FacebookSDK/Examples/";
3333
private const string PluginsPath = "Assets/FacebookSDK/Plugins/";
34+
private const string PlayServicesResolverPath = "Assets/PlayServicesResolver/";
3435

3536
public enum Target
3637
{
@@ -82,11 +83,16 @@ public static string ExportPackage()
8283
string[] sdkFiles = (string[])Directory.GetFiles(SDKPath, "*.*", SearchOption.AllDirectories);
8384
string[] exampleFiles = (string[])Directory.GetFiles(ExamplesPath, "*.*", SearchOption.AllDirectories);
8485
string[] pluginsFiles = (string[])Directory.GetFiles(PluginsPath, "*.*", SearchOption.AllDirectories);
85-
string[] files = new string[facebookFiles.Length + sdkFiles.Length + exampleFiles.Length + pluginsFiles.Length];
86+
87+
string[] playServicesResolverFiles = (string[])Directory.GetFiles(PlayServicesResolverPath, "*.*",
88+
SearchOption.AllDirectories);
89+
string[] files = new string[facebookFiles.Length + sdkFiles.Length + exampleFiles.Length +
90+
pluginsFiles.Length + playServicesResolverFiles.Length];
8691
facebookFiles.CopyTo(files, 0);
8792
sdkFiles.CopyTo(files, facebookFiles.Length);
8893
exampleFiles.CopyTo(files, sdkFiles.Length + facebookFiles.Length);
8994
pluginsFiles.CopyTo(files, sdkFiles.Length + facebookFiles.Length + exampleFiles.Length);
95+
playServicesResolverFiles.CopyTo(files, sdkFiles.Length + facebookFiles.Length + exampleFiles.Length + pluginsFiles.Length);
9096

9197
AssetDatabase.ExportPackage(
9298
files,

Facebook.Unity.Editor/FacebookPostprocess.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ public static void OnPostProcessBuild(BuildTarget target, string path)
5050
if (target == BuildTarget.Android)
5151
{
5252
// The default Bundle Identifier for Unity does magical things that causes bad stuff to happen
53-
if (PlayerSettings.bundleIdentifier == "com.Company.ProductName")
54-
{
55-
Debug.LogError("The default Unity Bundle Identifier (com.Company.ProductName) will not work correctly.");
53+
var defaultIdentifier = "com.Company.ProductName";
54+
55+
if (Utility.GetApplicationIdentifier() == defaultIdentifier) {
56+
Debug.LogError ("The default Unity Bundle Identifier (com.Company.ProductName) will not work correctly.");
5657
}
5758

5859
if (!FacebookAndroidUtil.SetupProperly)

Facebook.Unity.Editor/FacebookSettingsEditor.cs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public class FacebookSettingsEditor : Editor
3535
private bool showAndroidUtils = false;
3636
private bool showIOSSettings = false;
3737
private bool showAppLinksSettings = false;
38-
private bool showFacebookUploadBuildSettings = false;
3938
private bool showAboutSection = false;
4039

4140
private GUIContent appNameLabel = new GUIContent(
@@ -62,10 +61,6 @@ public class FacebookSettingsEditor : Editor
6261
private GUIContent classNameLabel = new GUIContent("Class Name [?]", "aka: the activity name");
6362
private GUIContent debugAndroidKeyLabel = new GUIContent("Debug Android Key Hash [?]", "Copy this key to the Facebook Settings in order to test a Facebook Android app");
6463

65-
private GUIContent uploadAccessTokenLabel = new GUIContent(
66-
"Upload Access Token [?]",
67-
"Use this to upload build for Facebook platform");
68-
6964
private GUIContent sdkVersion = new GUIContent("SDK Version [?]", "This Unity Facebook SDK version. If you have problems or compliments please include this so we know exactly what version to look out for.");
7065

7166
public FacebookSettingsEditor()
@@ -304,7 +299,7 @@ private void AndroidUtilGUI()
304299

305300
EditorGUILayout.LabelField(
306301
"Copy and Paste these into your \"Native Android App\" Settings on developers.facebook.com/apps");
307-
this.SelectableLabelField(this.packageNameLabel, PlayerSettings.bundleIdentifier);
302+
this.SelectableLabelField(this.packageNameLabel, Utility.GetApplicationIdentifier());
308303
this.SelectableLabelField(this.classNameLabel, ManifestMod.DeepLinkingActivityName);
309304
this.SelectableLabelField(this.debugAndroidKeyLabel, FacebookAndroidUtil.DebugKeyHash);
310305
if (GUILayout.Button("Regenerate Android Manifest"))
@@ -361,23 +356,6 @@ private void AppLinksUtilGUI()
361356
}
362357
}
363358

364-
private void UploadBuildSettingsGUI()
365-
{
366-
this.showFacebookUploadBuildSettings = EditorGUILayout.Foldout(
367-
this.showFacebookUploadBuildSettings,
368-
"Upload Facebook Build Settings");
369-
370-
if (this.showFacebookUploadBuildSettings)
371-
{
372-
EditorGUILayout.BeginHorizontal();
373-
EditorGUILayout.LabelField(this.uploadAccessTokenLabel, GUILayout.Width(135), GUILayout.Height(16));
374-
FacebookSettings.UploadAccessToken = EditorGUILayout.TextField(FacebookSettings.UploadAccessToken);
375-
EditorGUILayout.EndHorizontal();
376-
}
377-
378-
EditorGUILayout.Space();
379-
}
380-
381359
private void AboutGUI()
382360
{
383361
this.showAboutSection = EditorGUILayout.Foldout(this.showAboutSection, "About the Facebook SDK");

Facebook.Unity.Editor/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
using System.Reflection;
2222
using System.Runtime.CompilerServices;
2323

24-
[assembly: AssemblyVersion("7.9.0")]
24+
[assembly: AssemblyVersion("7.10.0")]

Facebook.Unity.Editor/Utility.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ namespace Facebook.Unity.Editor
2323
using System;
2424
using System.Collections.Generic;
2525
using System.Linq;
26+
using System.Reflection;
27+
using UnityEditor;
2628

2729
public static class Utility
2830
{
31+
private static string BundleIdentifier = "bundleIdentifier";
32+
private static string ApplicationIdentifier = "applicationIdentifier";
33+
2934
public static T Pop<T>(this IList<T> list)
3035
{
3136
if (!list.Any())
@@ -54,5 +59,20 @@ public static bool TryGetValue<T>(
5459
value = default(T);
5560
return false;
5661
}
62+
63+
public static string GetApplicationIdentifier()
64+
{
65+
Type playerSettingType = typeof(PlayerSettings);
66+
PropertyInfo info = playerSettingType.GetProperty(ApplicationIdentifier)
67+
?? playerSettingType.GetProperty(BundleIdentifier);
68+
if (info != null) {
69+
string applicationIdentifier = (string)info.GetValue(playerSettingType, null);
70+
if (applicationIdentifier is string) {
71+
return applicationIdentifier;
72+
}
73+
}
74+
75+
return null;
76+
}
5777
}
5878
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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+
/**
22+
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
23+
*
24+
* You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
25+
* copy, modify, and distribute this software in source code or binary form for use
26+
* in connection with the web services and APIs provided by Facebook.
27+
*
28+
* As with any software that integrates with the Facebook platform, your use of
29+
* this software is subject to the Facebook Developer Principles and Policies
30+
* [http://developers.facebook.com/policy/]. This copyright notice shall be
31+
* included in all copies or substantial portions of the software.
32+
*
33+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
35+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
36+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
37+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
38+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39+
*/
40+
41+
namespace Facebook.Unity.Editor
42+
{
43+
using System;
44+
using System.Collections.Generic;
45+
using UnityEditor;
46+
using UnityEngine;
47+
48+
[InitializeOnLoad]
49+
public class AndroidSupportLibraryResolver
50+
{
51+
static AndroidSupportLibraryResolver()
52+
{
53+
AndroidSupportLibraryResolver.setupDependencies();
54+
}
55+
56+
private static void setupDependencies()
57+
{
58+
// Setup the resolver using reflection as the module may not be
59+
// available at compile time.
60+
Type playServicesSupport = Google.VersionHandler.FindClass(
61+
"Google.JarResolver",
62+
"Google.JarResolver.PlayServicesSupport");
63+
64+
if (playServicesSupport == null) {
65+
return;
66+
}
67+
68+
object svcSupport = Google.VersionHandler.InvokeStaticMethod(
69+
playServicesSupport,
70+
"CreateInstance",
71+
new object[] {
72+
"FacebookUnitySDK",
73+
EditorPrefs.GetString("AndroidSdkRoot"),
74+
"ProjectSettings"
75+
});
76+
77+
// com.android.support:support-v4
78+
Google.VersionHandler.InvokeInstanceMethod(
79+
svcSupport,
80+
"DependOn",
81+
new object[] {
82+
"com.android.support",
83+
"support-v4",
84+
"25.3.1"
85+
},
86+
namedArgs: new Dictionary<string, object>() {
87+
{
88+
"packageIds",
89+
new string[] {
90+
"extra-android-m2repository"
91+
}
92+
}
93+
});
94+
95+
AndroidSupportLibraryResolver.addSupportLibraryDepenency(svcSupport, "support-v4", "25.3.1");
96+
AndroidSupportLibraryResolver.addSupportLibraryDepenency(svcSupport, "appcompat-v7", "25.3.1");
97+
AndroidSupportLibraryResolver.addSupportLibraryDepenency(svcSupport, "cardview-v7", "25.3.1");
98+
AndroidSupportLibraryResolver.addSupportLibraryDepenency(svcSupport, "customtabs", "25.3.1");
99+
100+
}
101+
102+
public static void addSupportLibraryDepenency(
103+
object svcSupport,
104+
String packageName,
105+
String version)
106+
{
107+
Debug.LogWarning("App - " + packageName + ":" + version);
108+
Google.VersionHandler.InvokeInstanceMethod(
109+
svcSupport,
110+
"DependOn",
111+
new object[] {
112+
"com.android.support",
113+
packageName,
114+
version
115+
},
116+
namedArgs: new Dictionary<string, object>() {
117+
{
118+
"packageIds",
119+
new string[] {
120+
"extra-android-m2repository"
121+
}
122+
}
123+
});
124+
}
125+
}
126+
}

Facebook.Unity.Arcade/Facebook.Unity.Arcade.csproj renamed to Facebook.Unity.Gameroom/Facebook.Unity.Gameroom.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
66
<ProjectGuid>{D8F7CF97-7FE9-48B7-A30C-CB14BAA73010}</ProjectGuid>
77
<OutputType>Library</OutputType>
8-
<RootNamespace>Facebook.Unity.Arcade</RootNamespace>
9-
<AssemblyName>Facebook.Unity.Arcade</AssemblyName>
8+
<RootNamespace>Facebook.Unity.Gameroom</RootNamespace>
9+
<AssemblyName>Facebook.Unity.Gameroom</AssemblyName>
1010
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
1111
<ReleaseVersion>
1212
</ReleaseVersion>
@@ -40,8 +40,8 @@
4040
</Reference>
4141
</ItemGroup>
4242
<ItemGroup>
43-
<Compile Include="ArcadeWrapper.cs" />
4443
<Compile Include="Properties\AssemblyInfo.cs" />
44+
<Compile Include="GameroomWrapper.cs" />
4545
</ItemGroup>
4646
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
4747
<ItemGroup>

0 commit comments

Comments
 (0)