Skip to content

Commit 7fe6774

Browse files
JordiFBfacebook-github-bot
authored andcommitted
Removed fetching app configuration data before calling FB.Init
Summary: Removed fetching app configuration data before calling FB.Init in BaseActivity.java. Seems like old UnityEngine versions had issues with Share methods but testing with Unity 2019 ( the minimum Unity Engine supported since version 14.1.0 ) this issue is not happening anymore. Reviewed By: SergioGuerreroFB Differential Revision: D45940165 fbshipit-source-id: fecc3b1c5910ec74aa757a6e118435d843b1b86d
1 parent 7ba25ae commit 7fe6774

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

facebook-android-wrapper/src/com/facebook/unity/BaseActivity.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@ public abstract class BaseActivity extends Activity {
3535
protected void onCreate(Bundle savedInstanceState) {
3636
super.onCreate(savedInstanceState);
3737
mCallbackManager = CallbackManager.Factory.create();
38-
39-
// During a share or other activity switch this activity may be destroyed.
40-
// The UnityActivity will also get killed and the developers game will need to restart and
41-
// the callback won't be registered. But to avoid throwing an exception initialize the sdk
42-
// to allow the callback to complete.
43-
if (!FacebookSdk.isInitialized()) {
44-
FacebookSdk.sdkInitialize(getApplicationContext());
45-
}
4638
}
4739

4840
@Override

facebook-android-wrapper/src/com/facebook/unity/FB.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ public static void Init(final String params_str) {
123123
// (Deprecated) Attempt to initialize SDK manually with FB.Init args
124124
FacebookSdk.setClientToken(unity_params.getString("clientToken"));
125125
FacebookSdk.setApplicationId(appID);
126+
FacebookSdk.setAutoInitEnabled(true);
127+
FacebookSdk.fullyInitialize();
126128
FacebookSdk.sdkInitialize(FB.getUnityActivity(), new FacebookSdk.InitializeCallback() {
127129
@Override
128130
public void onInitialized() {

0 commit comments

Comments
 (0)