Hi everybody,
Im having issue with Android platform build, that is crashing app every time Facebook login is started, IOS version works fine.
Below is log from Android device monitor.
11-06 10:09:17.175: E/AndroidRuntime(17080): FATAL EXCEPTION: main
11-06 10:09:17.175: E/AndroidRuntime(17080): Process: com.celebrity.ninja, PID: 17080
11-06 10:09:17.175: E/AndroidRuntime(17080): java.lang.Error: FATAL EXCEPTION [main]
11-06 10:09:17.175: E/AndroidRuntime(17080): Unity version : 2017.4.14f1
11-06 10:09:17.175: E/AndroidRuntime(17080): Device model : LGE LGLS990
11-06 10:09:17.175: E/AndroidRuntime(17080): Device fingerprint: lge/g3_global_com/g3:6.0/MRA58K/162291543a76c:user/release-keys
11-06 10:09:17.175: E/AndroidRuntime(17080): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/facebook/FacebookActivity;
11-06 10:09:17.175: E/AndroidRuntime(17080): at com.facebook.login.LoginManager.getFacebookActivityIntent(LoginManager.java:655)
11-06 10:09:17.175: E/AndroidRuntime(17080): at com.facebook.login.LoginManager.tryFacebookActivity(LoginManager.java:630)
11-06 10:09:17.175: E/AndroidRuntime(17080): at com.facebook.login.LoginManager.startLogin(LoginManager.java:567)
11-06 10:09:17.175: E/AndroidRuntime(17080): at com.facebook.login.LoginManager.logInWithReadPermissions(LoginManager.java:402)
11-06 10:09:17.175: E/AndroidRuntime(17080): at com.facebook.unity.FBLogin.login(FBLogin.java:155)
11-06 10:09:17.175: E/AndroidRuntime(17080): at com.facebook.unity.FBLogin.loginWithReadPermissions(FBLogin.java:43)
11-06 10:09:17.175: E/AndroidRuntime(17080): at com.facebook.unity.FBUnityLoginActivity.onCreate(FBUnityLoginActivity.java:40)
11-06 10:09:17.175: E/AndroidRuntime(17080): at android.app.Activity.performCreate(Activity.java)
11-06 10:09:17.175: E/AndroidRuntime(17080): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java)
11-06 10:09:17.175: E/AndroidRuntime(17080): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java)
11-06 10:09:17.175: E/AndroidRuntime(17080): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java)
11-06 10:09:17.175: E/AndroidRuntime(17080): at android.app.ActivityThread.access$900(ActivityThread.java)
11-06 10:09:17.175: E/AndroidRuntime(17080): at android.app.ActivityThread$H.handleMessage(ActivityThread.java)
11-06 10:09:17.175: E/AndroidRuntime(17080): at android.os.Handler.dispatchMessage(Handler.java)
11-06 10:09:17.175: E/AndroidRuntime(17080): at android.os.Looper.loop(Looper.java)
11-06 10:09:17.175: E/AndroidRuntime(17080): at android.app.ActivityThread.main(ActivityThread.java)
11-06 10:09:17.175: E/AndroidRuntime(17080): at java.lang.reflect.Method.invoke(Native Method)
11-06 10:09:17.175: E/AndroidRuntime(17080): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
11-06 10:09:17.175: E/AndroidRuntime(17080): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
11-06 10:09:17.175: E/AndroidRuntime(17080): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.FacebookActivity" on path: DexPathList[[zip file "/data/app/com.celebrity.ninja-2/base.apk"],nativeLibraryDirectories=[/data/app/com.celebrity.ninja-2/lib/arm, /data/app/com.celebrity.ninja-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
11-06 10:09:17.175: E/AndroidRuntime(17080): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
11-06 10:09:17.175: E/AndroidRuntime(17080): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
11-06 10:09:17.175: E/AndroidRuntime(17080): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
11-06 10:09:17.175: E/AndroidRuntime(17080): ... 19 more
11-06 10:09:17.175: E/AndroidRuntime(17080): Suppressed: java.lang.NoClassDefFoundError: com.facebook.FacebookActivity
11-06 10:09:17.175: E/AndroidRuntime(17080): at dalvik.system.DexFile.defineClassNative(Native Method)
11-06 10:09:17.175: E/AndroidRuntime(17080): at dalvik.system.DexFile.defineClass(DexFile.java:226)
11-06 10:09:17.175: E/AndroidRuntime(17080): at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
11-06 10:09:17.175: E/AndroidRuntime(17080): at dalvik.system.DexPathList.findClass(DexPathList.java:338)
11-06 10:09:17.175: E/AndroidRuntime(17080): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
11-06 10:09:17.175: E/AndroidRuntime(17080): ... 21 more
11-06 10:09:17.175: E/AndroidRuntime(17080): Suppressed: java.lang.ClassNotFoundException: com.facebook.FacebookActivity
11-06 10:09:17.175: E/AndroidRuntime(17080): at java.lang.Class.classForName(Native Method)
11-06 10:09:17.175: E/AndroidRuntime(17080): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
11-06 10:09:17.175: E/AndroidRuntime(17080): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
11-06 10:09:17.175: E/AndroidRuntime(17080): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
11-06 10:09:17.175: E/AndroidRuntime(17080): ... 20 more
11-06 10:09:17.175: E/AndroidRuntime(17080): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
Also when I start the app i get notification that Android support library v4 23.0.0+ is required, and I'm suspecting that this could be causing crash. I search how to resolve this, but did not managed from some post I found.
Any help would be appreciated.
↧
Facebook SDK login crashes application on Android
↧
Facebook SDK 7.14 sprays NullReferenceException: Object reference not set to an instance of an object in Unity Editor 2018.2
When using Facebook SDK in Unity Editor, this side effect is present in Facebook SDK 7.13 and 7.14, when using Unity 2018 (and previously 2017).
### Repro steps:
1. Install Facebook SDK 7.14 in Unity 2018.2
2. Activate the Facebook dialog in Unity Editor (GUI debug window)
3. Press Send Cancel button
###Result:
- Console fires the
NullReferenceException event,
repeatedly.
- Does not go away if
playback stopped.
- List item
Have to restart Unity Editor to clear it.
###Problem:
- Console is essentially rendered useless whenever Facebook SDK is used in Unity Editor. Debugging Facebook features is messy.
↧
↧
facebook Login Script user_about_me, user_birthday", AuthCallback ??? not working!
hey guys what did i do wrong?
its somthing with this line... `user_about_me, user_birthday", AuthCallback`
i dont know how to fix this
using Facebook.Unity;
using UnityEngine;
public class FBHolder : MonoBehaviour
{
void Awake()
{
FB.Init(SetInit, OnHideUnity);
}
private void SetInit()
{
Debug.Log("FaceBook Init done");
if (FB.IsLoggedIn)
{
}
else
{
}
}
private void OnHideUnity(bool isGameShown)
{
if (!isGameShown)
{
Time.timeScale = 0;
}
else
{
Time.timeScale = 1;
}
}
void FBLogin()
{
FB.LogInWithReadPermissions("user_about_me, user_birthday", AuthCallback);
}
void AuthCallback(IResult result)
{
if (FB.IsLoggedIn)
{
Debug.Log("FB Login Worked!");
}
else
{
Debug.Log ("FB LOgin Fail");
}
}
}
↧
facebook profile pic not working
When i logg in my name shows up so that works but my profile picture doesnt show up
i did put the profilepic game object dropbox
this is my script problem is at the bottom of the script in ( `void DisplayProfilePic(IGraphResult result)`
using System;
using System.Collections.Generic;
using Facebook.Unity;
using UnityEngine;
using UnityEngine.UI;
public class FBScript : MonoBehaviour
{
public GameObject BPMLogo;
public GameObject DialogLoggedIn;
public GameObject DialogLoggedOut;
public GameObject DialogLogUsername;
public GameObject DialogLogProfilePic;
void Awake()
{
FB.Init(SetInit, OnHideUnity);
}
void SetInit()
{
Debug.Log("FaceBook Init done");
if (FB.IsLoggedIn)
{
Debug.Log("FB is Logged in");
}
else
{
Debug.Log("FB is Not! Logged in");
}
DealWithFBMenus(FB.IsLoggedIn);
}
void OnHideUnity(bool isGameShown)
{
if (!isGameShown)
{
Time.timeScale = 0;
}
else
{
Time.timeScale = 1;
}
}
public void FBLogin()
{
List permissions = new List();
permissions.Add("public_profile");
FB.LogInWithReadPermissions(permissions, AuthCallback);
}
void AuthCallback(IResult result)
{
if (result.Error != null)
{
Debug.Log(result.Error);
}
else
{
if (FB.IsLoggedIn)
{
Debug.Log("FB is Logged in");
}
else
{
Debug.Log("FB is Not! Logged in");
}
DealWithFBMenus(FB.IsLoggedIn);
}
}
void DealWithFBMenus(bool isLoggedIn)
{
if (isLoggedIn)
{
DialogLoggedIn.SetActive(true);
DialogLoggedOut.SetActive(false);
BPMLogo.SetActive(false);
DialogLogProfilePic.SetActive(true);
FB.API("/me?fields=first_name", HttpMethod.GET, DisplayUsername);
FB.API("/me/picture?type=square&height=1286width=128", HttpMethod.GET, DisplayProfilePic);
}
else
{
DialogLoggedIn.SetActive(false);
DialogLoggedOut.SetActive(true);
BPMLogo.SetActive(true);
DialogLogProfilePic.SetActive(false);
}
}
void DisplayUsername(IResult result)
{
Text Username = DialogLogUsername.GetComponent();
if (result.Error == null)
{
Username.text = "Hi Thare," + result.ResultDictionary["first_name"];
}
else
{
Debug.Log(result.Error);
}
}
void DisplayProfilePic(IGraphResult result)
{
if ( result.Texture != null)
{
SpriteRenderer ProfilePic = DialogLogProfilePic.GetComponent ();
ProfilePic.sprite = Sprite.Create(result.Texture, new Rect(0, 0, 128, 128), new Vector2(0, 0));
ProfilePic.GetComponent();
}
}
}
↧
Facebook Login to create User account in my App
Hello,
I have just a quick question. I am currently developing an App for Android and IOS in Unity. I have managed to implement the Facebook login/logout. The application needs to store quite a few data about the user, such as Nickname, XP, level etc. in a database. Now, I am a bit confused on how to make sure that whenever the user logs in via Facebook (e.g. on different smartphone) then he/she will get all the accurate data from the database. Is it a good idea to get user's Facebook ID as a link between the Facebook account and the application account?
I would be also glad for any advice with link to any helpful documentation, tutorial, course etc.
↧
↧
Facebook SDK + Admob build Error
I am using Facebook SDK, Playfab and Admob SDk in my project. Facebook SDK version is 7.9.0 which uses support-v4-23.4.0.aar and Admob is latest version which uses com.android.support.support-v4-26.1.0.aar file.
When I try to build with these files inside it obviously throws build error because of duplicate classes in AAR files. After removing
support-v4-23.4.0.aar
customtabs-23.4.0.aar
support-annotations-23.4.0.jar
the project builds successfully but Admob ads are not shown. However Facebook functions work perfectly.
I have attached a screenshot of both "plugins" folders.
Been trying to resolve the issue from last few days, but did not have any solution. PLEASE HELP![alt text][1]
[1]: /storage/temp/128709-capture.jpg
↧
android Manifest merge error,android Bulid Error...
I implemented Facebook login using Facebook SDK, GooglePlayGame SDK and FireBase SDK.
I get an error when I try to build an Android.
CommandInvokationFailure: Unable to merge android manifests.
C:/Program Files/Java/jdk1.8.0_181\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:\Users\SUDAL\AppData\Local\Android\sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Error: [Temp\StagingArea\AndroidManifest-main.xml, C:\Users\Public\Documents\Unity Projects\LOGIN\Temp\StagingArea\android-libraries\com.google.firebase.firebase-iid-17.0.3\AndroidManifest.xml:12] Trying to merge incompatible /manifest/application/service[@name=com.google.firebase.components.ComponentDiscoveryService] element:
--
++
--
++
↧
Facebook Sdk got crash on initalization on Api Level Between 14 to 16
i have used Facebook sdk 7.13.0 its works find in some higher version of device in android but it will crash when it initialized in android version lower than 6.0
pls help..!!
↧
Need to Authenticate users with Google, FB and the like on a UWP project
Hello users,
I am a noob at authentication and was asked to authenticate a user from Google and Facebook on a Windows platform(Windows 10 PC). I tried to understand how projects are made in UWP or how to deploy them but was lost at sea from the beginning. **Can anyone help me understand and learn how to deploy a project on Windows Platform and Authenticate a user by his/her Google or Facebook ID?**
If I can even fetch their usernames and/or some Unique ID on these platforms I can work from there.
*Please Help!*
↧
↧
Unable to convert classes into dex format.
![alt text][1]
[1]: /storage/temp/130189-dexformat.png
I am trying to integrate google admob and Facebook intergration(login,sharing and invite). When i am trying to build APK then i have received two errors.
1 --> Failed to re-pack resources.
2 --> Unable to convert classes into dex format.
So please help to solve these issue.
Thanks
↧
FB plugin update throwing SetUserSuffixAgent exception on Android.
Hi,
We recently upgraded our FB unity plugin from 7.9.4 to 7.13. This works fine on all the platform excepts android. We are getting an exception mentioned below while trying to call FB.Init() function. We are not getting any call back from this function as well.
_AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='SetUserAgentSuffix' signature='(Ljava/lang/String;)V' in class Ljava.lang.Object; E/Unity (18114): java.lang.NoSuchMethodError: no static method with name='SetUserAgentSuffix' signature='(Ljava/lang/String;)V' in class Ljava.lang.Object; E/Unity (18114): at com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source) E/Unity (18114): at com.unity3d.player.UnityPlayer.nativeRender(Native Method) E/Unity (18114): at com.unity3d.player.UnityPlayer.c(Unknown Source) E/Unity (18114): at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source) E/Unity (18114): at android.os.MessageQueue.next(MessageQueue.java:221) E/Unity (18114): at android.os.Looper.loop(Looper.java:164) E/Unity (18114): at com.unity3d.player.UnityPlayer$e.run(Unknown Source) E/Unity (18114): at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in :0 E/Unity (18114): at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in :0 E/Unity (18114): at UnityEngine.AndroidReflection.GetMethodMember (IntPtr jclass, System.String me _
Our minSdkVersion = 19, targetSdkVersion = 27 Most of android libraries are of 27.1.1 version. for ex :- com.android.support.support-v4-27.1.1
Thanks, Gaurav
_AndroidJavaException: java.lang.NoSuchMethodError: no static method with name='SetUserAgentSuffix' signature='(Ljava/lang/String;)V' in class Ljava.lang.Object; E/Unity (18114): java.lang.NoSuchMethodError: no static method with name='SetUserAgentSuffix' signature='(Ljava/lang/String;)V' in class Ljava.lang.Object; E/Unity (18114): at com.unity3d.player.ReflectionHelper.getMethodID(Unknown Source) E/Unity (18114): at com.unity3d.player.UnityPlayer.nativeRender(Native Method) E/Unity (18114): at com.unity3d.player.UnityPlayer.c(Unknown Source) E/Unity (18114): at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source) E/Unity (18114): at android.os.MessageQueue.next(MessageQueue.java:221) E/Unity (18114): at android.os.Looper.loop(Looper.java:164) E/Unity (18114): at com.unity3d.player.UnityPlayer$e.run(Unknown Source) E/Unity (18114): at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in :0 E/Unity (18114): at UnityEngine.AndroidJNISafe.CallStaticObjectMethod (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in :0 E/Unity (18114): at UnityEngine.AndroidReflection.GetMethodMember (IntPtr jclass, System.String me _
Our minSdkVersion = 19, targetSdkVersion = 27 Most of android libraries are of 27.1.1 version. for ex :- com.android.support.support-v4-27.1.1
Thanks, Gaurav
↧
Social sharing on Standalone build
TLDR;
How to share image in standalone builds?
----------
We are mobile game development but recently making our first PC game.
We want to make a sharing button that simply share screenshot to **Facebook**, **Twitter**, **Discord**, and probably **Reddit**... It can be a public-share (no SDK and login) or a targeted friend-share (may need SDK and login).
While there's a lot solutions in mobile, I searched and was really surprised that there seems not existing solution for PC at all...
The closest I found seems to be [Facebook's Games SDK for PC][1], it's only on beta and we may not need all its function...
I understand most PC players can just screenshot and share manually, but it would be nice if that can be done with a button, analytics and even referral system.
Any suggestion? [1]: https://developers.facebook.com/docs/games/pc-games
We want to make a sharing button that simply share screenshot to **Facebook**, **Twitter**, **Discord**, and probably **Reddit**... It can be a public-share (no SDK and login) or a targeted friend-share (may need SDK and login).
While there's a lot solutions in mobile, I searched and was really surprised that there seems not existing solution for PC at all...
The closest I found seems to be [Facebook's Games SDK for PC][1], it's only on beta and we may not need all its function...
I understand most PC players can just screenshot and share manually, but it would be nice if that can be done with a button, analytics and even referral system.
Any suggestion? [1]: https://developers.facebook.com/docs/games/pc-games
↧
Share Screenshot Image to Facebook with Facebook SDK
Since facebook is not permitted to share photos with { "publish_actions" } anymore, is there any other way to share photo to facebook from unity app like a screenshot? Which apis should I use for that?
↧
↧
Facebook network banner ads in unity - any documentation/tutorials?
Hi,
I thought I would try out fabook network ads in a new game we are working on. Although I have managed to find info regarding the sdk and importing it into unity (pretty straightforward) I can't seem to find any info as to how set up the script to initialize and load/hide the ads. facebook's documentation all seem to be for android studio and in what seems to be Java.
Are there any instructions for unity/c#?
Also do unity do banner ads as well as videos? or is it all just using Admob (which I can't seem to create an account for)
thank you
I thought I would try out fabook network ads in a new game we are working on. Although I have managed to find info regarding the sdk and importing it into unity (pretty straightforward) I can't seem to find any info as to how set up the script to initialize and load/hide the ads. facebook's documentation all seem to be for android studio and in what seems to be Java.
Are there any instructions for unity/c#?
Also do unity do banner ads as well as videos? or is it all just using Admob (which I can't seem to create an account for)
thank you
↧
Game crash on android due to facebook sdk?
![alt text][1]Hey all,
I've been grappling with this bug for a while. I had installed the facebook plugin for ads, admod, etc. just to fool around. However,even after uninstalling all related files from my project, my game now crashes at start. It builds fne, installs fine, but just immediatly crashes. I captured the logcat, but it's nothing to my eyes. Any tips anyone?][1]][1]
[1]: /storage/temp/131747-crash-report.png
↧
Didn't loading facebook instant game
I have created a facebook WebGL instant game using Facebook SDK that supports Unity 2018.3.0f2. once it uploaded to the facebook host then I send it to the review. each and every time reviews say that the game didn't load properly. but exact same WebGL build runs smoothly in other hosting services like 000webhosting. do I need to change anything in the HTML or UnityLoader.js file? please help it's urgent
↧
Implement Facebook Leaderboards for iOS/Android
Hi,
I've been using Unity for several months now. I taken a look at the Facebook SDK, and been wondering what is the best way to implement Facebook Leaderboards.
I have an app, let's call it "Flappy Bird" for the sake of this example. I have Flappy Bird on iOS (Apple App Store) and Android (Google Play). I want both of them to have the same leaderboard table.
Users on either iOS or Android would see the same global Facebook leaderboard. They can also view their "friends" leaderboard - a leaderboard consisting of their friends scores.
Where should I store these scores? I can't store them on the Game Center, because that's iOS specific (it won't support Android), because I want a leaderboard with the same hiscores for the two platforms. I could store it in a MySQL database on my server? Firebase looks too expensive for me.
On my MySQL database, I would have a table with columns: application_id, user_id (would be the user's Facebook ID), display_name, score.
Would this be a good design? Then in Unity, I would use JSON or a HTTP GET REQUEST to obtain the leaderboards and a HTTP POST REQUEST to set their score (slightly insecure but that's fine).
What are the best practices? I have never made a leaderboard before, but I see Google Play Services and Game Center, but these leaderboards are not platform independent, neither do they allow a "Facebook" friends leaderboard.
Thanks!
↧
↧
how can i get facebook friends who currently online and playing the game?,is there any way to get our facebook friends who are currently online and playing the game ??
i need to get the current active facebook friends who are currently playing the game, i got the facebook friends list who have been playing, but couldnt get active online players, kindly help,i need to get the current active facebook players who are in the game, i did get my friends list but couldint check whether they are online or not, kindly help
↧
Facebook Login does not disable login button and show logout
I've used the example script and changed it to my needs, It logs in fine, allows a user to enter facebook details, prompts with the auth page and then logs in, however, it does not seem to change my scene, for example. The logout button is hidden if the auth is not completed. And is meant to show when it is.
This is my code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Facebook.Unity;
using UnityEngine.SceneManagement;
public class FacebookManager : MonoBehaviour
{
public Text txtStatus;
public Text CoinStatus;
public GameObject btnLi, btnLo, BtnPlay, BtnCoin;
//public GameObject ProfilePicture;
public Image ProfilePicture;
void Awake()
{
if (!FB.IsInitialized)
{
FB.Init(InitCallback, OnHideUnity);
btnLi.SetActive(true); btnLo.SetActive(false); BtnPlay.SetActive(false);
}
else
{
FB.ActivateApp();
btnLi.SetActive(true); btnLo.SetActive(false); BtnPlay.SetActive(false);
}
}
private void InitCallback()
{
if (FB.IsInitialized)
{
FB.ActivateApp();
}
else
{
txtStatus.text = "Failed to Initialize the Facebook SDK";
}
if (FB.IsLoggedIn)
{
FB.API("/me?fields=name", HttpMethod.GET, DispName);
FB.API("me/picture?type=square&height=128&width=128", HttpMethod.GET, GetPicture);
btnLi.SetActive(false); btnLo.SetActive(true); BtnPlay.SetActive(true);
}
else
{
SceneManager.LoadScene("Start", LoadSceneMode.Single);
txtStatus.text = "Please login to continue.";
btnLi.SetActive(true); btnLo.SetActive(false); BtnPlay.SetActive(false);
}
}
private void OnHideUnity(bool isGameShown)
{
if (!isGameShown)
{
Time.timeScale = 0; //pause
}
else
{
Time.timeScale = 1; //resume
}
}
public void LoginWithFB()
{
var perms = new List() { "public_profile" };
FB.LogInWithReadPermissions(perms, AuthCallback);
}
public void LoadCoin()
{
}
public void LogoutFromFB()
{
SceneManager.LoadScene("Start", LoadSceneMode.Single);
FB.LogOut(); btnLi.SetActive(true); btnLo.SetActive(false);
}
private void AuthCallback(ILoginResult result)
{
if (result.Error != null)
{
txtStatus.text = result.Error;
}
}
void DispName(IResult result)
{
if (result.Error != null)
{
txtStatus.text = result.Error;
}
else
{
txtStatus.text = "" + result.ResultDictionary["name"];
}
}
private void GetPicture(IGraphResult result)
{
if (result.Error == null && result.Texture != null)
{
//http://stackoverflow.com/questions/19756453/how-to-get-users-profile-picture-with-facebooks-unity-sdk
/*if (result.Texture != null) {
Image img = ProfilePicture.GetComponent ();
img.sprite = Sprite.Create (result.Texture, new Rect (0, 0, 128, 128), new Vector2 ());
}*/
ProfilePicture.sprite = Sprite.Create(result.Texture, new Rect(0, 0, 128, 128), new Vector2());
}
}
}
↧
Using google play or facbook to create and login to an account. Or Other method?
Bit of a lengthy question, sorry...
Which is better? or having all might be better? well my first question is can GP and FB features be used on a PC, iOS or linux build, or is it only designed for mobile? next is if neither of these are a good way to login and create a new player, what method would you all suggest. I want to make it so certain data can be stored (that i can figure out, have just havnt completed it all yet). I started thinking about player username and pass, how to save and use the data securely. I did start to create my own using PlayerPref's for functionality testing, then swapped it over to a persistent data file in the %appdata% file, Butt.. that's not very secure for password and such. even trying to encrypt and decrypt a serializeable file, isnt always safe either. I need professional help with this one, not a simple fix.
*Note: Would like to add an achievement, and leaderboard's features like google play but may need to write my own.
Everywhere i read suggest PHP and MySQL. I've only touched base on MySQL a few times with modding and server creation on already created games.. it was a long time ago and i forget most of it. PHP i may have dabbled with at the same time but I don't remember last week let alone 4 years ago lol. Joking aside, I know that Unity is working on going the dedicated server route with their new networking system they currently are building and working on, seeing as im still in early development, its the perfect time to prepare for the next generation of networking and not fall back on the old soon to be deprecated (in 2 years time to be exact also after the new systems actual release date that is) network services. This may cause me to wait a bit for its release which was supposed to be in the summer... its now February...If i want my game to continue onward, after they kill P2P then a rewrite would be in order anyway. at this time, I've got about 3 mini games completed for my pack of 20 games. Most of the games that will be included have been already included in most of the code, all i have to do is activate or deactivate ones that are not finished or ready, when doing this all the games assets and such will be part of next build. i have the core program managers mostly done, and a few of the games managers, Absolutely nothing on online anything at the moment, only set up for a stand alone until i get this all worked out.
↧