Cross platform synchronisation using Facebook in Unity - facebook

So I am developing this RPG mobile game in Unity with a lot of coins and firearms and purchases and the like. I want to allow the user to carry their achievements to another device (synch), should they decide to change their device or whatever, so they won't have to start everything from the very beginning. I know this is possible using Facebook SDK, but don't know how. Could anyone please help me?

You probably have a database? Username can be the e-mail - that way he can login on any device with the same username and gets all the data related to his game account.
Same is with Facebook as you suggested, he logs-in with his account (e-mail) and gets the accounts data.
If you don't have a database and store everything locally, you could store it to a file and then transfer the file to another system - that would be the simplest manual approach (but not recommended).

Related

General Question about User Identification in App Developement

I am new to Mobile App Developing and started out with Flutter. I have a fundamental Question about App Developing.
Basically I`ve tried to look into the mechanics of user identification and indepentant of that purchase management (buying, restoring, etc). I have skimmed through the example and description of the package in_app_purchase and didnt see anything to really identify the user by their AppStore/GooglePlay Account. So i guess the package just calls some System Method which asks AppStore/GooglePlay with the logged in (into the Device) User and the App from which the call comes from as context to fetch the purchases made by the user within the App. I think the reason for that could be to evade Devs from aquiring identifiying information without the users consent (so user data protection).
Did I get that right? Is there really no way to aquire some unique UserId from the AppStore/GooglePlay? If no, i guess the only way to get this information is by making the user create an account in your app, like in Web Development.

Link multiple accounts iOS app - Firebase/Facebook Login & XCode/Swift 5

So I'm building this app for a client (It's a basic scheduling app like HootSuite but simpler) and he wants the ability to add multiple Facebook accounts with an IAP (aka In-App Purchase) after said IAP is purchased. The IAP is all done and works great but I cannot figure out how to link multiple Facebook accounts. I tried to use the same login method that a previous developer used (It's an ongoing freelance project and 2 other devs worked on it before I joined) to no avail since the login process stops once the app realizes that the user has already signed in...
So I guess that my question is this: Is there a way to link multiple Facebook accounts at once in a single iOS app? If so, how exactly? Forget the IAPs if that's too confusing, everything is fine there anyways. The goal is to be as seamless as possible, so ideally there would be no need for the user to log out and log back into the other account (Something I've seen a lot in other Questions/Answers).
I don't think I am authorized to show the code to you guys (that would also require sharing the entire project, it's a real spider-web!), but could someone please lead me in the right direction?
Please let me know if you have any questions!
Thank you in advance.
Notes:
Just like the title says, we use Firebase for our storage, Cloud Firestore for our database and Facebook login (through Firebase) for login since the purpose of the app is to schedule posts on IG.
I use a basic variable called "activeUsers" to track the number of accounts "linked" to the app so we can know whether or not to show the "PurchaseModel" and, obviously, receipt verification and all that for IAPs. Thought it could be useful!
3. When the app starts, you are prompted to link a Facebook account to enable the scheduler. THIS WORKS GREAT! What I am trying to achieve is to add other accounts AFTER the first one has been "enabled"/logged into.
It's not possible to link multiple accounts from the same provider to a single Firebase Auth account.
You can only link multiple accounts of different types (Facebook, Google, GitHub, etc) to a single Firebase account as described in the documentation.

How to post to someone's FaceBook / Twitter w/o their password (but with their permission)?

I don't use either FaceBook or Twitter, so I am somewhat hampered here.
A friend is going on a once in a life-tine yacht journey and their will be a satellite modem which reports latitude/longitude (and some more data) data on a regular basis. This data gets stored in a database, to which I will have access.
My friend wants to Face/Tweet updates, hopefully with a Google Maps map. He doesn't want to give me his passwords as that would give me full access and let me read his private stuff.
I quite understand that, but what are my options? Obviously, the APIs to FaceTweet won't allow me to post without (his) credentials. Can I create accounts of my own and he can then configure his FaceTweet to say "anything that gets posted there, I want to post it on my site too"? Does Face/Tweet offer such a facility?
The alternative seems to be to code a desktop app to scan the database regularly and post new updates using his password which he must enter into the app, so the app must run on his home PC.
Of course, that is not perfect; if his home PC crashes when he is away then the updates will cease. If it runs on my server, then no problem, but he doesn't want to give me his password and lives too far away to come here and type it in himself.
Can anyone advise me as to how best to implement this? Thanks in advance.
For Facebook you will have to create an application with "Post on your behalf" permission.
Update:
For Twitter it's much trickier: you will have to deal with OAuth tokens to access someone's account after you ask user to authenticate. Here is a fine article on that. You will have to press some free PDF download on our members page and it will ask for you e-mail, but you can press cancel and it redirects you to article anyway.

How To Handle User Login/Registration?

I have an iPhone app that uses core data. I want to add account management to this app for backup and social reasons. What is the easiest way to handle account registration and login? Will I need to create a PHP script or create an XML/JSON file?
Any advice would be great. I have no idea what to do (I'm only familiar with Cocoa Touch).
Edit:
I think I will be going with a twitter login. Hmm, so if I do a twitter login, when the user signs in, their account data will be loaded into my database? Or something similar? I think I still need my own server because if a user signs in from another device, their data should show up there too.
From a usability standpoint, it would be best to use login's from Facebook or Twitter as the user will generally prefer to have a single login. They make sdk's for this, and it also reduces the amount of work you have to do on your end to maintain accounts. If the account is essential to your app then explore other options, but if it is just social, as you mentioned above, don't reinvent the wheel.

How do you limit a Facebook app to a small number of people during testing?

I know about test accounts, but during beta I'd like to allow access only to my friends, and then later friends-of-friends, and then only eventually Kevin Bacon and his friends.
That would probably suck, wouldn't it? The app would be listed (is there a way to prevent listing?) and someone I don't know might try it and get a "sorry, this is in development message." I imagine they'd be irritated and not come back.
From what I've read, only a few apps take off, but when they take off, they REALLY take off. Do developers just release these things fully baked?
Anyone start out with OpenSocial or other smaller-than-Facebook networks?
Any ideas for a soft, gradual, restricted roll-out?
Once you've set up your application, there is a setting in the Developer application control panel for your app: Your app -> Advanced -> Sandbox Mode.
Sandbox mode lets you restrict access to only those people listed as developers (under the Basic section).
In terms of expanding the app, Facebook doesn't provide much more flexibility that the Sandbox mode. Unfortunately, adding everyone as Developers of the app doesn't work very well for a beta, as people can access the application control panel once they are a developer. I ended up putting a whitelist of Facebook Ids into the front controller of my application for a previous beta, and it worked fairly well.
The apps are only listed in the App Directory if you submit them and they are accepted. There's no issue about preventing listing, it's something you have to apply for.
As for restricting users, you can accomplish it with a script in the application that checks whether the currently logged-in user is within your restricted user set. For example, if you only want friends of yourself, check whether the current user is friends with your user id. If not, simply display an error/message page or redirect them to the Facebook home page (or wherever). Add this check to the rest of the start-up logic run each page (such as connecting to your DB and authenticating with Facebook).
What I have done in some cases is keep a database table with the user id's of users who are allowed access, essentially a "whitelist". If the user isn't in the table, redirect them.